Is this a bug or the expected behaviour?
var progress = itemProvider.loadFileRepresentation(
forTypeIdentifier: id,
completionHandler: { [self] (u, error) in
//...
})
var timer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [self] timer in
print("\(progress?.completedUnitCount)/\(progress?.totalUnitCount)")
}
this always prints 100/100
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
It’s hard to describe what’s happening, see this screen record:
https://youtube.com/shorts/QC9OogV7cB8?feature=share
Snippets:
UIViewControllerRepresentable:
func makeUIViewController(context: Context) -> UIDocumentPickerViewController {
let supportedTypes: [UTType] = [UTType.item]
return UIDocumentPickerViewController(forOpeningContentTypes: supportedTypes, asCopy: true)
}
View:
.sheet(isPresented: $viewModel.isShowingDetailView) {
switch viewModel.selectedSubview?.subviewType{
DocumentBrowserView()
}
}
Workaround:
I had this:
UITabBar.appearance().isTranslucent = false
Removing this fixes it.