์ ์ฒด ๊ธ178 [iOS/Swift] ์ฑ๊ธํค ๊ฐ์ฒด ์์ฑ Singleton ํด๋์ค ์ ์ class Singleton { static var sharedObject: Singleton = Singleton() } ์ฌ์ฉ๋ฐฉ๋ฒ Singleton.shared.getUUID() getUUID๋ผ๋ ํจ์๋ฅผ ์ ์ํ์ ๊ฒฝ์ฐ ์์ ๊ฐ์ด ์ฌ์ฉํจ 2023. 2. 4. [iOS/Swift] UIPresentationController custom modal transition style์ ๊ฒฝ์ฐ animator ๊ฐ์ฒด ์ธ์ ํด๋น ๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ ์ ์์ view controller๊ฐ presenting ๋๊ธฐ ์ ์ UIPresentationController์ ์์คํ ์ด presentation controller์ ์์ฑํ๋ฉฐ view controller๊ฐ dismiss ๋๊ธฐ ์ ๊น์ง ์ฐธใ ๋๋ฅผ ์ ์งํ๊ฒ ๋จ presentation controller๋ animator object์ ์๋ช ์ฃผ๊ธฐ๋ฅผ ๋์ด์๋ ์กด์ฌํ ์ ์๊ธฐ ๋๋ฌธ์ presentation controller๋ฅผ ์ฌ์ฉํจ ๋ง์ฝ ์ปค์คํ ํธ๋์ง์ ์ค์ ํ๋ฉด์ ๋ํ๋๋ view controller์ ๋ท ๋ถ๋ถ์ ๊ทธ๋ฆผ์๊ฐ ๋ํ๋์ผ ํ๋ค๋ฉด presentation controlelr๋ shadow๋ทฐ๋ฅผ ์์ฑํ.. 2023. 1. 29. [iOS/Swift] UIViewControllerTransitioningDelegate view controller ์ฌ์ด์์ interactive transition ์ํ ๋ฉ์๋์ ๋ชจ์ modalPresentationStyle ์์ฑ์ .custom์ผ๋ก ์ง์ ํ๊ณ transitioningDelegate ํ๋กํผํฐ๋ฅผ ์ง์ ํด์ผ ํจ presnet, dismiss์ ์ฌ์ฉ๋ animator ๊ฐ์ฒด๋ฅผ ๊ฐ๊ฐ ์ง์ ํ ์ ์์(push, pop ๋ ๋์ผํ๊ฒ ๊ฐ๊ฐ ์ง์ ํ ์ ์์) transition์ ์ฌ์ฉ๋๋ animator ๊ฐ์ฒด๋ UIViewControllerAnimatedTransitioning protocol์ ๋ฐ๋ผ์ผ ํจ ์ ๋๋ฉ์ด์ ์ ํ์ด๋ฐ์ ์ปจํธ๋กค ํ๊ธฐ ์ํด ์ฌ์ฉ์์ ํฐ์น ์ด๋ฒคํธ ๊ฐ์ ๋ฐ๊ฑฐ๋ ๋ค๋ฅธ ์ฌ์ฉ์ ์ธํฐ๋ ์ ์ ์ด์ฉํ๊ณ ์ถ์ ๊ฒฝ์ฐ UIViewControllerInteractiveTransitionin.. 2023. 1. 29. [iOS/Swift] UIViewControllerAnimatedTransitioning ์ ๋ฆฌ custom view controller transition ์ ์ํ ํ๋กํ ์ฝ ๋ทฐ ์ปจํธ๋กค๋ฌ์ ํ๋ฉด ์ ํ์ ์ํ ์ ๋๋ฉ์ด์ ์ ๋ง๋๋ animator ๊ฐ์ฒด๋ฅผ ์ ์ํ ์ ์์ ์ธํฐ๋ ํฐ๋ธ ํธ๋์ง์ ์ ์ฌ์ฉํ๊ธฐ ์ํด์๋ animator ๊ฐ์ฒด๋ฅผ ํ์ด๋ฐ์ ์ ์ดํ ์ ์๋ ๋ค๋ฅธ ๊ฐ์ฒด์ ๊ฒฐํฉํด์ผ ํจ ์ด ํ๋กํ ์ฝ์ ์ฌ์ฉํ๊ธฐ ์ํด์ transitionDuration(using:), animateTransition(using:) ์ ๊ตฌํํด์ผ ํจ UIViewControllerTransitioningDelegate ํ๋กํ ์ฝ์ ๋ฐ๋ฅด๋ ๊ฐ์ฒด์์ animator ๊ฐ์ฒด๋ฅผ ์์ฑํจ ๋ทฐ ์ปจํ๋กค๋ฌ ํ๋ฉด ์ ํ ์ presnet ํ ๊ฒฝ์ฐ UIModalPresentationStyle.custom์ผ๋ก ์ง์ ํด ์ค animator๊ฐ์ฒด๋ UIViewCont.. 2023. 1. 29. [Pod/iOS] Pod ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์์ฑํ๊ณ ๊ด๋ฆฌํ๊ธฐ ํฐ๋ฏธ๋์์ pod lib create [pod name] https://guides.cocoapods.org/making/using-pod-lib-create ์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๋ฉด ํ๋ซํผ์ ์ ํํ ์ ์๋ ๋ฌธ๊ตฌ๊ฐ ๋์ด ์ง๊ธ์ ๋ก์ปฌ์์ ์์ ํ๊ณ ์๊ธฐ ๋๋ฌธ์ ์ด์ ์ ์์ ํ ๊ฐ์ ์ด๋ฆ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์์ง ์์ํ, ์ถฉ๋์ด ๋ฐ์ํ์ง ์๋๋ค What platform do you want to use?? [ iOS / macOS ] > iOS ์ด๋ iOS ์ ํ (๋งฅ์ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์์ฑํ๋ค๋ฉด macOS๋ฅผ ์ ํํ๋ฉด ๋จ) What language do you want to use?? [ Swift / ObjC ] > Swift ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์์ ์ฌ์ฉํ ์ธ์ด ์ ํ Would you like to include a demo .. 2023. 1. 29. [iOS Swift] Deeplink ์ฌ์ฉํ๊ธฐ 1. URL scheme ์ง์ ํ๊ธฐ 2. ๋ฅ๋งํฌ ์ง์ ํ๊ธฐ 1. URL scheme ์ง์ ํ๊ธฐ URL Scheme์ url์ด ์์๋๊ธฐ ์ url ์์ ๋ถ๋ ํ๋ฆฌํฝ์ค ์คํธ๋ง (์๋ฅผ ๋ค์ด https:// ๊ฐ ์์) ์ฑ์ด ์ค์น๋์ง ์์ ๊ฒฝ์ฐ ์ฌ์ฉํ ์ ์์ url์ด์ง๋ง ์ฌํ๋ฆฌ์์ ๋์ํ๋ ๊ฒ์ด ์๋๋ผ ๋ด ์ฑ์ ์ง์ ๋ ๋์์ ์ํํ๋๋ฐ ์ฌ์ฉํจ (1) ์ฑ์์ URL Scheme ๋ฑ๋กํ๊ธฐ Info.plist ํ์ผ์ URL scheme ๋ฑ๋ก Info.plist > URL Types ์น์ Identifier์ ์ฌ์ฉ์ ์ ์ ์คํด์ ์ ๋ ฅํด ์ค Identifier๋ ๋ฒ๋ค id์ ๋์ผ (2) Schene delegate ๋ฉ์๋ ์ ์ํ๊ธฐ ์ฑ์ ๋ฅ๋งํฌ ์ฒ๋ฆฌ ์์ฒญํ๊ธฐ ์ฝ๋๋ ๋ฒจ์์ ํด๋น ์ฝ๋ ๋์ ์ํค๋ฉด ๋จ ํน์ ์ฌํ๋ฆฌ์ ์ฃผ์์ฐฝ์์ ์ง์ .. 2022. 12. 29. [SwiftUI] Sticky Header ์คํฌ๋กค์ ๊ณ ์ ์ํค๊ธฐ ๋ณดํธ๋์ด ์๋ ๊ธ ์ ๋๋ค. 2022. 12. 17. [SwiftUI] Model, ViewModel ์์ฑ Model ์์ฑ - ๋ชจ๋ธ์ Identifiable ํ๋กํ ์ฝ์ ๋ฐ๋ฅด๊ฒ ํจ - Identifiable์ ๋ฐ๋ฅด๋ ๋ชจ๋ธ์ id๋ฅผ ์์ฑํด ์ฃผ์ด์ผ ํ๋ฉฐ ์ด ๊ฐ์ ๊ณ ์ ๊ฐ์ด ๋์ด์ผ ํจ struct Task: Identifiable { var id = UUID().uuidString var title: String } ViewModel ์์ฑ - viewModel์ ObservableObject๋ฅผ ์ฑํํด์ค - Model์ ๋ฐ์ดํฐ๊ฐ ๋ณ๊ฒฝ๋ ๊ฒ์ SwiftUI์ ํ์ํ๋ ค๋ฉด ObservableObject ํ๋กํ ์ฝ์ ๋ชจ๋ธ ํด๋์ค์ ์ฑํํจ class TaskViewModel: ObservableObject { @Published var storedTasks: [Task] = [] } 2022. 12. 17. [SwiftUI] Service Layer to ViewModel with Combine ์ฐธ๊ณ ๋ฐ ์ถ์ฒ ์ฌ์ดํธ https://www.youtube.com/watch?v=TlJUMVKtUhc&list=PLwvDm4Vfkdphbc3bgy_LpLRQ9DDfFGcFu&index=7 Service layer์ ์ญํ - ๋ฐ์ดํฐ ๋ฒ ์ด์ค๋ฅผ ๋ค๋ฃจ๋ ๋ชจ๋ ๋ก์ง์ ํฌํจํ ๋คํธ์ํฌ ๋ ์ด์ด - ๋ฐ์ดํฐ๋ฅผ ๋์ฝ๋ฉ ํ๊ณ ๋ทฐ ๋ชจ๋ธ๋ก ์ ๋ฌํ๋ ์ญํ์ ํจ Services ์์ฑ - New file > Swift ํ์ผ ์ ํ ํ PrefixDataService.swift ํ์ผ ์์ฑ Published ๋ณ์ ์ ์ธ @Published var allCoins: [CoinModel] = [] - @Published ํ๋กํผํฐ ๋ฉํผ๋ฅผ ์ฌ์ฉํด์ ํผ๋ธ๋ฆฌ์ ๋ฅผ ์์ฑํจ - subscriber๊ฐ ํผ๋ธ๋ฆฌ์ ๋ก ์ ์ธ๋ ๋ณ์๋ฅผ ๊ตฌ๋ ํ ์ ์์ Cancellab.. 2022. 11. 21. [SwiftUI] NavigationView์์ ๋ค๋น๊ฒ์ด์ ๋ฐ ์จ๊ธฐ๊ธฐ ์ด์ ์ ์ฌ์ฉํ๋ ์์ฑ์ธ navigationBarHidden์ deprecate ๋ ์์ @available(watchOS, introduced: 6.0, deprecated: 100000.0, message: "Use toolbar(.hidden)") public func navigationBarHidden(_ hidden: Bool) -> some View toolbar(.hidden)์ ์ฌ์ฉ NavigationView { HomeView() .toolbar(.hidden) } HomeView์์ ๋ค๋น๊ฒ์ด์ ํด๋ฐ๋ฅผ ์๋ณด์ด๊ฒ ์ฒ๋ฆฌํจ 2022. 11. 17. [SwiftUI] PreviewProvider ์บ๋ฒ์ค์์ ๋คํฌ ๋ชจ๋ ๊ฐ์ด ๋ณด๊ธฐ struct ButtonView_Previews: PreviewProvider { static var previews: some View { Group { ButtonView(iconName: "info") .previewLayout(.sizeThatFits) ButtonView(iconName: "plus") .previewLayout(.sizeThatFits) .preferredColorScheme(.dark) } } } View๋ฅผ ์์ฑํ๋ฉด PreviewProvider๊ฐ ํจ๊ป ์์ฑ๋์ด ์๊ณ ์ฌ๊ธฐ์ previews๋ก ๋ฏธ๋ฆฌ๋ณด๊ธฐ View๋ฅผ ์ง์ ํจ ButtonView๋ฅผ ์์ฑํ ๊ฒฝ์ฐ struct ButtonView_Previews: PreviewProvider { static var previews: some.. 2022. 11. 17. [RxSwift] RxDataSources๋ก UITableView ์ ๋ฐ์ธ๋ฉ ํ๊ธฐ ๋ณดํธ๋์ด ์๋ ๊ธ ์ ๋๋ค. 2022. 10. 10. ์ด์ 1 2 3 4 5 6 7 ยทยทยท 15 ๋ค์