Mercurial > public > simoleon
changeset 55:ecc58b9cd89d
Added WatchOS target
line wrap: on
line diff
Binary file Simoleon/Localization/en.xcloc/Source Contents/Simoleon/en.lproj/Localizable.strings has changed
Binary file Simoleon/Localization/en.xcloc/Source Contents/Simoleon/es.lproj/Localizable.strings has changed
--- a/Simoleon/Persistence.swift Tue Jul 27 18:05:00 2021 +0100 +++ b/Simoleon/Persistence.swift Tue Jul 27 18:05:28 2021 +0100 @@ -13,10 +13,6 @@ static var preview: PersistenceController = { let result = PersistenceController(inMemory: true) let viewContext = result.container.viewContext - for _ in 0..<10 { - let newItem = Item(context: viewContext) - newItem.timestamp = Date() - } for _ in 0..<10 { let favorite = Favorite(context: viewContext) @@ -25,8 +21,11 @@ do { try viewContext.save() } catch { - // Replace this implementation with code to handle the error appropriately. - // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + /* + Replace this implementation with code to handle the error appropriately. + fatalError() causes the application to generate a crash log and terminate. + You should not use this function in a shipping application, although it may be useful during development. + */ let nsError = error as NSError fatalError("Unresolved error \(nsError), \(nsError.userInfo)") } @@ -44,8 +43,11 @@ } container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { - // Replace this implementation with code to handle the error appropriately. - // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + /* + Replace this implementation with code to handle the error appropriately. + fatalError() causes the application to generate a crash log and terminate. + You should not use this function in a shipping application, although it may be useful during development. + */ /* Typical reasons for an error here include:
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Circular.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,28 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,53 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Extra Large.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,28 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Bezel.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Circular.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Corner.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Extra Large.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,28 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Graphic Large Rectangular.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,18 @@ +{ + "images" : [ + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">161" + }, + { + "idiom" : "watch", + "scale" : "2x", + "screen-width" : ">183" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Modular.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,28 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Complication.complicationset/Utilitarian.imageset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,28 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Assets.xcassets/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/ComplicationController.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,59 @@ +// +// 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) + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/ContentView.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,49 @@ +// +// 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) + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Helpers/ConversionBox.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,62 @@ +// +// 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") + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Helpers/CurrencyRow.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,29 @@ +// +// 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") + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Info.plist Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,44 @@ +<?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>1.0</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/NotificationController.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,33 @@ +// +// 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. + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/NotificationView.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,20 @@ +// +// 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() + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/Preview Content/Preview Assets.xcassets/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/PushNotificationPayload.apns Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,20 @@ +{ + "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." +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/SimoleonApp.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,22 @@ +// +// 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") + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS Extension/SimoleonWatchOS Extension.entitlements Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,16 @@ +<?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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS/Assets.xcassets/AccentColor.colorset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS/Assets.xcassets/AppIcon.appiconset/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,92 @@ +{ + "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 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS/Assets.xcassets/Contents.json Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOS/Info.plist Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,33 @@ +<?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>1.0</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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOSTests/Info.plist Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,22 @@ +<?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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOSTests/SimoleonWatchOSTests.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,33 @@ +// +// 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. + } + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOSUITests/Info.plist Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,22 @@ +<?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>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SimoleonWatchOSUITests/SimoleonWatchOSUITests.swift Tue Jul 27 18:05:28 2021 +0100 @@ -0,0 +1,42 @@ +// +// 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() + } + } + } +}