swift ui 2

[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] ์ฝ˜ํ…์ธ  ๊ฒ€์ƒ‰ ์•ฑ ๊ตฌํ˜„ - 2. ์ฑ„ํŒ…๋ฐฉ UI ๊ตฌํ˜„

์ „ํŽธ์— ์ด์–ด์„œ ์ฑ„ํŒ…๋ฐฉ UI๋ฅผ ๊ตฌํ˜„ํ•ด๋ณด๊ฒ ๋‹ค. ์ฑ„ํŒ…๋ฐฉ์€ ํด๋Ÿฝํ•˜์šฐ์Šค ์•ฑ์˜ UI๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ๋งŒ๋“ค์—ˆ๋‹ค. ๊ฒฐ๊ณผ๋ฌผ ํ™”๋ฉด ๊ฒฐ๊ณผ๋ฌผ ์˜ˆ์‹œ ์ฑ„ํŒ…๋ฐฉ ์ƒ์„ธ ํ™”๋ฉด ๊ตฌํ˜„ ์ฑ„ํŒ…๋ฐฉ์—๋Š” ๊ฐ ์œ ์ €๋ณ„ ํ”„๋กœํ•„ ์‚ฌ์ง„์ด ๋“ค์–ด๊ฐ€์•ผ ํ•œ๋‹ค. ๊ทธ๋ ‡๊ธฐ ๋•Œ๋ฌธ์— ํ”„๋กœํ•„ ํ™”๋ฉด๋„ ๊ตฌํ˜„ํ•ด๋ณด์ž ํ”„๋กœํ•„ ํ™”๋ฉด ๊ตฌํ˜„ ํ”„๋กœํ•„ ํ™”๋ฉด์˜ ํ”„๋กœํ•„ ์‚ฌ์ง„์€ ์ถ”ํ›„ Amazon S3 ๋ฅผ ํ™œ์šฉํ•ด ๊ด€๋ฆฌํ•  ์˜ˆ์ •์ด๋‹ค. (REST API๋กœ ๊ด€๋ จ URL ์„ ๋ฐ›์„ ์˜ˆ์ •). ๊ทธ๋ž˜์„œ ์ด๋ฏธ์ง€ URL ๋กœ ํ”„๋กœํ•„ ์‚ฌ์ง„์„ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋Š” UI ๊ฐ€ ๋ณ„๋„๋กœ ํ•„์š”ํ•˜๋‹ค. Swift ์—์„œ๋Š” AsyncImage๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ด๋ฏธ์ง€์˜ url๋กœ(html ์—์„œ image ํƒœ๊ทธ๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๊ณผ ์œ ์‚ฌ) ์‚ฌ์ง„์„ ๋ณด์—ฌ์ค„ ์ˆ˜ ์žˆ๋‹ค. ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ๊ตฌํ˜„ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. import SwiftUI struct ProfileItem: Vi..

IOS(Swift) 2022.03.05