Post

Replies

Boosts

Views

Activity

Live Activity minimal presentation is cut off in iOS 17+
Hey there, I have noticed that my Live Activity's minimal presentation sometimes gets cut off when there is another app's Live Activity present. I tried adjusting the view in a number of ways, but it always seems to get cut off I'm just curious if this is a known issue with iOS 17, or if there is a potential workaround. This issue did not occur on iOS 16, and I've even updated to iOS 17.1 and the issue is still present. The view code is identical Here's the code that goes inside my minimal presentation ProgressView(timerInterval: Date.now...context.attributes.endDate, countsDown: true) { EmptyView() } currentValueLabel: { EmptyView() } .tint(.accent) And here is what ends up happening. I've also seen this with some of Apple's own Live Activities, so I'm assuming this is an iOS bug?
0
0
726
Oct ’23
Including a staleDate in Live Activity request causes activity to be disabled with loading spinner
When I try to initiate a Live Activity using the iOS 16.2 API for it, which includes the staleDate, when the staleDate has passed, rather than transitioning my Live Activity to its special ended state, the Live Activity presumably crashes because it looks disabled with a loading spinner on top My ActivityAttributes struct is fairly simple, and the code that displays the "ended" state is itself not crashing, so unsure if I am doing something wrong Here is the code for my ActivityAttributes: struct TimerActivityAttributes: ActivityAttributes { enum TimerType: Codable { case rest, work } public struct ContentState: Codable & Hashable { var isEnded: Bool } let endDate: Date let exerciseName: String? let timerType: TimerType init(endDate: Date, exerciseName: String? = nil, timerType: TimerType = .rest) { self.endDate = endDate self.exerciseName = exerciseName self.timerType = timerType } } Here is the code that activates the Live Activity: private func startLiveActivityNew( attributes: TimerActivityAttributes, contentState: TimerActivityAttributes.ContentState ) { guard let endDate else { return } let activityContent = ActivityContent(state: contentState, staleDate: endDate) do { ActivityManager.shared.activity = try Activity.request( attributes: attributes, content: activityContent ) } catch (let error) { print("Caught an error: \(error.localizedDescription)") } } Here is the code I use to determine whether to display the ended state (to maintain compatibility with iOS 16.1): private func isEnded(context: ActivityViewContext<TimerActivityAttributes>) -> Bool { if #available(iOS 16.2, *) { if context.state.isEnded || context.isStale { return true } } else if context.state.isEnded { return true } return false } And this is what happens after staleDate has passed. I'm just not sure if I'm missing anything in my implementation
1
0
1.6k
Oct ’23
iOS 26 (beta 7) setting .searchFocused programmatically does not work
Already filed a feedback in case this is a bug, but posting here in case I'm doing something wrong? I'd like the search field to automatically be displayed with the keyboard up when the view appears. This sample code works in iOS 18, but it does not work in iOS 26 beta 7 I also tried adding a delay to setting searchIsFocused = true but that did not help struct ContentView: View { var body: some View { NavigationStack { NavigationLink(destination: ListView()) { Label("Go to list", systemImage: "list.bullet") } } .ignoresSafeArea() } } struct ListView: View { @State private var searchText: String = "" @State private var searchIsPresented: Bool = false @FocusState private var searchIsFocused: Bool var body: some View { ScrollView { Text("Test") } .searchable(text: $searchText, isPresented: $searchIsPresented, placement: .automatic, prompt: "Search") .searchFocused($searchIsFocused) .onAppear { searchIsFocused = true } } }
5
1
171
Oct ’25