Mercurial > public > simoleon
changeset 67:8f45ba7a279f
Deleted WatchOS
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Wed, 28 Jul 2021 10:10:17 +0100 |
parents | e7210cff632e |
children | aa451ca55e48 |
files | Simoleon/Functions/NetworkRequest.swift Simoleon/Functions/Request.swift SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json SimoleonWatchOS Extension/Assets.xcassets/Contents.json SimoleonWatchOS Extension/ComplicationController.swift SimoleonWatchOS Extension/ContentView.swift SimoleonWatchOS Extension/Helpers/ConversionBox.swift SimoleonWatchOS Extension/Helpers/CurrencyRow.swift SimoleonWatchOS Extension/Info.plist SimoleonWatchOS Extension/NotificationController.swift SimoleonWatchOS Extension/NotificationView.swift SimoleonWatchOS Extension/Preview Content/Preview Assets.xcassets/Contents.json SimoleonWatchOS Extension/PushNotificationPayload.apns SimoleonWatchOS Extension/SimoleonApp.swift SimoleonWatchOS Extension/SimoleonWatchOS Extension.entitlements SimoleonWatchOS/Assets.xcassets/AccentColor.colorset/Contents.json SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch1024.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch108@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch22.5@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch24@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch29@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch29@3x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch40@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch44@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch50@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch86@2x.png SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Watch98@2x.png SimoleonWatchOS/Assets.xcassets/Contents.json SimoleonWatchOS/Info.plist SimoleonWatchOSTests/Info.plist SimoleonWatchOSTests/SimoleonWatchOSTests.swift SimoleonWatchOSUITests/Info.plist SimoleonWatchOSUITests/SimoleonWatchOSUITests.swift |
diffstat | 43 files changed, 35 insertions(+), 927 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Simoleon/Functions/NetworkRequest.swift Wed Jul 28 10:10:17 2021 +0100 @@ -0,0 +1,35 @@ +// +// Request.swift +// Simoleon +// +// Created by Dennis Concepción Martín on 20/07/2021. +// + +import SwiftUI + +func request<T: Decodable>(url: String, model: T.Type, completion: @escaping (_ result: T) -> Void) { + // We take some model data T.Type + guard let url = URL(string: url) else { + print("Invalid URL") + return + } + let request = URLRequest(url: url) + URLSession.shared.dataTask(with: request) { data, response, error in + if let data = data { + do { + // Decode response with the model passed + let decodedResponse = try JSONDecoder().decode(model, from: data) + DispatchQueue.main.async { + completion(decodedResponse) + } + return + } catch { + // Return error regarding the escaping code + print(error) + } + } + // Error with the request + print("Fetch failed: \(error?.localizedDescription ?? "Unknown error")") + } + .resume() +}
--- a/Simoleon/Functions/Request.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ -// -// Request.swift -// Simoleon -// -// Created by Dennis Concepción Martín on 20/07/2021. -// - -import SwiftUI - -func request<T: Decodable>(url: String, model: T.Type, completion: @escaping (_ result: T) -> Void) { - // We take some model data T.Type - guard let url = URL(string: url) else { - print("Invalid URL") - return - } - let request = URLRequest(url: url) - URLSession.shared.dataTask(with: request) { data, response, error in - if let data = data { - do { - // Decode response with the model passed - let decodedResponse = try JSONDecoder().decode(model, from: data) - DispatchQueue.main.async { - completion(decodedResponse) - } - return - } catch { - // Return error regarding the escaping code - print(error) - } - } - // Error with the request - print("Fetch failed: \(error?.localizedDescription ?? "Unknown error")") - } - .resume() -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -{ - "assets" : [ - { - "filename" : "Circular.imageset", - "idiom" : "watch", - "role" : "circular" - }, - { - "filename" : "Extra Large.imageset", - "idiom" : "watch", - "role" : "extra-large" - }, - { - "filename" : "Graphic Bezel.imageset", - "idiom" : "watch", - "role" : "graphic-bezel" - }, - { - "filename" : "Graphic Circular.imageset", - "idiom" : "watch", - "role" : "graphic-circular" - }, - { - "filename" : "Graphic Corner.imageset", - "idiom" : "watch", - "role" : "graphic-corner" - }, - { - "filename" : "Graphic Extra Large.imageset", - "idiom" : "watch", - "role" : "graphic-extra-large" - }, - { - "filename" : "Graphic Large Rectangular.imageset", - "idiom" : "watch", - "role" : "graphic-large-rectangular" - }, - { - "filename" : "Modular.imageset", - "idiom" : "watch", - "role" : "modular" - }, - { - "filename" : "Utilitarian.imageset", - "idiom" : "watch", - "role" : "utilitarian" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ -{ - "images" : [ - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : "<=145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">161" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">145" - }, - { - "idiom" : "watch", - "scale" : "2x", - "screen-width" : ">183" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/Assets.xcassets/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/ComplicationController.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,59 +0,0 @@ -// -// ComplicationController.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import ClockKit - - -class ComplicationController: NSObject, CLKComplicationDataSource { - - // MARK: - Complication Configuration - - func getComplicationDescriptors(handler: @escaping ([CLKComplicationDescriptor]) -> Void) { - let descriptors = [ - CLKComplicationDescriptor(identifier: "complication", displayName: "Simoleon", supportedFamilies: CLKComplicationFamily.allCases) - // Multiple complication support can be added here with more descriptors - ] - - // Call the handler with the currently supported complication descriptors - handler(descriptors) - } - - func handleSharedComplicationDescriptors(_ complicationDescriptors: [CLKComplicationDescriptor]) { - // Do any necessary work to support these newly shared complication descriptors - } - - // MARK: - Timeline Configuration - - func getTimelineEndDate(for complication: CLKComplication, withHandler handler: @escaping (Date?) -> Void) { - // Call the handler with the last entry date you can currently provide or nil if you can't support future timelines - handler(nil) - } - - func getPrivacyBehavior(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationPrivacyBehavior) -> Void) { - // Call the handler with your desired behavior when the device is locked - handler(.showOnLockScreen) - } - - // MARK: - Timeline Population - - func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> Void) { - // Call the handler with the current timeline entry - handler(nil) - } - - func getTimelineEntries(for complication: CLKComplication, after date: Date, limit: Int, withHandler handler: @escaping ([CLKComplicationTimelineEntry]?) -> Void) { - // Call the handler with the timeline entries after the given date - handler(nil) - } - - // MARK: - Sample Templates - - func getLocalizableSampleTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> Void) { - // This method will be called once per supported complication, and the results will be cached - handler(nil) - } -}
--- a/SimoleonWatchOS Extension/ContentView.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -// -// ContentView.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import SwiftUI - -struct ContentView: View { - @Environment(\.managedObjectContext) private var viewContext - @FetchRequest( - sortDescriptors: [NSSortDescriptor(keyPath: \Favorite.currencyPair, ascending: true)], - animation: .default) private var favorite: FetchedResults<Favorite> - - var body: some View { - NavigationView { - VStack { - if favorite.isEmpty { - Group { - Image(systemName: "star") - .padding(.bottom, 5) - .font(.title2) - - Text("Add currencies to favorites on your iPhone.") - .multilineTextAlignment(.center) - } - .foregroundColor(.secondary) - } else { - List { - ForEach(favorite) { favorite in - NavigationLink(destination: ConversionBox(currencyPair: favorite.currencyPair)) { - CurrencyRow(currencyPair: favorite.currencyPair) - } - } - } - } - } - .navigationTitle("Simoleon") - } - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - .environment(\.managedObjectContext, PersistenceController.preview.container.viewContext) - } -}
--- a/SimoleonWatchOS Extension/Helpers/ConversionBox.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,62 +0,0 @@ -// -// ConversionBox.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import SwiftUI - -struct ConversionBox: View { - var currencyPair: String - - @State private var price: Double = 1 - @State private var showingConversion = false - - let currencyMetadata: [String: CurrencyMetadataModel] = parseJson("CurrencyMetadata.json") - - var body: some View { - VStack(alignment: .leading) { - let currencies = currencyPair.split(separator: "/") - Text("\(currencyMetadata[String(currencies[0])]!.name) (\(String(currencies[0])))") - .font(.footnote) - - Text("\(1.00, specifier: "%.2f")") - .font(.title2) - .fontWeight(.semibold) - - Divider() - - Text("\(currencyMetadata[String(currencies[1])]!.name) (\(String(currencies[1])))") - .font(.footnote) - - if showingConversion { - Text("\(1 * price, specifier: "%.2f")") - .font(.title2) - .fontWeight(.semibold) - } else { - ProgressView() - } - } - .onAppear(perform: request) - } - - private func request() { - let url = "\(readConfig("API_URL")!)quotes?pairs=\(currencyPair)&api_key=\(readConfig("API_KEY")!)" - - SimoleonWatchOS_Extension.request(url: url, model: [CurrencyQuoteModel].self) { response in - if let price = response.first?.price { - self.price = price - showingConversion = true - } else { - // Handle error - } - } - } -} - -struct ConversionBox_Previews: PreviewProvider { - static var previews: some View { - ConversionBox(currencyPair: "USD/GBP") - } -}
--- a/SimoleonWatchOS Extension/Helpers/CurrencyRow.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -// -// CurrencyRow.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import SwiftUI - -struct CurrencyRow: View { - var currencyPair: String - - var body: some View { - let currencies = currencyPair.split(separator: "/") - Text("From \(String(currencies[0])) to \(String(currencies[1]))") - .fontWeight(.semibold) - .padding(.leading) - } -} - -struct CurrencyRow_Previews: PreviewProvider { - static var previews: some View { - NavigationLink(destination: ConversionBox(currencyPair: "USD/GBP") - .navigationTitle("Convert") - ) { - CurrencyRow(currencyPair: "USD/GBP") - } - } -}
--- a/SimoleonWatchOS Extension/Info.plist Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>API_KEY</key> - <string>$(API_KEY)</string> - <key>API_URL</key> - <string>$(API_URL)</string> - <key>CFBundleDevelopmentRegion</key> - <string>$(DEVELOPMENT_LANGUAGE)</string> - <key>CFBundleDisplayName</key> - <string>SimoleonWatchOS Extension</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> - <key>CFBundleShortVersionString</key> - <string>$(MARKETING_VERSION)</string> - <key>CFBundleVersion</key> - <string>1</string> - <key>CLKComplicationPrincipalClass</key> - <string>$(PRODUCT_MODULE_NAME).ComplicationController</string> - <key>NSExtension</key> - <dict> - <key>NSExtensionAttributes</key> - <dict> - <key>WKAppBundleIdentifier</key> - <string>io.dennistech.Simoleon.watchkitapp</string> - </dict> - <key>NSExtensionPointIdentifier</key> - <string>com.apple.watchkit</string> - </dict> - <key>UIBackgroundModes</key> - <array> - <string>remote-notification</string> - </array> -</dict> -</plist>
--- a/SimoleonWatchOS Extension/NotificationController.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// -// NotificationController.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import WatchKit -import SwiftUI -import UserNotifications - -class NotificationController: WKUserNotificationHostingController<NotificationView> { - - override var body: NotificationView { - return NotificationView() - } - - override func willActivate() { - // This method is called when watch view controller is about to be visible to user - super.willActivate() - } - - override func didDeactivate() { - // This method is called when watch view controller is no longer visible - super.didDeactivate() - } - - override func didReceive(_ notification: UNNotification) { - // This method is called when a notification needs to be presented. - // Implement it if you use a dynamic notification interface. - // Populate your dynamic notification interface as quickly as possible. - } -}
--- a/SimoleonWatchOS Extension/NotificationView.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -// -// NotificationView.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import SwiftUI - -struct NotificationView: View { - var body: some View { - Text("Hello, World!") - } -} - -struct NotificationView_Previews: PreviewProvider { - static var previews: some View { - NotificationView() - } -}
--- a/SimoleonWatchOS Extension/Preview Content/Preview Assets.xcassets/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS Extension/PushNotificationPayload.apns Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -{ - "aps": { - "alert": { - "body": "Test message", - "title": "Optional title", - "subtitle": "Optional subtitle" - }, - "category": "myCategory", - "thread-id": "5280" - }, - - "WatchKit Simulator Actions": [ - { - "title": "First Button", - "identifier": "firstButtonAction" - } - ], - - "customKey": "Use this file to define a testing payload for your notifications. The aps dictionary specifies the category, alert text and title. The WatchKit Simulator Actions array can provide info for one or more action buttons in addition to the standard Dismiss button. Any other top level keys are custom payload. If you have multiple such JSON files in your project, you'll be able to select them when choosing to debug the notification interface of your Watch App." -}
--- a/SimoleonWatchOS Extension/SimoleonApp.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -// -// SimoleonApp.swift -// SimoleonWatchOS Extension -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import SwiftUI - -@main -struct SimoleonApp: App { - let persistenceController = PersistenceController.shared - - @SceneBuilder var body: some Scene { - WindowGroup { - ContentView() - .environment(\.managedObjectContext, persistenceController.container.viewContext) - } - - WKNotificationScene(controller: NotificationController.self, category: "myCategory") - } -}
--- a/SimoleonWatchOS Extension/SimoleonWatchOS Extension.entitlements Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>aps-environment</key> - <string>development</string> - <key>com.apple.developer.icloud-container-identifiers</key> - <array> - <string>iCloud.simoleon</string> - </array> - <key>com.apple.developer.icloud-services</key> - <array> - <string>CloudKit</string> - </array> -</dict> -</plist>
--- a/SimoleonWatchOS/Assets.xcassets/AccentColor.colorset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ -{ - "colors" : [ - { - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -{ - "images" : [ - { - "filename" : "Watch24@2x.png", - "idiom" : "watch", - "role" : "notificationCenter", - "scale" : "2x", - "size" : "24x24", - "subtype" : "38mm" - }, - { - "filename" : "Watch22.5@2x.png", - "idiom" : "watch", - "role" : "notificationCenter", - "scale" : "2x", - "size" : "27.5x27.5", - "subtype" : "42mm" - }, - { - "filename" : "Watch29@2x.png", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "2x", - "size" : "29x29" - }, - { - "filename" : "Watch29@3x.png", - "idiom" : "watch", - "role" : "companionSettings", - "scale" : "3x", - "size" : "29x29" - }, - { - "filename" : "Watch40@2x.png", - "idiom" : "watch", - "role" : "appLauncher", - "scale" : "2x", - "size" : "40x40", - "subtype" : "38mm" - }, - { - "filename" : "Watch44@2x.png", - "idiom" : "watch", - "role" : "appLauncher", - "scale" : "2x", - "size" : "44x44", - "subtype" : "40mm" - }, - { - "filename" : "Watch50@2x.png", - "idiom" : "watch", - "role" : "appLauncher", - "scale" : "2x", - "size" : "50x50", - "subtype" : "44mm" - }, - { - "filename" : "Watch86@2x.png", - "idiom" : "watch", - "role" : "quickLook", - "scale" : "2x", - "size" : "86x86", - "subtype" : "38mm" - }, - { - "filename" : "Watch98@2x.png", - "idiom" : "watch", - "role" : "quickLook", - "scale" : "2x", - "size" : "98x98", - "subtype" : "42mm" - }, - { - "filename" : "Watch108@2x.png", - "idiom" : "watch", - "role" : "quickLook", - "scale" : "2x", - "size" : "108x108", - "subtype" : "44mm" - }, - { - "filename" : "Watch1024.png", - "idiom" : "watch-marketing", - "scale" : "1x", - "size" : "1024x1024" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS/Assets.xcassets/Contents.json Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -{ - "info" : { - "author" : "xcode", - "version" : 1 - } -}
--- a/SimoleonWatchOS/Info.plist Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>$(DEVELOPMENT_LANGUAGE)</string> - <key>CFBundleDisplayName</key> - <string>Simoleon</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> - <key>CFBundleShortVersionString</key> - <string>$(MARKETING_VERSION)</string> - <key>CFBundleVersion</key> - <string>1</string> - <key>UISupportedInterfaceOrientations</key> - <array> - <string>UIInterfaceOrientationPortrait</string> - <string>UIInterfaceOrientationPortraitUpsideDown</string> - </array> - <key>WKCompanionAppBundleIdentifier</key> - <string>io.dennistech.Simoleon</string> - <key>WKWatchKitApp</key> - <true/> -</dict> -</plist>
--- a/SimoleonWatchOSTests/Info.plist Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>$(DEVELOPMENT_LANGUAGE)</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleVersion</key> - <string>1</string> -</dict> -</plist>
--- a/SimoleonWatchOSTests/SimoleonWatchOSTests.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -// -// SimoleonWatchOSTests.swift -// SimoleonWatchOSTests -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import XCTest -@testable import SimoleonWatchOS_WatchKit_Extension - -class SimoleonWatchOSTests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() throws { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -}
--- a/SimoleonWatchOSUITests/Info.plist Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> -<plist version="1.0"> -<dict> - <key>CFBundleDevelopmentRegion</key> - <string>$(DEVELOPMENT_LANGUAGE)</string> - <key>CFBundleExecutable</key> - <string>$(EXECUTABLE_NAME)</string> - <key>CFBundleIdentifier</key> - <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>$(PRODUCT_NAME)</string> - <key>CFBundlePackageType</key> - <string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string> - <key>CFBundleShortVersionString</key> - <string>1.0</string> - <key>CFBundleVersion</key> - <string>1</string> -</dict> -</plist>
--- a/SimoleonWatchOSUITests/SimoleonWatchOSUITests.swift Tue Jul 27 22:36:14 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -// -// SimoleonWatchOSUITests.swift -// SimoleonWatchOSUITests -// -// Created by Dennis Concepción Martín on 27/07/2021. -// - -import XCTest - -class SimoleonWatchOSUITests: XCTestCase { - - override func setUpWithError() throws { - // Put setup code here. This method is called before the invocation of each test method in the class. - - // In UI tests it is usually best to stop immediately when a failure occurs. - continueAfterFailure = false - - // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. - } - - override func tearDownWithError() throws { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() throws { - // UI tests must launch the application that they test. - let app = XCUIApplication() - app.launch() - - // Use recording to get started writing UI tests. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testLaunchPerformance() throws { - if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) { - // This measures how long it takes to launch your application. - measure(metrics: [XCTApplicationLaunchMetric()]) { - XCUIApplication().launch() - } - } - } -}