일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- init
- RxSwift
- Operators
- vim
- Xcode
- nestjs
- swift6
- init?
- @EnvironmentObject
- IOS
- typeorm
- SWIFT
- Bug
- @Environment
- nonisolated
- NullObject
- @Binding
- Operater
- operator
- NavigationLink
- subject
- URL(string:)
- SwiftUI
- dismiss
- graphql
- Creating Operators
- ios14
- RFC1738/1808
- @State
- RxCocoa
- Today
- Total
목록IOS (36)
Tunko Development Diary
Fierbase 등 프레임워크를 초기화해야 되는데 AppDelegate에서밖에 할 수 없는 상황이 나온다. 이때는 아래 코드로 처리하면 된다. import SwiftUI class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { print("application is starting up. ApplicationDelegate didFinishLaunchingWithOptions.") return true }..
기존 Appdelegate를 사용할 땐 application(_:open:options:) 메서드를 통하여 URL를 라우팅해야 했지만 완전 다른 방식으로 바뀌었습니다. import SwiftUI @main struct TestApp: App { @Environment(\.scenePhase) var scenePhase var body: some Scene { WindowGroup { ContentView() .onOpenURL { url in print("Received URL: \(url)") } } } } } 위 코드를 보면 앱에 최상위 Scene에 url을 수신 할 수 있습니다. 변경된 방식의 장점은 앱 전체에 여러 url 핸들링을 적용할 수 있습니다. 즉 각 화면에서 필요한 딥링크를 개별적으로 선..
신규 프로젝트 생성시에 라이프 사이클을 선택하면 AppDelegate가 없어진 새로운 life cycle 이 적용된 프로젝트가 생성됩니다. 새로 만든 프로젝트 이름은 ’Test’라고 명명했습니다. 이후 (프로젝트명+App).swift 파일을 보면 아래 코드가 나옵니다. import SwiftUI @main struct TestApp: App { var body: some Scene { WindowGroup { ContentView() } } } 우선 제일 먼저 뜯어 볼건 @main 입니다. @main @main 기능은 앱의 시작점인 Entry Points 를 지정하는 것 입니다. @main swift-book 기존 방식인 AppDelegate에서 프레임워크 및 리소스 초기화를 진행했지만 SwiftUI 에..
결론 SceneDelegate는 기존 AppDelegate에서 총괄하던 기능이 분리된것입니다. AppDelegate는 앱시작과 같은 애플리케이션 수준 이벤트 처리 SceneDelegate는 UISceneSession의 장면 생성, 파괴 및 상태 복원과 같은 장면의 생명주기 이벤트를 담당합니다. 2021.2.13 iOS14가 나온 시점에서 이글을 작성합니다. 신규 프로젝트 생성시 SceneDelegate.swift 파일이 프로젝트에 생성되지 않았습니다. SceneDelegate.swift 가 자동으로 생성되려면 Life Cycle을 UIKit App Delegate 로 설정한뒤 프로젝트를 생성해야 합니다. iOS13 부터 등장한 SceneDelegate 기존 AppDelegate 에서는 애플리케이션 실행과..
빈 이미지를 생성해서 넣는 방식으로 해결합니다. self.navigationItem.largeTitleDisplayMode = .never self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController?.navigationBar.shadowImage = UIImage() 아래 사진 두장을 비교해주세요.