Post

Replies

Boosts

Views

Activity

Reply to First time in xcode.
I recommend that you go through this tutorial, 100 Days of SwiftUI. He shows you exactly what to do in Xcode, which should help you get started. https://www.hackingwithswift.com/100/swiftui
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’22
Reply to DatePicker
Here is a simple view with 2 DatePickers: import SwiftUI extension Date {     var justDate: String {         let dateFormatter = DateFormatter()         dateFormatter.dateStyle = .long         dateFormatter.timeStyle = .none         return dateFormatter.string(from: self)     } } struct ContentView: View {     @State private var start = Date()     @State private var end = Date()     var body: some View {         List {             Section(header: Text("Select Dates")) {                 DatePicker("Start date", selection: $start, displayedComponents: [.date])                 DatePicker("End date", selection: $end, displayedComponents: [.date])             }             Section(header: Text("Date Values")) {                 Text("Start: \(start.justDate)")                 Text("End: \(end.justDate)")             }         }     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’22