Created
April 16, 2023 06:46
-
-
Save amosgyamfi/cf9fa33b4a5588788a2403429f3fa9d1 to your computer and use it in GitHub Desktop.
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
// | |
// 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