Created
September 3, 2020 18:16
-
-
Save carlynorama/1ed79208a899b6e98e386eb293b040d8 to your computer and use it in GitHub Desktop.
All that is needed to turn the script into an iOS app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Foundation | |
var dayString:String { | |
let dateFormatter = DateFormatter() | |
dateFormatter.setLocalizedDateFormatFromTemplate("EEEE") | |
return (dateFormatter.string(from: Date())) // "Tue, Mar 20, 2018" for en-US locale | |
} | |
struct ContentView: View { | |
var body: some View { | |
Text(dayString).font(.title) | |
} | |
} | |
struct ContentView_Previews: PreviewProvider { | |
static var previews: some View { | |
ContentView() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment