This page contains sample showing how to use the new NavigationLink without a SwiftUI List. While updating Farness for iOS 16, I found very few examples of using the new Navigation API without a List. In addition, List offers a selection binding that makes it pretty easy to set the selected object for the navigation. […]
Category Archives: Mobile Apps
Supporting External Displays
The WWDC 2018 video Adding Delight to your iOS App shows how to support external displays. Test to see if there is more than one screen available. UIScreen.screens.count > 1 Observe screen connect or disconnect notifications. let notificationCenter = NotificationCenter.default notificationCenter.addObserver(self, selector: #selector(connectScreenHandler), name: UIScreen.didConnectNotification, object: nil) notificationCenter.addObserver(self, selector: #selector(disconnectScreenHandler), name: UIScreen.didDisconnectNotification, object: nil) Add […]
Layout Driven Design
The following code is based on the WWDC 2018 video Adding Delight to Your iOS App and the recipe for layout driven UI. Find and track the state that affects the UI. Create a variable named feelingCool. Dirty layout when the state changes with setNeedsLayout(). Update feelingCool and add the didSet property observer. Update UI […]