Post

Replies

Boosts

Views

Activity

ScrollView and prefersDefaultFocus currently incompatible?
Hello, I just wanted to confirm that ScrollView and prefersDefaultFocus are currently not compatible, at least when building for tvOS A simple example:     HStack {       ScrollViewReader { proxy in         ScrollView(.horizontal, showsIndicators: true) {           VStack {             Button(action: {               resetFocus(in: namespace)             }) {               Text("RESET FOCUS")             }             HStack {               ForEach([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], id:  \.self) { v in                 Button(action: {}) {                   Text("ABC \(v)")                 }.prefersDefaultFocus(v == 11, in: namespace)               }             }           }.onAppear {             resetFocus(in: namespace)           }                     }       }       .focusScope(namespace)     }   } On load of the view the focus remains on the first button in the HStack. On pressing the RESET FOCUS button focus is applied to the first button visible on the left side of the screen. Am I missing something here? Is this the way these pieces of SwiftUI currently interact? e.g. prefersDefaultFocus has no effect inside a ScrollView? Is there a way to focus a specific item in a ScrollView programmatically? Thanks.
3
0
1.8k
May ’22
Inconsistent SHA256 hashes for NSExtensionItem attachments in iOS 15
I've built an app and app extension that accepts images from the Photos app and uploads them to our servers. In iOS 14 and before, when using attachment.loadFileRepresentation to retrieve the images selected by the user, we would always get a consistent sha256 hash for a given selected image, even across instance of selecting that image in the photos app and attempting to reupload it. In builds of our app made using the XCode 13 release candidate against the iOS 15 release candidate however the sha256 hash is inconsistent across selection attempts. Has something knowingly changed about the way NSExtensionItem.attachments are implemented in iOS 15 that would cause this? The file size of the files appear to be consistent across selection attempts so I am curious if there is an iOS 15 bug at play here or a known change. Is there some other way that I can track that I have seen files in previous selection attempts other than file hashes? Thanks.
0
0
455
Sep ’21