Skip to content

Instantly share code, notes, and snippets.

@carlynorama
Created September 3, 2020 18:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlynorama/1ed79208a899b6e98e386eb293b040d8 to your computer and use it in GitHub Desktop.
Save carlynorama/1ed79208a899b6e98e386eb293b040d8 to your computer and use it in GitHub Desktop.
All that is needed to turn the script into an iOS app
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