Mercurial > public > simoleon
comparison Simoleon/SimoleonApp.swift @ 76:1f657241c28f
Implemented purchases from App Store
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sat, 31 Jul 2021 16:36:01 +0100 |
parents | bfb959bee6d7 |
children | 8afba86ab8dd |
comparison
equal
deleted
inserted
replaced
75:b6f8661300f2 | 76:1f657241c28f |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 import Purchases | 9 import Purchases |
10 | 10 |
11 @main | 11 @main |
12 struct SimoleonApp: App { | 12 struct SimoleonApp: App { |
13 @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate | |
13 let persistenceController = PersistenceController.shared | 14 let persistenceController = PersistenceController.shared |
14 | 15 |
15 init() { | 16 init() { |
16 Purchases.configure(withAPIKey: "\(readConfig("PURCHASES_KEY")!)") | 17 Purchases.configure(withAPIKey: "\(readConfig("PURCHASES_KEY")!)") |
17 } | 18 } |
18 | 19 |
19 var body: some Scene { | 20 var body: some Scene { |
20 WindowGroup { | 21 WindowGroup { |
21 if UIDevice.current.userInterfaceIdiom == .pad { | 22 ContentView() |
22 ContentViewPad() | 23 .environment(\.managedObjectContext, persistenceController.container.viewContext) |
23 .environment(\.managedObjectContext, persistenceController.container.viewContext) | |
24 } else { | |
25 ContentView() | |
26 .environment(\.managedObjectContext, persistenceController.container.viewContext) | |
27 } | |
28 } | 24 } |
29 } | 25 } |
30 } | 26 } |
31 |