일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
- font book
- Protocol
- 단일 책임원칙
- Startign Assignments
- CoreLocation
- MKMapItem
- WeatherManager
- 영문 개인정보처리방침
- App Store Connect
- Xcode
- 서체관리자
- AnyObject
- UICollectionViewFlowLayout
- addannotation
- swift
- Required Reason API
- SwiftUI Boolean 값
- weatherKit
- MKMapViewDelegate
- 한국어 개인정보처리방침
- weak var
- 러닝타이머
- Timer
- dispatchsource
- CLLocationManagerDelegate
- UIAlertAction
- 러닝기록앱
- RunningTimer
- xcode로 날씨앱 만들기
- 클로저의 캡슐화
- Today
- Total
VesselWheel
NavigationView 본문
// ContentView.swift
// ex11
//
// Created by tjoeun on 2023/04/15.
//
import SwiftUI
struct ContentView: View {
@State private var nameIdx = 0
var names = ["paul", "peter", "david", "james", "john"]
var body: some View {
VStack{
NavigationView{
Form{
Section{
Picker(selection: self.$nameIdx, label:
Text("Names")){
// ForEach(0 ..< names.count)
ForEach(0 ..< 5){ index in
Text(self.names[index]).tag(index)
}
}.pickerStyle(SegmentedPickerStyle())
}
}.navigationBarTitle(Text("Names"))
}
Text("Picker Selection: \(nameIdx)")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
'Xcode Study' 카테고리의 다른 글
NavigationView with section in Form{} (0) | 2023.10.18 |
---|---|
count : index with VStack (0) | 2023.10.18 |
단추 늘이기, 줄이기 (0) | 2023.10.18 |
func Count and Age present (0) | 2023.10.18 |
e-mail / pw 입력창 (1) | 2023.10.18 |