SWIFTUIビューア
🚦 Slider


struct ContentView: View {
//슬라이더를 통해 회전값을 저장할 state 프로퍼티 선언
@State private var rotation: Double = 0
var body: some View {
VStack {
Text("슬라이더 뷰를 사용하여 텍스트 회전하기")
.font(.headline)
.fontWeight(.heavy)
.rotationEffect(.degrees(self.rotation))
.animation(.easeInOut(duration:5))
//in : 범위 , step : 얼만큼 증가하는지
Slider(value: $rotation,in:0...360,step:0.1)
}
}
}
🚀 Picker

//picker를 통해서 색상 목록을 만들고 선택시 텍스트 색상 변경하기
struct ContentView: View {
//슬라이더를 통해 회전값을 저장할 state 프로퍼티 선언
@State private var rotation: Double = 0
@State private var text: String = ""
var body: some View {
VStack {
Text(self.text)
.font(.headline)
.fontWeight(.heavy)
.rotationEffect(.degrees(self.rotation))
.animation(.easeInOut(duration:5))
//in : 범위 , step : 얼만큼 증가하는지
Slider(value: $rotation,in:0...360,step:0.1)
TextField("Enter text here",text:$text)
.textFieldStyle(RoundedBorderTextFieldStyle())
}
}
}

Reference
この問題について(SWIFTUIビューア), 我々は、より多くの情報をここで見つけました https://velog.io/@honeyoung_0117/SwiftUI-뷰어テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol