Explore the various UI frameworks available for building app interfaces. Discuss the use cases for different frameworks, share best practices, and get help with specific framework-related questions.

All subtopics

Post

Replies

Boosts

Views

Activity

SwiftUI, numeric keypad, and missing keyboard toolbar
Have a SwiftUI TextField with .numberPad keypad. Want to allow the user to make their changes, then hit 'Done' or 'Cancel' to dismiss the keyboard (there are other choices on the page) before hitting 'Submit'. The view containing the field is brought up as a modal, using .FullScreenCover. Here's the code snippet: @State var currentBid: Float = 0 @FocusState var isInputActive: Bool ... TextField("Enter Amount", text: Binding( get: { String(Int(currentBid)) }, set: { currentBid = Float(Int($0) ?? 0) }) ).keyboardType(.numberPad) .focused($isInputActive) .toolbar(content: { ToolbarItemGroup(placement: .keyboard, content: { Button("Cancel") { print("CANCELLED") isInputActive = false } Spacer() Button("Done") { print("DONE") isInputActive = false } }) }) When you tap the text field, the numeric keyboard comes up, but the button bar does not show. This is on iOS 17.6. tested on-device. The alternative is to use a regular alphanumeric keyboard with an "ENTER" button. But the field is to enter a number and I have to either filter the value or discard it in case they enter bad data. I checked online, and others indicated wrapping the whole View inside a NavigationStack might be needed. Tried it and it didn't work. Any suggestions? Thanks!
2
0
92
4d
Issue with observing SwiftData model and UndoManager
I have created a minimum example to demonstrate an issue with observing SwiftData model and UndoManager. This project includes a simple NavigationSplitView, an Item SwiftData model that is being persisted and an enabled UndoManager. Problem: The SwiftData model Item can be observed as expected. Changing the date in the DetailView works as expected and all related views (ListElementView + DetailView) are updated as expected. When pressing ⌘+Z to undo with the enabled UndoManager, deletions or inserts in the sidebar are visible immediately (and properly observed by ContentView). However, when changing the timestamp and pressing ⌘+Z to undo that change, it is not properly observed and immediately updated in the related views (ListElementView + DetailView). Further comments: Undo operation to the model value changes (here: timestamp) are visible in the DetailView when changing sidebar selections Undo operation to the model value changes (here: timestamp) are visible in the ListElementView when restarting the app Undo operation to the model value changes (here: timestamp) are are properly observed and immediately visible in the sidebar, when ommiting the ListElementView (no view encapsulation) Relevant code base: struct ContentView: View { @Environment(\.modelContext) private var modelContext @Query private var items: [Item] @State private var selectedItems: Set<Item> = [] var body: some View { NavigationSplitView { List(selection: $selectedItems) { ForEach(items) { item in ListElementView(item: item) .tag(item) } .onDelete(perform: deleteItems) } .navigationSplitViewColumnWidth(min: 180, ideal: 200) .toolbar { ToolbarItem { Button(action: addItem) { Label("Add Item", systemImage: "plus") } } } } detail: { if let item = selectedItems.first { DetailView(item: item) } else { Text("Select an item") } } .onDeleteCommand { deleteSelectedItems() } } private func addItem() { withAnimation { let newItem = Item(timestamp: Date()) modelContext.insert(newItem) } } private func deleteItems(offsets: IndexSet) { withAnimation { for index in offsets { modelContext.delete(items[index]) } } } private func deleteSelectedItems() { for selectedItem in selectedItems { modelContext.delete(selectedItem) selectedItems.remove(selectedItem) } } } struct ListElementView: View { @Bindable var item: Item var body: some View { Text("Item at \(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))") } } struct DetailView: View { @Bindable var item: Item var body: some View { Text(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard)) DatePicker(selection: $item.timestamp, label: { Text("Change Date:") }) } } @Model final class Item { var timestamp: Date init(timestamp: Date) { self.timestamp = timestamp } } It seems that the UndoManager does not trigger a redraw of the ContentView through the items query? Is this a bug or a feature?
0
0
80
5d
Markdown Parsing Adding Unexpected Paragraph Attributes
I am looking to support rendering markdown text while adding corporate branding styles (typography and colors for headers specified by the design team, etc). All was going well until I encountered Ordered List and began seeing some unexpected behavior. Lets take for example some sample markdown as shown below. let sampleMarkdown: String = """ # Ordered List Test This is some sample markdown used to test ordered lists. 1. Line item one of a sample markdown ordered list. 2. This is the second line item of a sample markdown ordered list. 3. And finally, the third line item of a sample markdown ordered list. """ Now, let's say for each item in the ordered list, I would like to assign a random foreground color to the text. This is straightforward as I can loop over the runs of an attributed string and should I encounter an intentType.kind of .orderedList I can apply the random foreground color as so with clode along the lines of such: for run in pulseAttributedString.runs { if let presentationIntent = run.presentationIntent { for intentType in presentationIntent.components { switch intentType.kind { case .orderedList: let colors: [UIColor] = [.green, .systemPink, ...] container[AttributeScopes.UIKitAttributes.ForegroundColorAttribute.self] = colors.randomElement() } } } } Upon setting the random foreground color to the attribute container, and running in the Simulator you can see the following output. This is very much close to what I'd expect although frustratingly the parser seemed to have stripped out the 1. 2. etc. I'm not sure what the reasoning for that is, or why the .orderedList does not have an associated value representing the index of the line item in the list, similar to how case header(level: Int) includes an associated value for header level. Upon closer inspection, I also see that there is another presentation intent kind of case listItem(ordinal: Int). When I add a case in my switch statement for listItem I see it too is included within the presentation intent components. With that said, I need to restore the 1., 2. etc, would I use case listItem(ordinal: Int) or .orderedList. And what would be the difference between the two? Would someone be able to explain that to me since the documentation for listemItem seems to make no effort to do so. This now leads me to the next issue I was encountering where if I then add emphasis to some words within the ordered list, essentially the same sample markdown above but with emphais on the word one and second: let sampleMarkdown: String = """ # Ordered List Test This is some sample markdown used to test ordered lists. 1. Line item *one* of a sample markdown ordered list. 2. This is the *second* line item of a sample markdown ordered list. 3. And finally, the third line item of a sample markdown ordered list. """ I now encounter the unexpected behavior where the words that received the emphasis also have a paragraph attribute associated with them, as shown in the screenshot below. I can log the presentationIntent and confirm that in my console that there are now presentation intent components for listItem, orderedList and now a paragraph. [paragraph (id 5), listItem 1 (id 4), orderedList (id 3)] So now it appears that in addition to having to restore and insert the 1., 2. etc, to the line items, but now I also need to make sure I strip out the added paragraph intent that gets added to a piece of text has emphaisis within an orderedList line item? This doesn't seem to make sense to me, am I doing something wrong?
0
0
71
5d
XC Test - Xamarin- Mobile Automation - Tiles missing on list view
Unable to see the first element in a Xamarin forms List view while running the automated UI iOS tests using xctest Element with property in Xamarin forms "ListViewCachingStrategy.RetainElement" , the first element is missing from the list view while running the tests in iOS . Inbetween the tests if we remove the WDA and tried the same scenario, it works as expected. The first element was displayed when working with xamarin forms (v4.7.0.1351) and it is observed with only the current version. Manually trying the same scenario does not have any issues , Elements are displayed as expected, issue is observed only through automation
2
0
83
5d
NavigationDestination, NavigationLink with List and ForEach Does Not Work
Dear community, I am a new developer and I am building a view (called Root) that has a list of rows where clicking each row navigates to a completely different view. I have a CaseIteratable enum and I list each enum type using ForEach and each enum case navigates to a different view using NavigationLink and NavigationDestination. But the problem is that clicking any of the rows for the first time navigates correctly to the corresponding view. But when I go back to the root view and chose another row, it navigates me to a blank view for less than a sec and automatically navigates back to the root view. Below is the code for reference. I would really appreciate some help and advice here. Thank you very much! struct RootViewNavigationStack: View { @AppStorage("items") private var items = Item.allCases @State private var enableMove = false @State private var rootStackPath: NavigationPath = .init() var body: some View { NavigationStack(path: $rootStackPath) { VStack { List { ForEach(items) { item in HStack { NavigationLink(value: item) { ListCell( icon: item.icon, title: item.title) } .disabled(enableMove) if enableMove { withAnimation { Image(systemName: "line.3.horizontal") .foregroundStyle(.secondary) } } } } .onMove(perform: enableMove == true ? moveItems : nil) } } .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button { enableMove.toggle() } label: { if enableMove { Text("Done") .bold() } else { Text("Edit") } } } } .navigationDestination(for: Item.self) { item in item.destinationView } .navigationTitle("Root") } } } and this is the Item enum for more info Just kindly ignore the var iconName since it doesnt represent any actual SF Symbol name enum Item: Identifiable, Codable, Hashable, CaseIterable { case view1 case view2 case view3 case view4 case view5 var id: Item { self } } extension Item { var title: String { switch self { case .view1: "View1" case .view2: "View2" case .view3: "View3" case .view4: "View4" case .view5: "View5" } } var iconName: String { switch self { case .view1: "View1" case .view2: "View2" case .view3: "View3" case .view4: "View4" case .view5: "View5" } } var icon: Image { Image(systemName: self.iconName) } @ViewBuilder var destinationView: some View { switch self { case .view1: CarView() case .view2: HouseView() case .view3: MusicView() case .view4: ShoesView() case .view5: BooksView() } } } Once again, would really appreciate someone to help and many thanks 🙏!
4
0
129
5d
SwiftUI.List.scrollDismissesKeyboard(.immediately) causes scroll glitch on List
When the scrollDismissesKeyboard(.immediately) is used on a SwiftUI.List, the scroll is very glitchy when keyboard is open both on simulator and on device. Glitch is visible when content height is smaller than screen height. A sample code to reproduce the issue: struct ContentView: View { @State private var searchText = "" var body: some View { NavigationStack { List { ForEach(0..<1) { index in Rectangle() .fill(Color.blue) .frame(height: 100) .cornerRadius(10) .padding(.vertical, 5) .padding(.horizontal) } } .searchable(text: $searchText) .scrollDismissesKeyboard(.immediately) } } } Steps to Reproduce: Run the code above. Tap on the search bar so the keyboard appears. Scroll the list down. Glitch should be visible. Along with the glitch, there are many warnings being thrown when I interact with the search bar: -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = <null selector>, customInfoType = UIEmojiSearchOperations -[UIApplication getKeyboardDevicePropertiesForSenderID:shouldUpdate:usingSyntheticEvent:], failed to fetch device property for senderID (***) use primary keyboard info instead. This API seems very unstable. Is this a known issue? If so, are there plans on fixing it?
2
1
117
5d
Spatial Event
Hello. I am building an AVP app with a C++ engine in Metal. From Swift, I get a spatial event from the layerRenderer, and I want to send the event data to my engine. But I have a problem: I need the event ID value (SpatialEventCollection.Event.ID), which I can see in the debugger (it has a value of 1 or 2 depending on the hand), but I need that value as an Int to pass it to the engine. Any ideas on how to do this? Thanks.
0
0
76
5d
iOS 18 Beta 2 XCTest: Unable to record and play contacts permission system dialog
Unable to record and play the new contacts permission system dialog. App: https://developer.apple.com/documentation/contacts/accessing-a-person-s-contact-data-using-contacts-and-contactsui func handleContactsAccessAlert() { let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") let allowButton = springboard.buttons["Allow Full Access"] allowButton.tap() let access6ContactsButton = springboard.alerts["Allow full access to 6 contacts?"].scrollViews.otherElements.buttons["Allow"] access6ContactsButton.tap() } func handleContactsPermissionAlert() { let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") let allowButton = springboard.buttons["Continue"] if allowButton.exists { allowButton.tap() sleep(5) handleContactsAccessAlert() } } func testContactPermissions() { let app = XCUIApplication() app.launch() app.buttons["Request Access"].tap() sleep(5) handleContactsPermissionAlert() sleep(5) app.collectionViews/*@START_MENU_TOKEN@*/.staticTexts["Kate Bell"]/*[[".cells.staticTexts[\"Kate Bell\"]",".staticTexts[\"Kate Bell\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap() }
0
0
64
5d
SwiftUI State not reliable updating
Hello, I have a SwiftUI view with the following state variable: @State private var startDate: Date = Date() @State private var endDate: Date = Date() @State private var client: Client? = nil @State private var project: Project? = nil @State private var service: Service? = nil @State private var billable: Bool = false Client, Project, and Service are all SwiftData models. I have some view content that binds to these values, including Pickers for the client/project/service and a DatePicker for the Dates. I have an onAppear listener: .onAppear { switch state.mode { case .editing(let tt): Task { await MainActor.run { startDate = tt.startDate endDate = tt.endDate client = tt.client project = tt.project service = tt.service billable = tt.billable } } default: return } } This works as expected. However, if I remove the Task & MainActor.run, the values do not fully update. The DatePickers show the current date, the Pickers show a new value but tapping on them shows a nil default value. What is also extremely strange is that if tt.billable is true, then the view does update as expected. I am using Xcode 15.4 on iOS simulator 17.5. Any help would be appreciated.
0
0
115
5d
SwiftUI keyboard shortcuts don't become active until view loads
I have a menu bar extra app that includes a sub-menu for lesser used functions. The sub menu implements .keyboardShortcut for a few of the menu items. When the app is first the active app, the keyboard shortcuts only produce a beep UNTIL the sub menu has been accessed. Once the sub-menu has loaded, the keyboard shortcuts work as expected. I should note that the MenuBarExtra is using the .window display mode, if that's important. The submenu appears with a button press within the MenuBarExtra. Is there a method to expose the keyboard shortcuts to the system before the view has loaded?
1
0
75
5d
NavigationStack with NavigationPath triggers multiple init/deinit of views in stack
Hi all, I've noticed some weird behavior when working NavigationStack paired with a NavigationPath, and I'm wondering if it's by design or perhaps a bug. In short: I'm experiencing that every time I push a new view to the NavigationPath, all the previous views appear to init and deinit, which can cause all sorts of problems if you aren't aware of it happening. It's seems like .navigationDestination(for: ) is run once per item in the path that is given to the NavigationStack. So if you add 3 items it'll run 3 times when adding the third view. But the original views and their state are kept. Is this happening because pushing a view to the stack is seen as a state change? And is it intended? The longer explanation: So I'm developing an app in pure SwiftUI and I'm trying to establish a way of navigating through a router / coordinator. I like that my ViewModels can determine when navigation should happen and not the view. E.g. Normally I'd like to prepare some sort of data that should be transferred to the next view. I've prepared an example project which you can use to check out the issue. It's not a full example of my setup, but it's small enough to show what I'm experiencing. It can be found here: https://github.com/Kimnyhuus/NavigationStackDemo The structure is: Router App RootView AppleView + AppleViewModel BananaView + BananaViewModel PearView + PearViewModel So the Router is an ObservableObject that contains a @Published NavigationPath object + functions for adding / removing to / from stack. I've also added an enum here which defines the destinations that the Router can take an navigate to. RootView is setup with a NavigationStack which is setup with the NavigationPath in the parameter: NavigationStack(path: $router.navPath) { ... } RootView also have the router setup as an EnvironmentObject: .environmentObject(router) This enables the other views to interact with the router and push new views to the stack. Each view is initialized with its corresponding VM. The VMs contain nothing other than init and deinit, a variable containing the initialized id + a @Published num which can be set from the view. This is to keep track of the instances in the prints to the console. Each view can navigate to the two other views. You can try and run the project yourselves, but I've made an example of the inits/deinits that happens here. First, I'm navigating from RootView -> AppleView which is expected. The router prints from func navigate(to destination: Destination) that a view has been pushed to the stack. The RootView prints, when .navigationDestination(for: Destination.self) { ...} is triggered, and it says we're navigating to .apple. And then we see that the AppleVM is inited. All like expected. ||| Router: add to navPath: 1 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 879, num: 0 Then I navigate from AppleView -> BananaView and the weird stuff starts happening. We see that a second view has been added to the stack. BananaVM is inited like we'd expect. But then the previous actions seem to run again but with new instances. ||| Router: add to navPath: 2 ||| NavStack: Destination .banana ||| Init ☀️: BananaViewModel, id: 167, num: 0 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 492, num: 0 Then I navigate from BananaView -> PearView and it's continuing. It's now clear that .navigationDestination(for: Destination.self) { ... } is run once per item in the stack. ||| Router: add to navPath: 3 ||| NavStack: Destination .pear ||| Init ☀️: PearViewModel, id: 436, num: 0 ||| NavStack: Destination .banana ||| Init ☀️: BananaViewModel, id: 292, num: 0 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 434, num: 0 ||| Deinit 🔥: AppleViewModel, id: 492, num: 0 Finally I navigate from PearView to AppleView and it's just piling on. ||| Router: add to navPath: 4 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 738, num: 0 ||| NavStack: Destination .pear ||| Init ☀️: PearViewModel, id: 564, num: 0 ||| NavStack: Destination .banana ||| Init ☀️: BananaViewModel, id: 769, num: 0 ||| Deinit 🔥: BananaViewModel, id: 292, num: 0 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 283, num: 0 ||| Deinit 🔥: AppleViewModel, id: 434, num: 0 Navigating back towards the RootView, you can see that it again inits and deinits different instances of the view models. You’ll notice the original ones with state being deinit’ed where it has a number higher than 0 in “num”. ||| Router: rm navPath: 3 ||| NavStack: Destination .banana ||| Init ☀️: BananaViewModel, id: 222, num: 0 ||| Deinit 🔥: BananaViewModel, id: 769, num: 0 ||| NavStack: Destination .pear ||| Init ☀️: PearViewModel, id: 801, num: 0 ||| Deinit 🔥: PearViewModel, id: 564, num: 0 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 173, num: 0 ||| Deinit 🔥: AppleViewModel, id: 283, num: 0 ||| Deinit 🔥: AppleViewModel, id: 738, num: 0 ||| Router: rm navPath: 2 ||| NavStack: Destination .banana ||| Init ☀️: BananaViewModel, id: 26, num: 0 ||| Deinit 🔥: BananaViewModel, id: 222, num: 0 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 744, num: 0 ||| Deinit 🔥: AppleViewModel, id: 173, num: 0 ||| Deinit 🔥: PearViewModel, id: 801, num: 0 ||| Deinit 🔥: PearViewModel, id: 436, num: 3 ||| Router: rm navPath: 1 ||| NavStack: Destination .apple ||| Init ☀️: AppleViewModel, id: 401, num: 0 ||| Deinit 🔥: AppleViewModel, id: 744, num: 0 ||| Deinit 🔥: BananaViewModel, id: 26, num: 0 ||| Deinit 🔥: BananaViewModel, id: 167, num: 2 ||| Router: rm navPath: 0 ||| Deinit 🔥: AppleViewModel, id: 401, num: 0 ||| Deinit 🔥: AppleViewModel, id: 879, num: 1 What is making NavigationStack / .navigationDestination(for: ) run through all the previous items in the stack, every time the state changes in the NavigationPath? I hope it's not too confusing with all the prints :-) Please let me know if I need to add more info.
1
0
86
5d
How to properly add data files into a SwiftData ModelDocument file package
Hi all, I am working on a macOS/iOS sandboxed app with SwiftUI/SwiftData. The app saves its' data into a ModelDocument file. But I want to also save large binary data files into this file. I create the DocumentGroup scene with: DocumentGroup(editing: Entry.self, contentType: .myDocument) { MainWindowView() } In my MainWindowView, I use @Environment(\.documentConfiguration) private var documentConfiguration to get the URL to the user created ModelDocument file URL. When I need to add large binary file into the ModelDocument file, I call a method in my model: func saveReferencedData(_ data: Data, documentURL: URL?) throws { let logger = Logger(subsystem: "saveReferencedData", category: "Asset") if let documentURL { let referencedFileName = "\(entryIdentifier)_\(assetIdentifier).\(assetType)" let tempFileURL = documentURL.appending(components: referencedFileName) if documentURL.startAccessingSecurityScopedResource() { do { try data.write(to: tempFileURL, options: []) } catch { documentURL.stopAccessingSecurityScopedResource() throw AssetFileOperationError.unableToSaveReferenceFile } self.referencedFileLocation = referencedFileName logger.debug("Successfully saved image data to: \(referenceFileURL)") } documentURL.stopAccessingSecurityScopedResource() } else { logger.debug("ERROR! Unable to save referenced image file because document URL is nil.") } } When this method is called, the data file is saved, but immediately I gets this diablog box: If I click on any of the options in the dialog box, the binary data file is removed. I think this is a permission problem and I am not writing to the ModelDocument file correctly. But I can not find any information online to experiment more. Does anyone have experience with a customized ModelDocument file with more data files written into it? Or if you have any insight or advice, it would be greatly appreciated. Thank you so much for reading.
0
0
72
6d
UIAccessibility.Notification concurrency errors with Xcode 16 beta 2
I am running into some Swift 6 concurrency errors that I think are due to an odd oversight in the UIAccessibility Swift interface. There are a number of constants defined in here for various things, most of which are marked "let" (appropriately). However, the constants for notifications in extension UIAccessibility.Notification are all marked as var for some reason. For example: public static var pageScrolled: UIAccessibility.Notification Because it is var, not let, anytime I try to access it, I get a concurrency violation. I am baffled as to how I am supposed to work around this. For example, this line of code: UIAccessibility.post(notification: .pageScrolled, argument: "test") gives the error: "Reference to static property 'pageScrolled' is not concurrency-safe because it involves shared mutable state" I can't for the life of me figure out how to work around this. I guess maybe define my own constant somewhere and suss out the rawValue somehow for now? This really needs to be fixed in the SDK.
4
0
129
6d
I tried to add a overlay window onto app in full screen mode but failed
As the topic mentioned, I want to add a overlay window onto Apps that are in full screen mode, trying to create some blur effect on the screen. But Apple seems to treat full screen mode Apps differently as a "space." So currently I can only apply the blur effect like this. (This is my Desktop page) But When it doesn't affect the full screen mode Apps. (For example: My Xcode) And I know some of the App down this kind of stuff. Like this This is my current code. Hope someone can tell me how to solve it.
1
0
141
6d
SwiftUI List OutlineGroup
Hello, I'm having some difficulties trying to customise a SwiftUI list-detail splitview using List and OutlineGroup: The model used is provided in Apple documentation OutlineGroup. The contentView is struct ContentView: View { @State var itemString = String() var body: some View { HSplitView { MyOutLine(title: "MyOutLine", itemString: $itemString) .frame(width: 200, height: 300 , alignment: Alignment(horizontal: .leading, vertical: .top)) .padding() MyView(itemString: itemString) } } } The left view is struct MyOutLine: View { let title:String @Binding var itemString:String @State private var selection: FileItem? var body: some View { List(selection: $selection) { OutlineGroup(data, children: \.children) { item in Text ("\(item.description)") .onTapGesture { selection = item itemString = item.description } .listRowBackground( selection == item ? Color.gray :nil ) } } .listStyle(.sidebar) .onAppear { itemString = "No selection"} } } The right view is: struct MyView: View { let itemString:String var body: some View { VStack{ Spacer() HStack { Spacer() Text(itemString) Spacer() } Spacer() } } } The result works but I have 2 problems: The selection works but the detail view is updated only when I click the text but not when I click the rest of the row. This results in the detail view not being sync with the list selection. I would like to customise the colour of the selected row but listRowBackground does not seem to work. Is there a way to fix this Thank you in advance Jean Marie
2
0
129
6d
CompositorLayer, Metal and Alert
Hello. I am creating an app for APV in Metal. I have a CompositorLayer that launches a thread. What can I do to detect the environment alert to stop the thread until it is accepted by the user? If I don't stop the thread, I have problems with the hand tracking alert. Thank you.
1
0
104
6d
Screen Sleep Issue When Removing Vision Pro
Hello VisionOS Developer Community, I am currently working on a demo application for VisionOS, tailored for the Vision Pro. In my application, I have implemented a feature to prevent the screen from sleeping using the following code: UIApplication.shared.isIdleTimerDisabled = true This works perfectly on iOS, ensuring the screen remains active regardless of other system settings. However, I've run into a snag with VisionOS. Even with isIdleTimerDisabled set to true, the screen still sleeps when I take off the Vision Pro.
1
0
86
6d