Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created April 16, 2023 06:46
Show Gist options
  • Save amosgyamfi/cf9fa33b4a5588788a2403429f3fa9d1 to your computer and use it in GitHub Desktop.
Save amosgyamfi/cf9fa33b4a5588788a2403429f3fa9d1 to your computer and use it in GitHub Desktop.
//
// ConstantVariableNames.swift
// EnterSwift
//
// Defining constant and variable names to include characters
//
import SwiftUI
struct ConstantVariableNames: View {
// Constant and variable names can contain almost any character, including Unicode characters
let π = 3.14159
let 你好 = "你好世界"
let 🐶🐮 = "dogcow"
let 💞 = "Revolving Hearts"
var body: some View {
VStack {
Text("\(π)")
Text(你好)
Text(🐶🐮)
Text(💞)
}
.font(.largeTitle)
}
}
struct ConstantVariableNames_Previews: PreviewProvider {
static var previews: some View {
ConstantVariableNames()
.preferredColorScheme(.dark)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment