SwiftUI 4

[IOS/Swift] MBTI ์นด๋“œ ์„ ํƒ ๊ฒŒ์ž„ UI ๊ตฌํ˜„

swift ui๋ฅผ ์ด์šฉํ•ด ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„ค๊ณ„๋ฅผ ์ง„ํ–‰ ํ•ด๋ด…์‹œ๋‹ค. ๊ธฐํš๋œ ๊ตฌ์„ฑ์€ ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๋ฌธ์„œ๋Ÿ‰ ๋˜๋Š” ์–ธ๊ธ‰๋Ÿ‰์„ ๋น„๊ตํ•  ๋‘ ๊ฐœ์˜ ํ•ญ๋ชฉ์„ ๊ฐ๊ฐ ์นด๋“œ๋กœ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค. ํ•ญ์ƒ ์•„๋ž˜์— ์žˆ๋Š” ์นด๋“œ(ํŒŒ๋ž‘)๊ฐ€ ์œ„์— ์žˆ๋Š” ์นด๋“œ(๋นจ๊ฐ•) ๋ณด๋‹ค ์–ธ๊ธ‰๋Ÿ‰์ด ๋” ๋งŽ์€์ง€ ๋‚ฎ์€์ง€๋ฅผ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค. ์ •๋‹ต์„ ๋งž์ถ”๋ฉด ๋‹ค์Œ ์นด๋“œ๋กœ ์ด๋™, ์ž˜๋ชป ์„ ํƒํ•˜๋ฉด ๊ฒŒ์ž„์ด ๋๋‚ฉ๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ ๊ตฌ์„ฑ ๊ฒŒ์ž„์„ ๊ตฌ์„ฑํ•˜๋Š” ๋ฐ์ดํ„ฐ(API ์ „๋‹ฌ ๊ฒฐ๊ณผ)๋ฅผ ์„ค๊ณ„ํ•ด๋ด…์‹œ๋‹ค. struct StageList: Codable { var data: Array var answer: Array } API์—์„œ ์‘๋‹ต๋ฐ›์€ ๊ฒฐ๊ณผ๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” Struct๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์‹ค์ œ ๋ฐ์ดํ„ฐ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค. { "data": ["์งœ์žฅ๋ฉด", "์งฌ๋ฝ•", "ํƒ•์ˆ˜์œก", "์œ ๋ฆฐ๊ธฐ", "๊ฟ”๋ฐ”๋กœ์šฐ"], "answe..

IOS(Swift) 2022.05.22

[IOS/Swift] ์ฝ˜ํ…์ธ  ๊ฒ€์ƒ‰ ์•ฑ ๊ตฌํ˜„ - 4. ๋กœ๊ทธ์ธ UI ๊ตฌํ˜„

Swift UI - 4. ๋กœ๊ทธ์ธ UI ํ™”๋ฉด ๊ตฌํ˜„ ์ด์ „์— ๊ตฌํ˜„ํ•œ ํšŒ์›๊ฐ€์ž…์œผ๋กœ ํšŒ์›์ด ๋“ฑ๋ก๋˜์—ˆ๋‹ค(DRF๋กœ ํšŒ์›๊ฐ€์ž… API๋ฅผ ๊ตฌํ˜„) ์ด์ œ ๋“ฑ๋ก๋œ ํšŒ์›์œผ๋กœ ๋กœ๊ทธ์ธ์„ ์ง„ํ–‰ํ•˜๊ณ  ํ‚ค์ฒด์ธ์„ ์ด์šฉํ•ด์„œ Access Token ๋ฐ Refresh Token์„ ์ €์žฅํ•˜์—ฌ ์•ฑ ์‚ฌ์šฉ ์ค‘ ๋กœ๊ทธ์ธ ์ƒํƒœ๋ฅผ ์œ ์ง€ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ด๋ณด์ž. // // LoginView.swift // mbtiPlayground // // Created by ๋ฐ•์ข…ํ›„ on 2022/03/16. // import SwiftUI struct LoginView: View { @State private var email: String = "" @State private var password: String = "" @State private var loginStatus: ..

IOS(Swift) 2022.04.04

[IOS/Swift] ์ฝ˜ํ…์ธ  ๊ฒ€์ƒ‰ ์•ฑ ๊ตฌํ˜„ - 3. ํšŒ์›๊ฐ€์ž… UI ๊ตฌํ˜„

Swift UI ๋ฅผ ์‚ฌ์šฉํ•œ ํšŒ์›๊ฐ€์ž… ๋ฐ ๋กœ๊ทธ์ธ ํ™”๋ฉด ๊ตฌํ˜„ - ๋ฐฑ์—”๋“œ๋Š” Django RestFramework ์‚ฌ์šฉ ๊ตฌํ˜„ ์˜ˆ์‹œ - ํšŒ์›๊ฐ€์ž… ํšŒ์› ๊ฐ€์ž…์€ 4๊ฐœ ํ•ญ๋ชฉ (๋‹‰๋„ค์ž„, ์ด๋ฉ”์ผ, ๋น„๋ฐ€๋ฒˆํ˜ธ(+๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ), MBTI ํ•ญ๋ชฉ)์„ ์ž…๋ ฅ๋ฐ›๋Š” ํ™”๋ฉด์„ ๋งŒ๋“ ๋‹ค. ์—ฌ๊ธฐ์„œ MBTI ํ•ญ๋ชฉ์€ HTML์—์„œ ๋งํ•˜๋Š” ์…€๋ ‰ํŠธ ๋ฐ•์Šค UI๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ MBTI๋ฅผ ์„ ํƒํ•˜๋„๋ก ํ•˜์˜€๋‹ค. // // SignUpView.swift // mbtiPlayground // // Created by ๋ฐ•์ข…ํ›„ on 2022/03/16. // import SwiftUI struct SignUpView: View { @Environment(\\.presentationMode) var presentationMode: Binding @State private v..

IOS(Swift) 2022.04.04

[IOS/Swift] ์ฝ˜ํ…์ธ  ๊ฒ€์ƒ‰ ์•ฑ ๊ตฌํ˜„ - 1. ์ฝ˜ํ…์ธ  UI ๊ตฌํ˜„

ํ˜„์žฌ ์‚ฌ๋‚ด์—์„œ ํ‚ค์›Œ๋“œ๋ฅผ ๊ฒ€์ƒ‰ํ•˜์—ฌ ๊ด€๋ จ ์ฝ˜ํ…์ธ ๋ฅผ ๋ณด์—ฌ์ฃผ๋Š” ์•ฑ์„ ๊ตฌํ˜„ํ•˜๊ณ  ์žˆ๋‹ค. ๊ธฐ์ˆ  ๊ธฐํš - ์•ฑ์— ๋“ค์–ด๊ฐˆ ๊ธฐ์ˆ  ๋ชฉ๋ก ๊ฒ€์ƒ‰ ๋ฐ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํ™•์ธ ๊ฒ€์ƒ‰ ํ‚ค์›Œ๋“œ ๊ด€๋ จ ์ฝ˜ํ…์ธ (ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ  ๋˜๋Š” ์ฑ„ํŒ…๋ฐฉ) ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ  ์Œ์„ฑ ์ฑ„ํŒ…๋ฐฉ ๋กœ๊ทธ์ธ ์ฒซ๋ฒˆ์งธ๋กœ ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ ์™€ ๊ด€๋ จ UI๋ฅผ ๊ตฌํ˜„ํ•ด๋ณด์ž. ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ  UI ๊ตฌํ˜„ ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ  ์ƒ์„ธํ™”๋ฉด ๊ตฌํ˜„ ํ…์ŠคํŠธ ์ฝ˜ํ…์ธ  ์ƒ์„ธํ™”๋ฉด์— ๋“ค์–ด๊ฐˆ ์š”์†Œ๋Š” ์ œ๋ชฉ, ์ถœ์ฒ˜, ์ž‘์„ฑ์ผ, MBTI ํƒ€์ž…, ๊ทธ๋ฆฌ๊ณ  ์ฝ˜ํ…์ธ  ๋‚ด์šฉ์ด๋‹ค. ์ด๋ฅผ ์Šค์œ„ํ”„ํŠธ UI๋กœ ๊ตฌํ˜„ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. import SwiftUI struct ContentDetail: View { var contItem: ContentDetailData var body: some View { VStack(alignment: .leading){ Gro..

IOS(Swift) 2022.03.05