Skip to content

Instantly share code, notes, and snippets.

@takoikatakotako
Created October 24, 2024 01:41
Show Gist options
  • Select an option

  • Save takoikatakotako/d1f7a2f02c2387a08431b61d333ceee6 to your computer and use it in GitHub Desktop.

Select an option

Save takoikatakotako/d1f7a2f02c2387a08431b61d333ceee6 to your computer and use it in GitHub Desktop.
ext中の文字の太さや色を変える
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("I")
.font(.system(size: 20).bold())
+ Text(" ❤️ ")
.foregroundStyle(Color.red)
+ Text("Snorlax")
.foregroundStyle(Color.black)
.font(.system(size: 20).bold())
+ Text("!\n")
+ Text("Snorlax ")
.foregroundStyle(Color.red)
.font(.system(size: 20).bold())
+ Text("is most ")
.foregroundStyle(Color.blue)
.font(.system(size: 20).bold())
+ Text("cute & cool& powerful .")
.foregroundStyle(Color.green)
.font(.system(size: 20).bold())
+ Text("Pokemon.")
.foregroundStyle(Color.yellow)
.font(.system(size: 20).bold())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment