Discuss the latest Apple technologies announced at WWDC22.

Posts under WWDC22 tag

45 Posts
Sort by:
Post not yet marked as solved
2 Replies
236 Views
How can I add a native UX for pull-to-refresh for a ScrollView? Is support for this being added in iOS 16? Right now, the native UX only appears for List. For example, I want to support to be able to support .refreshable on a ScrollView like this: var body: some View {     ScrollView {       LazyVStack {         Text("1")         Text("2")         Text("3")       }     }     .refreshable {       ///     }   }
Posted Last updated
.
Post marked as solved
3 Replies
464 Views
Hey guys I'm trying to follow along with the WWDC session titled "What's new with SwiftUI". They say it's possible to have the detail view of a NavigationSplitView be determined based on a state variable by using the following code: However, and I'm kinda going crazy here, this code does NOT work on iOS whatsoever, the view will remain the one determined by "default" Switch case. It works fine on macOS, but iOS (and iPadOS) simply will not change the detail view no matter what. I have tried working around it for hours but it seems to boil down to the view never being redrawn... has anyone tried this? Is this just a iOS bug??
Posted Last updated
.
Post not yet marked as solved
3 Replies
1.3k Views
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,
Posted
by zygoat.
Last updated
.
Post not yet marked as solved
6 Replies
696 Views
In SwiftUI 3 we used the following code snippet to set the background color of a list. struct ContentView: View {     var body: some View {         List {             Text("Hello World!")         }         .onAppear { // Placed here for sample purposes, normally set globally             UITableView.appearance().backgroundColor = .clear         }         .listStyle(.insetGrouped)         .background(Color.red)     } } This is not working anymore in SwiftUI 4 (FB10225556) as the List is not based on UITableView anymore. Any workaround ideas?
Posted
by saibot.
Last updated
.
Post not yet marked as solved
3 Replies
301 Views
Hi there, I'm struggling with the new NavigationSplitView. struct Team: Identifiable, Hashable {     let id = UUID()     var name: String     var players: [String] } struct SplitView3: View {     @State private var teams = [ Team(name: "Packers", players: ["Rodgers", "Alexander", "Dillon"]), Team(name: "Vikings", players: ["Ingram", "Cousins", "Berry"])     ]     @State private var selectedTeam: Team?     @State private var selectedPlayer: String?         var body: some View {             NavigationSplitView {                 List(teams, selection: $selectedTeam) { team in                     Text(team.name).tag(team).navigationTitle("Team")                 }.navigationBarHidden(true)                 .navigationSplitViewColumnWidth(250)             } content: {                 List(selectedTeam?.players ?? [], id: \.self, selection: $selectedPlayer) { player in                     Text(player).navigationTitle("Team Member")                 }             } detail: {                 Form{                     Text(selectedPlayer ?? "Choose a player.")                 }                 .navigationTitle("Player Detail").navigationBarTitleDisplayMode(.inline)             }             .navigationSplitViewStyle(.automatic)         } } When I run this in Simulator or Canvas I can navigate from Team (sidebar), trough Teammembers (content) to detail view and back to sidebar. But after I reach the sidebar again the links forward to content view don't work anymore. Did I miss something?
Posted Last updated
.
Post not yet marked as solved
4 Replies
457 Views
The new Virtualization framework (and sample code!) are great. It's a lot of fun to run the sample code and quickly fire up multiple VMs of macOS running as a guest. However, the inability to authenticate with any iCloud services is a significant roadblock. Xcode, for example, is not allowing me to authenticate my developer account. Are there any plans to resolve this issue so that iCloud accounts can be authenticated from within a VM?
Posted
by kennyc.
Last updated
.
Post not yet marked as solved
1 Replies
117 Views
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?
Posted
by trlewi.
Last updated
.
Post not yet marked as solved
0 Replies
112 Views
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?
Posted Last updated
.
Post not yet marked as solved
0 Replies
111 Views
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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
162 Views
Will there be a user interface to configure lock screen widgets like home screen widgets? This seems to be implied as possible based on the stock apps, such as the Clock app lock screen widget saying "Add a clock for a city to check the time at that location." I could not figure out how to bring up the configuration GUI: long press various places has no effect.
Posted
by t9mike.
Last updated
.
Post not yet marked as solved
3 Replies
232 Views
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.
Posted Last updated
.
Post not yet marked as solved
2 Replies
280 Views
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?
Posted
by benoit.
Last updated
.
Post not yet marked as solved
3 Replies
509 Views
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?
Posted
by JAWZ.
Last updated
.
Post not yet marked as solved
4 Replies
406 Views
Hi, trying to implement a simple PushToTalk app but I cannot seem to begin transmitting. When I start a transmission programmatically in my app in the foreground: self.channelManager.requestBeginTransmitting(channelUUID: channelUUID) This throws an error: Error Domain=com.apple.pushtotalk.channel Code=1 "(null)" Which seems to map to the appNotForeground error? https://developer.apple.com/documentation/pushtotalk/ptchannelerror/code When I try transmitting from the background, nothing happens at all. Any thoughts?
Posted Last updated
.
Post not yet marked as solved
1 Replies
360 Views
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.
Posted
by Deny.
Last updated
.
Post not yet marked as solved
0 Replies
205 Views
I'm testing my App in the Xcode 14 beta (released with WWDC22) on iOS 16, and it seems that AVSpeechSynthesisVoice is not working correctly. The following code always returns an empty array: AVSpeechSynthesisVoice.speechVoices() Additionally, attempting to initialize AVSpeechSynthesisVoice returns nil for all of the following: AVSpeechSynthesisVoice(language: AVSpeechSynthesisVoice.currentLanguageCode()) AVSpeechSynthesisVoice(language: "en") AVSpeechSynthesisVoice(language: "en-US") AVSpeechSynthesisVoice(identifier: AVSpeechSynthesisVoiceIdentifierAlex) AVSpeechSynthesisVoice.speechVoices().first
Posted
by zabelc.
Last updated
.