Post

Replies

Boosts

Views

Activity

Swift UI Label appearance
I am testing new Swift UI features and encountered strange issue with the appearance of "Label" Element. struct ContentView: View {     let items = ["item 1", "item 2", "item 3" , "item 4"]     var body: some View {         List { 	              Label(items[0], systemImage:"a.book.closed")                 Label(items[1], systemImage:"pencil")                 Label(items[2], systemImage:"flowchart")                 Label(items[3], systemImage:"hand.wave")         }     } } The system images are moved upwards and not aligned horizontally with text items. Its different from the appearance from WWDC presentation. Where is the problem?
1
0
815
Jun ’20
How to use the new ColorPicker in SwiftUI?
I want to test the new ColorPicker in swift UI. struct ContentView: View {     @State private var newColor = Color.white     var body: some View {             ColorPicker("choose something", selection: $newColor)     } } First I can see the color ring. When I am trying to choose something, the new modal view with quite complicated picker is appearing, I have many ways to choose something and this is ok. The problem is, I get stuck with the modal view and cannot make it disappear and continue with the chosen color. How to make it?
1
0
918
Jun ’20
Swift UI sidebar in iPadOS 14
Hi, I am trying to test the new iPadOS 14 feature: sidebar. However I cannot find any good implementation example code. I want to make the navigation in sidebar, which will for example control the ShowDetail View, and from the ShowDetail View I can dig deeper in EditDetail View. When I try this code: struct iPadSidebarView: View {     var body: some View {         NavigationView {             Sidebar()             ShowDetail(whichRow: "some starting text")             EditDetail()         }     } } struct Sidebar: View {     var body: some View {         NavigationView {             List(1..<10) { i in                 NavigationLink (                     destination: ShowDetail(whichRow: "Row \(i)"),                     label: {    &#9;                   Text("Row \(i)")                     })             }             .listStyle(SidebarListStyle())         }     } } struct ShowDetail: View {     var whichRow: String     var body: some View {         Text (whichRow)     } } struct EditDetail: View {   var body: some View {         Text ("only for start")     } } the sidebar is living its own life, showing me ShowDetail View in itself, but ShowDetail View remains unchanged all the time with starting text. Is there a code example of smoothly working sidebar navigation for iPadOS 14 somewhere?
0
0
961
Jun ’20
Saving voice memos to core data.
Hi, I am planning to save audio files (voice memos from audio recorder) in core data using external storage functionality. I cannot save the files elsewhere and hold the file name only in core data, because I want to use CloudKit to synchronise the data between devices. I am looking for some example code, how to store speech memo in core data and how to fetch it to the app. I know, I need to use "binary data" as data type and use external storage functionality. But how do I save the voice memo to the core data?
1
0
1.4k
Jul ’20