ios

    [iOS] ์Šคํ† ๋ฆฌ๋ณด๋“œ ์—†๋Š” ํ™˜๊ฒฝ ๊ตฌ์ถ•ํ•˜๊ธฐ | No-storyboard

    ํ•ญ์ƒ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•ด์™”๋Š”๋ฐ ์ด๋ฒˆ ํ”„๋กœ์ ํŠธ์—์„œ๋Š” ์Šคํ† ๋ฆฌ๋ณด๋“œ ์—†์ด ์ง„ํ–‰ํ•˜๊ณ ์ž ํ•œ๋‹ค. ์–ด์ฐจํ”ผ UIKit๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ๋•Œ๋ฌธ์— ๋‹ค ๋˜‘๊ฐ™์ง€๋งŒ, ๊ธฐ๋ณธ์ ์œผ๋กœ storyboard ์…‹ํŒ…์ด ๋˜์–ด์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์—ฐ๊ฒฐ๋งŒ ๋Š์–ด์ฃผ๋ฉด ๋œ๋‹ค. (Step 1) ์Šคํ† ๋ฆฌ๋ณด๋“œ ํ”„๋กœ์ ํŠธ์™€ ๋˜‘๊ฐ™์€ ์„ค์ •์œผ๋กœ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•ด์ค€๋‹ค. (Step 2) ์™ผ์ชฝ์˜ Navigator์—์„œ Main.storyboard๋ฅผ ์‚ญ์ œํ•ด์ค€๋‹ค. (Step 3) Project > Targets > General > Deployment Info ์—์„œ Main Interface์— ์„ค์ •๋˜์–ด์žˆ๋Š” Main.Storyboard๋ฅผ ์‚ญ์ œํ•ด์ค€๋‹ค. (Step 4) Project > Targets > Info ์—์„œ Storboard Name์„ ์‚ญ์ œํ•ด์ค€๋‹ค. (Step 5) Scen..

    [iOS] App States & View Life Cycle | ์•ฑ์˜ ์ƒํƒœ์™€ ๋ทฐ์˜ ์ƒ๋ช…์ฃผ๊ธฐ

    ์ƒ๋ช…์ฃผ๊ธฐ(Lifecycle)์ด๋ž€ ๋ฌด์—‡์ธ๊ฐ€? ⇒ ์–ธ์ œ ํŠน์ • ๋กœ์ง์„ ํ•˜๊ณ  ์‹ถ๋‹ค๋ฅผ ์–ด๋””์„œ ์ž‘์„ฑํ•˜๋ฉด ๋œ๋‹ค๋ผ๋Š” ๋ฌธ์ œ๋กœ ๋ณ€๊ฒฝํ•ด์ฃผ๋Š” ๊ฐœ๋… App States Not running: ์•ฑ์ด ์‹คํ–‰๋˜์ง€ ์•Š๊ฑฐ๋‚˜ ์ข…๋ฃŒ๋œ ์ƒํƒœ Foreground: ํ™”๋ฉด์ด ๋‚˜ํƒ€๋‚œ ์ƒํƒœ inActive: ์ƒํ˜ธ์ž‘์šฉ์ด ๋ถˆ๊ฐ€๋Šฅํ•œ ์ƒํƒœ, ํ™”๋ฉด์€ ๋ณด์ž„ ex) ์ „ํ™”๊ฐ€ ์™”์„ ๋•Œ, ์‹œ์Šคํ…œ ๋ฉ”์‹œ์ง€๊ฐ€ ๋–ด์„ ๋•Œ ('๋ฐฐํ„ฐ๋ฆฌ๊ฐ€ ๋ถ€์กฑํ•ฉ๋‹ˆ๋‹ค') Active: ์ƒํ˜ธ์ž‘์šฉ์ด ๊ฐ€๋Šฅํ•œ ์ƒํƒœ, ์•ฑ์ด ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š” ์ƒํƒœ Background: ํ™”๋ฉด์ด ์‚ฌ๋ผ์ง„ ์ƒํƒœ ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์ƒํƒœ์—์„œ ์‹ค์งˆ์ ์ธ ๋™์ž‘์„ ํ•˜๊ณ  ์žˆ๋Š” ์ƒํƒœ ex) ํŒŒ์ผ ๋‹ค์šด๋กœ๋“œ, ์œ ํŠœ๋ธŒ ์Œ์•… ์‹คํ–‰ Suspended: ๋ญ”๊ฐ€ ์žก์•„๋‘” ์ƒํƒœ ๋น ๋ฅธ ์žฌ์‹คํ–‰์„ ์œ„ํ•ด ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ์ตœ์†Œํ•œ์œผ๋กœ๋งŒ ์žก๊ณ (ํ• ๋‹นํ•˜๊ณ ) ์žˆ์Œ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ๋ถ€์กฑํ•˜๋ฉด ์‹œ์Šคํ…œ์ด Suspe..

    [iOS][error] Editor placeholder in source file

    Command + Shift + B ๋กœ ํ•ด๊ฒฐ ๊ฐ€๋Šฅ

    [iOS] Xcode Workspace | ๊ฐ Area์˜ ๋ช…์นญ, ์—ญํ• 

    Tool Bar Navigator Area Project navigator: ํŒŒ์ผ์„ ์ถ”๊ฐ€, ์‚ญ์ œ ๋ฐ ๊ทธ๋ฃนํ™”ํ•˜๊ณ  ํŽธ์ง‘๊ธฐ์—์„œ ํŒŒ์ผ์„ ์—ฐ๋‹ค. Source Control navigator: ์†Œ์Šค ์ œ์–ด ์ž‘์—… ๋ณต์‚ฌ๋ณธ, ์ปค๋ฐ‹, ํƒœ๊ทธ ๋ฐ ์›๊ฒฉ ์ €์žฅ์†Œ๋ฅผ ๋ณผ ์ˆ˜ ์žˆ์Œ. (Git ๊ด€๋ จ navigator) Symbol navigator: ํ”„๋กœ์ ํŠธ๋ฅผ ํด๋ž˜์Šค์™€ ๋ฉ”์„œ๋“œ ๊ธฐ์ค€์œผ๋กœ ์ •๋ฆฌํ•ด์„œ ๋ณด์—ฌ์ค€๋‹ค. Find navigator: ํ”„๋กœ์ ํŠธ์™€ ํ”„๋ ˆ์ž„์›Œํฌ ์•ˆ์—์„œ ํ…์ŠคํŠธ๋ฅผ ์ฐพ๋Š”๋‹ค. Issue navigator: ํ”„๋กœ์ ํŠธ์˜ ์—๋Ÿฌ๋‚˜ ๊ฒฝ๊ณ  ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด์—ฌ์ค€๋‹ค. Test navigator: Unit test๋ฅผ ์ƒ์„ฑ, ๊ด€๋ฆฌ ๋ฐ ์‹คํ–‰ํ•˜๊ณ  ์ƒํƒœ๋ฅผ ๊ฒ€ํ† ํ•œ๋‹ค. Debug navigator: ๋””๋ฒ„๊ทธ ๊ด€๋ จ ๋ฉ”์‹œ์ง€๋ฅผ ๋ณด์—ฌ์ค€๋‹ค. Breakpoint navigator..

    [iOS] App Project ์†์„ฑ | Xcode Project / Project / Target

    [PROJECT] : ๋ชจ๋“  ํŒŒ์ผ, ๋ฆฌ์†Œ์Šค, ์†Œํ”„ํŠธ์›จ์–ด ๋นŒ๋“œ์— ํ•„์š”ํ•œ ๋ชจ๋“  ์ •๋ณด์˜ ์ €์žฅ์†Œ ํ”„๋กœ์ ํŠธ์—๋Š” ์•ฑ์„ ๊ตฌ์ถ•ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ๋ชจ๋“  ์š”์†Œ๊ฐ€ ํฌํ•จ๋˜์–ด ์žˆ์œผ๋ฉฐ, ํ•ด๋‹น ์š”์†Œ ๊ฐ„์˜ ๊ด€๊ณ„(relationships)๋ฅผ ์œ ์ง€ํ•œ๋‹ค. ํ”„๋กœ์ ํŠธ๋Š” product๋ฅผ buildํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ช…์‹œํ•˜๋Š” target์„ ํ•˜๋‚˜ ์ด์ƒ ํฌํ•จํ•˜๋ฉฐ ๋ชจ๋“  target์— ๋Œ€ํ•œ ๊ธฐ๋ณธ build setting์„ ์ •์˜ํ•œ๋‹ค. Info Deployment Target: ์ง€์›ํ•˜๋Š” ์ตœ์†Œ OS ๋ฒ„์ „ Configurations: Debug / Release build setting (๋ณดํ†ต ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ - Debug, Archiveํ•  ๋•Œ - Release)⇒ ๋ณด๋‹ค ๋” ๋‹ค์–‘ํ•œ ํ™˜๊ฒฝ์—์„œ ํ…Œ์ŠคํŠธ๋ฅผ ํ•˜๊ธฐ ์œ„ํ•ด configuration์„ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ์Œ ex. ๊ฐœ๋ฐœ ๋ฒ„..

    [iOS] info.plist | Xcode 12

    Info.plist = Information Property List Files Info.plist๋Š” Xcode ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๋ฉด ์ž๋™์œผ๋กœ ์ƒ์„ฑ๋˜๋ฉฐ ์‹คํ–‰ ํŒจํ‚ค์ง€์— ๊ด€ํ•œ ํ•„์ˆ˜ ์„ค์ • ์ •๋ณด๊ฐ€ ํฌํ•จ๋œ XML์„ ์‚ฌ์šฉํ•˜์—ฌ ๊ตฌ์กฐํ™”๋œ ํ…์ŠคํŠธ ํŒŒ์ผ์ด๋‹ค. iOS ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ๊ธฐ๋ณธ์ •๋ณด๋ฅผ ๋‹ด์•„ ๋†“์„ ์ˆ˜ ์žˆ๋Š” ์„ค์ •ํŒŒ์ผ์ด๋ผ๊ณ  ํ•  ์ˆ˜ ์žˆ๋‹ค. XML์€ Key, Value๋กœ ๊ตฌ์„ฑ๋œ Dictionary ํ˜•ํƒœ์ด๋‹ค. ์‹œ์Šคํ…œ์€ ์ด ํ‚ค์™€ ๊ฐ’์„ ์ด์šฉํ•˜์—ฌ ์•ฑ๊ณผ ์•ฑ์˜ ์„ค์ •์„ ๊ฐ€์ ธ์˜จ๋‹ค. ๐Ÿ’ก ํŠน์ • ํ‚ค or ๊ฐ’์„ ํŽธ์ง‘ํ•˜๋ ค๋ฉด ๊ฐ’์„ ๋”๋ธ”ํด๋ฆญํ•˜์—ฌ ์„ ํƒํ•œ ๋‹ค์Œ ์ƒˆ ๊ฐ’์„ ์ž…๋ ฅํ•œ๋‹ค. ๐Ÿ’ก ์ƒˆ๋กœ์šด ํ‚ค๋ฅผ ์ถ”๊ฐ€ํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด (+) ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๊ฑฐ๋‚˜ ์ž„์˜์˜ ํ‚ค๋ฅผ ํด๋ฆญํ•˜๊ณ  ์—”ํ„ฐ๋ฅผ ์น˜๋ฉด ํ•ด๋‹น ํ‚ค ์•„๋ž˜์— ์ƒˆ๋กœ์šด ํ‚ค๊ฐ€ ๋‚˜ํƒ€๋‚œ๋‹ค. [ Information Property List ..

    [iOS] Completion Handler์„ ์ด์šฉํ•œ Loading Progress ๊ตฌํ˜„

    GitHub - krimpedance/KRProgressHUD: A beautiful and easy-to-use progress HUD for your iOS. A beautiful and easy-to-use progress HUD for your iOS. - GitHub - krimpedance/KRProgressHUD: A beautiful and easy-to-use progress HUD for your iOS. github.com KRProgressHUD๋ฅผ ์ด์šฉํ•˜์—ฌ Loading Progress๋ฅผ ๊ตฌํ˜„ํ•ด๋ณด์ž. ์ด์ œ pod init - pod '์‚ฌ์šฉํ• ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ' - pod install์˜ ๋ฃจํ‹ด์— ์™„๋ฒฝ ์ ์‘ ^-^v Completion handler๋Š” ์–ด๋– ํ•œ ์ผ์ด ๋๋‚ฌ์„ ๋•Œ ์ง„ํ–‰ํ•  ์—…๋ฌด๋ฅผ ๋‹ด๋‹นํ•˜..

    [iOS] WebKit View | ์•ฑ์—์„œ Web ํŽ˜์ด์ง€ ์—ด๊ธฐ

    ์—ด๊ณ  ์‹ถ์€ ์›นํŽ˜์ด์ง€์˜ URL๋งŒ ์•Œ๊ณ  ์žˆ๋‹ค๋ฉด ์•ฑ์—์„œ ๋ฐ”๋กœ ํ•ด๋‹น ์›นํŽ˜์ด์ง€๋ฅผ ์—ด ์ˆ˜ ์žˆ๋‹ค! ๋จผ์ €, storyboard์— WebKit View๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค. Web View๋Š” deprecated ๋˜์—ˆ๋‹ค๊ณ  ํ•œ๋‹ค. (old version) Webkit์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ํ•ด๋‹น ์Šคํ† ๋ฆฌ๋ณด๋“œ์™€ ์—ฐ๊ฒฐ๋˜๋Š” ๋ทฐ ์ปจํŠธ๋กค๋Ÿฌ์— WebKit ํ”„๋ ˆ์ž„์›Œํฌ๋ฅผ import ํ•ด์ค€๋‹ค. import WebKit ๋„ค์ด๋ฒ„๋ฅผ ์—ด๊ธฐ ์œ„ํ•ด ๋„ค์ด๋ฒ„์˜ ์ฃผ์†Œ๋ฅผ url์— ๋„ฃ์–ด์ค€๋‹ค. import UIKit import WebKit class ViewController: UIViewController { @IBOutlet weak var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let ..