Discuss the latest Apple technologies announced at WWDC22.

Posts under WWDC22 tag

117 Posts

Post

Replies

Boosts

Views

Activity

Share your use cases to allow ActivityKit to start an activity when the app is in the background
I would like to socialize the idea of starting a Live Activity while the app is in the background. According to the ActivityKit, documentation, Live Activities can only be started while your app is foreground. I wrote up a really lengthy feedback about this enhanced ActivityKit permission concept but will summarize to share with others here. FB11308611 The idea is this, like CoreLocation, the ActivityKit framework could have the permission model of 'when in use' and 'always'. Apps that the user has granted the 'always' permission for would then be allowed to start an activity from some sort of background execution. I'm looking at the Background Modes defined in Xcode namely: Location Updates, Bluetooth, Remote Notifications, Nearby Interactions, etc. My specific use case is to combine my usage of Core Location Region Monitoring and Visit Monitoring into triggering a Live Activity to the users Lock Screen when they are at a place contextually relevant to my app(s). I can imagine this applies to many other applications too. While the current experience I have will present the user with a local notification gets the job done, the user experience could be so much more engaging. When I saw the Live Activities feature get announced during WWDC22, this was the first thing that came to mind. FB11308699 Some very high level concepts: Live Activity when entering a sport stadium Live Activity when entering a concert venue Live Activity when entering a gym Live Activity when entering a restaurant Live Activity when entering a store Got another use case? Share it! Like a use case in this thread? Comment on it!
0
1
1.6k
Aug ’22
ImageAnalysisInteraction doesn't call contentsRect delegate's method
Hello, I am struggling with an issue that contentsRect(for:) method of ImageAnalysisInteractionDelegate is not being called at any moment. I've set up the demo project where the interaction is added to root view of view controller while I'm analyzing the image of UIImageView that is added to this view. I want to achieve the behavior where I could define contents rect for highlights of found text on that image. P.S. I know that I could simply add an interaction to an image view but that's not the case - the real work that I want to achieve in the real project is to display live text on paused video player, so that image view here is for simplicity only. import UIKit import VisionKit class ViewController: UIViewController {       private let imageView = UIImageView()       private let imageAnalyzer = ImageAnalyzer()   private let interaction = ImageAnalysisInteraction()   override func viewDidLoad() {     super.viewDidLoad()           view.addSubview(imageView)     imageView.translatesAutoresizingMaskIntoConstraints = false           NSLayoutConstraint.activate([       imageView.leadingAnchor.constraint(equalTo: view.leadingAnchor),       imageView.trailingAnchor.constraint(equalTo: view.trailingAnchor),       imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor),       imageView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.7)     ])           interaction.delegate = self       // Some image with text that I have in assets     imageView.image = UIImage(named: "IMG_5564")     imageView.contentMode = .scaleAspectFit           view.addInteraction(interaction)           interaction.setContentsRectNeedsUpdate()           DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {       self.analyze()     }   }       private func analyze() {     Task {       let imageAnalysis = try? await imageAnalyzer.analyze(         self.imageView.image!,         configuration: .init([.machineReadableCode, .text])       )               self.interaction.analysis = imageAnalysis       self.interaction.preferredInteractionTypes = .automatic       self.interaction.setContentsRectNeedsUpdate()     }   } } extension ViewController: ImageAnalysisInteractionDelegate {   func presentingViewController(for interaction: ImageAnalysisInteraction) -> UIViewController? {     return nil   }       func contentsRect(for interaction: ImageAnalysisInteraction) -> CGRect {     // >>> This method is never being called <<<     return CGRect(x: 0, y: 0, width: 1.0, height: 0.7)   }       func contentView(for interaction: ImageAnalysisInteraction) -> UIView? {     return nil   }       func interaction(_ interaction: ImageAnalysisInteraction, highlightSelectedItemsDidChange highlightSelectedItems: Bool) {     debugPrint("highlight: \(highlightSelectedItems)")   } }
1
0
1.2k
Aug ’22
MusicKit background threads warning
Hello, I am working a music app with the new MusicKit API and I am not sure how to fix my current warning. I have the following methods to get recently played songs and another used to insert a new song into the queue after the current song. Both methods work but I am receiving the purple warning: “Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.”     func getRecentlyPlayed(){         let request = MusicRecentlyPlayedRequest()         Task{             let response = try await request.response()             let musicPlayer = ApplicationMusicPlayer.shared             musicPlayer.queue = ApplicationMusicPlayer.Queue(for: response.items)             try await musicPlayer.prepareToPlay()         }     }     func insertNextInQueue(items: MusicItemCollection) {         Task{             let musicPlayer = ApplicationMusicPlayer.shared             try await musicPlayer.queue.insert(items, position: .afterCurrentEntry)         }     } I have tried everything to force the insert to happen on the main thread but am not able to get the warning to go away. Despite the warning, the insert method works and doesn’t seem to impact my application at all. I am not sure what else to do at this point. Any help or suggestions would be much appreciated. Thanks, Dan
2
0
973
Aug ’22
iPadOS 16 beta fails to install on A12Z iPad Pro by any means
Attempts to install the iPadOS 16 beta all fail on my “iPad Pro (11-Inch)” (FTXN2C/A), with about 20 GB free storage. Methods I've tried: Over the air, after installing the profile from Apple Developer web site. Result: the 5.6 GB image downloads; "verifying update"; device reboots; progress bar briefly shows a sliver of progress for half a minute or so; device reboots again; presents the regular 15.5 lock screen, and behaves as though I'd never dowloaded the update at all. Connected by USB, via Finder, option-clicking "Check for Updates" and choosing the .ipsw image. Result: “A software update is required to update your iPad”, followed by “Can’t install the software because it is not currently available from the Software Update server”. Connected by USB, via Apple Configurator. Result: ““The operation couldn’t be completed. (AMRestoreErrorDomain error 10 - Failed to handle message type StatusMsg (Protocol error)) [AMRestoreErrorDomain – 0xA (10)]”; iPad is bricked; forced to reinstall a fresh 15.5 image and restore from backup. For what it's worth, for the past few years no beta version of iPadOS has installed properly over the air (although the RC versions do, and tethered .ipsw-based installations have also worked). Anybody clue me in here? thanks,
4
1
4.7k
Aug ’22
Custom Instruments: visualizing tree data structure
I was wondering if Instruments provides a way to visualize tree-like data structures (eg: a view hierarchy) when building a custom plugin. The last time I checked none of the built-in detail view types (lists, aggregations, call trees, narrative and Time Slice styles) seemed to be a good fit for this. Looking at this year's "Visualize and optimize Swift concurrency" session there's a mention to a new set of instruments that use a detail UI ("Task force") close to what would be ideal for my use case, but I'm not sure if this is available to 3rd party developers nor where to find the documentation about it. Thanks!
2
0
896
Jul ’22
WWDC Digital lounges summary Q&A
Hi, for personal needs I prepared WWDC Digital lounges summary Q&A (Camera and Photos and SiriKit for now, but going to rework other channels/topics too). I could share these summaries with community if it's not against WWDC Digital lounges rules. A summary prepared in form of questions/answers (conversation) - personal info removed (both: who asked and who answered), internal numeration added. I could provide an example of summary for review by the forum moderators.
1
0
1.2k
Jul ’22
NavigationSplitView with Custom Views as Labels
I am working on seeing if I can use the new MultiColumn navigation pattern and so far it seems like it really is only useful if you have very simple text based navigation. I have tried a couple different combinations but doesn't seem to be able to support this as it would mean having conflicting navigation links. If I am missing something to be able to accomplish this that would be helpful. @State var selectedNavigationCategory: NavigationCategory? let navigationCategories: [NavigationCategory] = [ NavigationCategory(id: UUID(), name: "One", sfSymbol: "circle", detailView: ViewOne()), NavigationCategory(id: UUID(), name: "Two", sfSymbol: "circle.fill", detailView: ViewTwo()) ] var body: some View { NavigationSplitView { List(navigationCategories, selection: $selectedNavigationCategory) { category in NavigationLink(value: category, label: { Label(category.name, systemImage: category.sfSymbol) }) } } detail: { //How to control the view that gets presented } Like I mentioned tried a couple things with no success, even returning a view as part of the Navigation Category (which you'll see I left in). Is this really not possible?
1
0
1.4k
Jun ’22
Animating a Core Image Filter in SwiftUI
I want to apply a given CIFilter but instead of the effect showing up instantly, I want to animate it: e.g., a color image desaturating to grey scale over 2 seconds, a blocky image depixellating to a full-resolution image using an EaseInOut animation curve over 0.8 seconds. If you're using one of the built in SwiftUI view modifiers like .blur(), you're golden. Just append some .animate() and you're done. But given that you have to jump through hoops whether you go the UIImage, CGImage, CIImage route, or the MTLView, CIRenderDestination, ContentView example from the WWDC 2022 sample code, I'm a bit confused. Ideally I guess I'd just like to write View Modifiers for each effect I want to do, so that they're as usable as the SwiftUI built-in ones, but I don't know if that's possible. Does anyone have any ideas?
0
0
1k
Jun ’22
ImageRenderer and User-Modified UI State
I have an app in the App Store called MaskerAid (App Store). The general gist of the app is that it lets you hide things in images using emoji. The emoji are SwiftUI Views that can be manipulated by the user. They can be resized, relocated, etc. When the user is ready to share their image, a screenshot is taken using an absolutely revolting pile of hacks I wrote to get UIKit to take a snapshot of the screen. I was super amped to see the new ImageRenderer API (docs), which would let me throw away my pile-o'-hacks and do things a more sane way. However, the ImageRenderer seems to be written around a static set of views that are non-interactive. Am I holding it wrong, or is this a missing part of the API surface for ImageRenderer? Is there any way to get it to display a View (and its sub-Views) as they exist on-screen? For what it's worth, this has been filed as FB10393458.
0
0
658
Jun ’22
Canceling an Edit: When to alert?
During one of the WWDC talks this year I remember hearing that when a user clicks cancel on an edit form you should show an alert warning them about discarding the changes before leaving. YET if there aren't any changes we should just exit when canceled. Looking back at that I wonder how do you know if there are no changes? Right now I load the Core Data Entity fields on my page and set them one by one on save. Is there a better way that would also make it easier to know when to leave and when to warn when canceling? Are there any examples of this? Thanks everyone.
6
0
1.9k
Jun ’22
How to set the holding priority with NavigationSplitView
My question concerns a macOS SwiftUI app. I would like to have a split view with 2 horizontal panes without sidebar: content on the left and inspector on the right. The inspector should act like the inspector panel on the right side side of the Xcode's window: when the window is resized, the inspector keeps it's current width and the user can resize the inspector using the split divider. Using macOS Monterey SDK, I tried to achieve this with HSplitView but the problem is that the left/right panels are both resized when the window is resized. struct ContentView: View { var body: some View { HSplitView { Rectangle().fill(.red) Rectangle().fill(.yellow) } } } Using Ventura SDK, I just tried the new view NavigationSplitView. I'm using .constant(.doubleColumn) to hide the sidebar but the problem is the same as HSplitView, the left/right panel are both resized when the window is resized. struct ContentView: View { var body: some View { NavigationSplitView(columnVisibility: .constant(.doubleColumn)) { Text("not used") } content: { Rectangle().fill(.red) } detail: { Rectangle().fill(.yellow) } } } When using NSSplitViewController with AppKit, the holdingPriority (https://developer.apple.com/documentation/appkit/nssplitviewitem/1388887-holdingpriority?language=objc) allows to manage this case: The view with the lowest priority is the first to gain additional width if the split view grows or shrinks. Is it possible to achieve this with SwiftUI?
2
1
1.8k
Jun ’22
Changing the Timeframe of Charts
I'm playing around with the new Swift Charts, so far everything is rather straight forward, however I'm looking for a way to change the time frame/scope of the chart. For example, recreating the Heart Rate chart in the Health App or in other words, only showing a subsection of the data, and being able to move the x-axis for left/right for more data. I know it's early, but anyone have any ideas how that might be done?
1
0
1.8k
Jun ’22
Passkeys Adoption
Excellent work on Passkeys. For context, I’m soon to release a Password Manager app that is built specifically for Apple devices only (iOS, iPadOS, macOS). A user’s vault items are encrypted on their own device and synced end-to-end encrypted via their own private iCloud database. As you’d expect, the app requires the user to enter their master password to unlock their vaults, and allows them to optionally enable Touch or Face ID for a passwordless unlock experience. In this scenario where there is no third-party server involved, and auth takes place on-device only, is there any meaningful way an app like this can or should take advantage of Passkeys? The only thing I can think of so far would be to allow the user to use a Passkey instead of a master password to unlock their vault. But aside from the convenience factor for the user in terms of UX, I’m not entirely sure I understand if there would be any major security advantage in doing so, over the app’s existing auth/unlock flow?
1
1
1.7k
Jun ’22
EXC_BAD_ACCESS when creating a live activity on a device
Creating a live activity works fine on a simulator but on a device running iOS 16 beta (20A5356a) - Xcode 14 (beta 6) crashes with an EXC_BAD_ACCESS error. Is this a bug in the latest iOS 16 beta? Is there a temporary workaround for this?
Replies
1
Boosts
1
Views
1.1k
Activity
Aug ’22
Xcode 14 beta 5 simulator with broken Lock Screen Customization
Problem In iOS 16 simulators in Xcode 14 beta 5 (14A5294e) the customization on the lock screen is not working, making it impossible to develop and test the new features of iOS 16 (Widget and Live activities). How to reproduce? On the simulator hold the tap on the lock screen Tap on Customize Nothing happens
Replies
4
Boosts
3
Views
2.8k
Activity
Aug ’22
Share your use cases to allow ActivityKit to start an activity when the app is in the background
I would like to socialize the idea of starting a Live Activity while the app is in the background. According to the ActivityKit, documentation, Live Activities can only be started while your app is foreground. I wrote up a really lengthy feedback about this enhanced ActivityKit permission concept but will summarize to share with others here. FB11308611 The idea is this, like CoreLocation, the ActivityKit framework could have the permission model of 'when in use' and 'always'. Apps that the user has granted the 'always' permission for would then be allowed to start an activity from some sort of background execution. I'm looking at the Background Modes defined in Xcode namely: Location Updates, Bluetooth, Remote Notifications, Nearby Interactions, etc. My specific use case is to combine my usage of Core Location Region Monitoring and Visit Monitoring into triggering a Live Activity to the users Lock Screen when they are at a place contextually relevant to my app(s). I can imagine this applies to many other applications too. While the current experience I have will present the user with a local notification gets the job done, the user experience could be so much more engaging. When I saw the Live Activities feature get announced during WWDC22, this was the first thing that came to mind. FB11308699 Some very high level concepts: Live Activity when entering a sport stadium Live Activity when entering a concert venue Live Activity when entering a gym Live Activity when entering a restaurant Live Activity when entering a store Got another use case? Share it! Like a use case in this thread? Comment on it!
Replies
0
Boosts
1
Views
1.6k
Activity
Aug ’22
ImageAnalysisInteraction doesn't call contentsRect delegate's method
Hello, I am struggling with an issue that contentsRect(for:) method of ImageAnalysisInteractionDelegate is not being called at any moment. I've set up the demo project where the interaction is added to root view of view controller while I'm analyzing the image of UIImageView that is added to this view. I want to achieve the behavior where I could define contents rect for highlights of found text on that image. P.S. I know that I could simply add an interaction to an image view but that's not the case - the real work that I want to achieve in the real project is to display live text on paused video player, so that image view here is for simplicity only. import UIKit import VisionKit class ViewController: UIViewController {       private let imageView = UIImageView()       private let imageAnalyzer = ImageAnalyzer()   private let interaction = ImageAnalysisInteraction()   override func viewDidLoad() {     super.viewDidLoad()           view.addSubview(imageView)     imageView.translatesAutoresizingMaskIntoConstraints = false           NSLayoutConstraint.activate([       imageView.leadingAnchor.constraint(equalTo: view.leadingAnchor),       imageView.trailingAnchor.constraint(equalTo: view.trailingAnchor),       imageView.centerYAnchor.constraint(equalTo: view.centerYAnchor),       imageView.heightAnchor.constraint(equalTo: view.heightAnchor, multiplier: 0.7)     ])           interaction.delegate = self       // Some image with text that I have in assets     imageView.image = UIImage(named: "IMG_5564")     imageView.contentMode = .scaleAspectFit           view.addInteraction(interaction)           interaction.setContentsRectNeedsUpdate()           DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) {       self.analyze()     }   }       private func analyze() {     Task {       let imageAnalysis = try? await imageAnalyzer.analyze(         self.imageView.image!,         configuration: .init([.machineReadableCode, .text])       )               self.interaction.analysis = imageAnalysis       self.interaction.preferredInteractionTypes = .automatic       self.interaction.setContentsRectNeedsUpdate()     }   } } extension ViewController: ImageAnalysisInteractionDelegate {   func presentingViewController(for interaction: ImageAnalysisInteraction) -> UIViewController? {     return nil   }       func contentsRect(for interaction: ImageAnalysisInteraction) -> CGRect {     // >>> This method is never being called <<<     return CGRect(x: 0, y: 0, width: 1.0, height: 0.7)   }       func contentView(for interaction: ImageAnalysisInteraction) -> UIView? {     return nil   }       func interaction(_ interaction: ImageAnalysisInteraction, highlightSelectedItemsDidChange highlightSelectedItems: Bool) {     debugPrint("highlight: \(highlightSelectedItems)")   } }
Replies
1
Boosts
0
Views
1.2k
Activity
Aug ’22
MusicKit background threads warning
Hello, I am working a music app with the new MusicKit API and I am not sure how to fix my current warning. I have the following methods to get recently played songs and another used to insert a new song into the queue after the current song. Both methods work but I am receiving the purple warning: “Publishing changes from background threads is not allowed; make sure to publish values from the main thread (via operators like receive(on:)) on model updates.”     func getRecentlyPlayed(){         let request = MusicRecentlyPlayedRequest()         Task{             let response = try await request.response()             let musicPlayer = ApplicationMusicPlayer.shared             musicPlayer.queue = ApplicationMusicPlayer.Queue(for: response.items)             try await musicPlayer.prepareToPlay()         }     }     func insertNextInQueue(items: MusicItemCollection) {         Task{             let musicPlayer = ApplicationMusicPlayer.shared             try await musicPlayer.queue.insert(items, position: .afterCurrentEntry)         }     } I have tried everything to force the insert to happen on the main thread but am not able to get the warning to go away. Despite the warning, the insert method works and doesn’t seem to impact my application at all. I am not sure what else to do at this point. Any help or suggestions would be much appreciated. Thanks, Dan
Replies
2
Boosts
0
Views
973
Activity
Aug ’22
iPadOS 16 beta fails to install on A12Z iPad Pro by any means
Attempts to install the iPadOS 16 beta all fail on my “iPad Pro (11-Inch)” (FTXN2C/A), with about 20 GB free storage. Methods I've tried: Over the air, after installing the profile from Apple Developer web site. Result: the 5.6 GB image downloads; "verifying update"; device reboots; progress bar briefly shows a sliver of progress for half a minute or so; device reboots again; presents the regular 15.5 lock screen, and behaves as though I'd never dowloaded the update at all. Connected by USB, via Finder, option-clicking "Check for Updates" and choosing the .ipsw image. Result: “A software update is required to update your iPad”, followed by “Can’t install the software because it is not currently available from the Software Update server”. Connected by USB, via Apple Configurator. Result: ““The operation couldn’t be completed. (AMRestoreErrorDomain error 10 - Failed to handle message type StatusMsg (Protocol error)) [AMRestoreErrorDomain – 0xA (10)]”; iPad is bricked; forced to reinstall a fresh 15.5 image and restore from backup. For what it's worth, for the past few years no beta version of iPadOS has installed properly over the air (although the RC versions do, and tethered .ipsw-based installations have also worked). Anybody clue me in here? thanks,
Replies
4
Boosts
1
Views
4.7k
Activity
Aug ’22
Custom Instruments: visualizing tree data structure
I was wondering if Instruments provides a way to visualize tree-like data structures (eg: a view hierarchy) when building a custom plugin. The last time I checked none of the built-in detail view types (lists, aggregations, call trees, narrative and Time Slice styles) seemed to be a good fit for this. Looking at this year's "Visualize and optimize Swift concurrency" session there's a mention to a new set of instruments that use a detail UI ("Task force") close to what would be ideal for my use case, but I'm not sure if this is available to 3rd party developers nor where to find the documentation about it. Thanks!
Replies
2
Boosts
0
Views
896
Activity
Jul ’22
WWDC Digital lounges summary Q&A
Hi, for personal needs I prepared WWDC Digital lounges summary Q&A (Camera and Photos and SiriKit for now, but going to rework other channels/topics too). I could share these summaries with community if it's not against WWDC Digital lounges rules. A summary prepared in form of questions/answers (conversation) - personal info removed (both: who asked and who answered), internal numeration added. I could provide an example of summary for review by the forum moderators.
Replies
1
Boosts
0
Views
1.2k
Activity
Jul ’22
MusicLibraryRequest Loved songs, playlists, albums and artists
Is there a way to use the MusicLibraryRequest to get the users loved songs, playlists, albums and artists? I don't see a way in documentation but maybe I am missing it. Thanks, Dan
Replies
0
Boosts
1
Views
662
Activity
Jul ’22
NavigationSplitView with Custom Views as Labels
I am working on seeing if I can use the new MultiColumn navigation pattern and so far it seems like it really is only useful if you have very simple text based navigation. I have tried a couple different combinations but doesn't seem to be able to support this as it would mean having conflicting navigation links. If I am missing something to be able to accomplish this that would be helpful. @State var selectedNavigationCategory: NavigationCategory? let navigationCategories: [NavigationCategory] = [ NavigationCategory(id: UUID(), name: "One", sfSymbol: "circle", detailView: ViewOne()), NavigationCategory(id: UUID(), name: "Two", sfSymbol: "circle.fill", detailView: ViewTwo()) ] var body: some View { NavigationSplitView { List(navigationCategories, selection: $selectedNavigationCategory) { category in NavigationLink(value: category, label: { Label(category.name, systemImage: category.sfSymbol) }) } } detail: { //How to control the view that gets presented } Like I mentioned tried a couple things with no success, even returning a view as part of the Navigation Category (which you'll see I left in). Is this really not possible?
Replies
1
Boosts
0
Views
1.4k
Activity
Jun ’22
Create a swiftUI List to display weather Alert
Hello, I would like to create a List in goal to display weather Alert (Title, severity, description). Can you please show me a sample ? thanks
Replies
3
Boosts
0
Views
829
Activity
Jun ’22
Animating a Core Image Filter in SwiftUI
I want to apply a given CIFilter but instead of the effect showing up instantly, I want to animate it: e.g., a color image desaturating to grey scale over 2 seconds, a blocky image depixellating to a full-resolution image using an EaseInOut animation curve over 0.8 seconds. If you're using one of the built in SwiftUI view modifiers like .blur(), you're golden. Just append some .animate() and you're done. But given that you have to jump through hoops whether you go the UIImage, CGImage, CIImage route, or the MTLView, CIRenderDestination, ContentView example from the WWDC 2022 sample code, I'm a bit confused. Ideally I guess I'd just like to write View Modifiers for each effect I want to do, so that they're as usable as the SwiftUI built-in ones, but I don't know if that's possible. Does anyone have any ideas?
Replies
0
Boosts
0
Views
1k
Activity
Jun ’22
ImageRenderer and User-Modified UI State
I have an app in the App Store called MaskerAid (App Store). The general gist of the app is that it lets you hide things in images using emoji. The emoji are SwiftUI Views that can be manipulated by the user. They can be resized, relocated, etc. When the user is ready to share their image, a screenshot is taken using an absolutely revolting pile of hacks I wrote to get UIKit to take a snapshot of the screen. I was super amped to see the new ImageRenderer API (docs), which would let me throw away my pile-o'-hacks and do things a more sane way. However, the ImageRenderer seems to be written around a static set of views that are non-interactive. Am I holding it wrong, or is this a missing part of the API surface for ImageRenderer? Is there any way to get it to display a View (and its sub-Views) as they exist on-screen? For what it's worth, this has been filed as FB10393458.
Replies
0
Boosts
0
Views
658
Activity
Jun ’22
Canceling an Edit: When to alert?
During one of the WWDC talks this year I remember hearing that when a user clicks cancel on an edit form you should show an alert warning them about discarding the changes before leaving. YET if there aren't any changes we should just exit when canceled. Looking back at that I wonder how do you know if there are no changes? Right now I load the Core Data Entity fields on my page and set them one by one on save. Is there a better way that would also make it easier to know when to leave and when to warn when canceling? Are there any examples of this? Thanks everyone.
Replies
6
Boosts
0
Views
1.9k
Activity
Jun ’22
How to set the holding priority with NavigationSplitView
My question concerns a macOS SwiftUI app. I would like to have a split view with 2 horizontal panes without sidebar: content on the left and inspector on the right. The inspector should act like the inspector panel on the right side side of the Xcode's window: when the window is resized, the inspector keeps it's current width and the user can resize the inspector using the split divider. Using macOS Monterey SDK, I tried to achieve this with HSplitView but the problem is that the left/right panels are both resized when the window is resized. struct ContentView: View { var body: some View { HSplitView { Rectangle().fill(.red) Rectangle().fill(.yellow) } } } Using Ventura SDK, I just tried the new view NavigationSplitView. I'm using .constant(.doubleColumn) to hide the sidebar but the problem is the same as HSplitView, the left/right panel are both resized when the window is resized. struct ContentView: View { var body: some View { NavigationSplitView(columnVisibility: .constant(.doubleColumn)) { Text("not used") } content: { Rectangle().fill(.red) } detail: { Rectangle().fill(.yellow) } } } When using NSSplitViewController with AppKit, the holdingPriority (https://developer.apple.com/documentation/appkit/nssplitviewitem/1388887-holdingpriority?language=objc) allows to manage this case: The view with the lowest priority is the first to gain additional width if the split view grows or shrinks. Is it possible to achieve this with SwiftUI?
Replies
2
Boosts
1
Views
1.8k
Activity
Jun ’22
Missing RoomCaptureView & RoomCaptureViewDelegate
I've been trying to build the downloaded the RoomPlanExampleApp using Xcode 14 beta, but it looks like two key classes (RoomCaptureView and RoomCaptureViewDelegate) are missing from the RoomPlan header at the moment! Anyone managed to build this yet?
Replies
3
Boosts
0
Views
1.6k
Activity
Jun ’22
Downgrade watchOS 9 beta
Is it possible to downgrade the watchOS 9 beta? I found that an Apple Store visit can archive it but that's not possible for everyone.
Replies
2
Boosts
0
Views
1.5k
Activity
Jun ’22
Changing the Timeframe of Charts
I'm playing around with the new Swift Charts, so far everything is rather straight forward, however I'm looking for a way to change the time frame/scope of the chart. For example, recreating the Heart Rate chart in the Health App or in other words, only showing a subsection of the data, and being able to move the x-axis for left/right for more data. I know it's early, but anyone have any ideas how that might be done?
Replies
1
Boosts
0
Views
1.8k
Activity
Jun ’22
Passkeys Adoption
Excellent work on Passkeys. For context, I’m soon to release a Password Manager app that is built specifically for Apple devices only (iOS, iPadOS, macOS). A user’s vault items are encrypted on their own device and synced end-to-end encrypted via their own private iCloud database. As you’d expect, the app requires the user to enter their master password to unlock their vaults, and allows them to optionally enable Touch or Face ID for a passwordless unlock experience. In this scenario where there is no third-party server involved, and auth takes place on-device only, is there any meaningful way an app like this can or should take advantage of Passkeys? The only thing I can think of so far would be to allow the user to use a Passkey instead of a master password to unlock their vault. But aside from the convenience factor for the user in terms of UX, I’m not entirely sure I understand if there would be any major security advantage in doing so, over the app’s existing auth/unlock flow?
Replies
1
Boosts
1
Views
1.7k
Activity
Jun ’22
Xcode 14 Recent Build Timeline
I have compiled my iOS app for both the simulator and device. When clicking on 'Recent Build Timeline' in Xcode 14 Beta 1 nothing happens with no error. Do I need to enable or set up something else to get it to work?
Replies
1
Boosts
1
Views
2.7k
Activity
Jun ’22