When using CloudKit in an app, if there are data changes on other devices being synchronized, and you also want to make changes to the data on the current device and reflect it back to the CloudKit server, you might want to display a native loading icon, like the one you see in the Notes app, during this process. How can you implement this? If anyone knows how to do it using SwiftUI, please let me know.
Post
Replies
Boosts
Views
Activity
You can now hide the sidebar button, but how to prevent the sidebar from closing (like the settings app, or the Music app...)
import Foundation
import SwiftUI
struct ContentView:: View {
@State private var columnVisibility = NavigationSplitViewVisibility.detailOnly
var body: some View {
NavigationSplitView(columnVisibility: $columnVisibility) {
List {
Text("dd")
}
.toolbar(removing: .sidebarToggle)
} detail: {
VStack{
Button("Expand"){
columnVisibility = .all
}
}
.toolbar{
ToolbarItem{
Button(action:{
}){
Image(systemName: "square.and.arrow.up")
}
}
}
}
}
}
.constant(.all) was also not possible
import Foundation
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationSplitView(columnVisibility: .constant(.all)) {
List {
Text("dd")
}
.toolbar(removing: .sidebarToggle)
} detail: {
VStack{
Text("dd")
}
.toolbar{
ToolbarItem{
Button(action:{
}){
Image(systemName: "square.and.arrow.up")
}
}
}
}
}
}
How do I get the file size of a file stored in iCloud Documents?