ν°μ€ν 리 λ·°
728x90
λ°μν
π μμ ―μ ν΅ν΄ μ±μ νΉμ λ·°λ‘ μ΄λ
- QR Code μμ ―μ μ ννλ©΄ μλμ κ°μ΄ νλ©΄μ νμ΄ μ μ©λ QR Code μΈμ λ·°λ‘ μ΄λνλλ‘ νκ² μ΅λλ€.
π widgetURL(_:)
μμ ―μ ν΄λ¦νμ λ containing app μμ μ΄λ¦΄ URL μ μ€μ ν©λλ€.
Overview
widgetURL modifier λ view hierarchy μμ νλλ§ μ§μν©λλ€. μ¬λ¬ λ·°μ widgetURL μ΄ μλ κ²½μ° λμμ΄ μ μλμ§ μμ΅λλ€.
struct QRCodeEnytryView : View {
var entry: QRCodeProvider.Entry
var body: some View {
Image("widgetQr")
.resizable()
.scaledToFill()
// β
.widgetURL(URL(string: "openQRCode"))
}
}
π scene(_:openURLContexts:)
Asks the delegate to open one or more URLs.
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
let qrcodeURL: String = "openQRCode"
guard let url = URLContexts.first?.url,
let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: true) else { return }
if qrcodeURL == urlComponents.path {
guard let nextViewController = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NextViewController") as? NextViewController else { return }
window?.rootViewController?.present(nextViewController, animated: true, completion: nil)
}
}
widgetURL λ‘ μ€μ ν URL μ΄ λ€μ΄μ€κ² λλ©΄ containing app μ νΉμ λ·°λ‘ νλ©΄μ ννλλ‘ νμμ΅λλ€.
728x90
λ°μν
'iOS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
iOS) CoreData λ₯Ό μ¬μ©νμ¬ Configurable Widget λ§λ€κΈ° (1/3) - νλ‘μ νΈ μΈν (0) | 2022.12.30 |
---|---|
iOS) iPhone 14 μ€ν¬λ¦° μ¬μ΄μ¦ μμ보기 (0) | 2022.12.19 |
iOS) Configurable Widget λ§λ€κΈ° (0) | 2022.12.04 |
ARC(Automatic Reference Counting)λ? (0) | 2022.11.18 |
iOS) Swift μμ GCD λ‘ atomic ꡬννκΈ° (0) | 2022.10.15 |
λκΈ
TAG
- containerBackground
- μλ²ν΅μ
- Widget
- WWDC
- YPImagePicker
- github
- IOS
- OpenSourceLibrary
- urlsession
- async/await
- configurable widget
- UserDefaults
- CloneCoding
- RxCocoa
- MOYA
- WidgetKit
- projectsetting
- watchOS
- Algorithm
- rxswift
- Notification
- Swift
- Objective-C
- SwiftUI
- APNS
- MVVM
- WWDC22
- Protocol
- Firebase
- 2022 KAKAO TECH INTERNSHIP
μ΅κ·Όμ μ¬λΌμ¨ κΈ
μ΅κ·Όμ λ¬λ¦° λκΈ
κΈ λ³΄κ΄ν¨
μΌ | μ | ν | μ | λͺ© | κΈ | ν |
---|---|---|---|---|---|---|
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 | 29 | 30 |
λ§ν¬
- Total
- Today
- Yesterday