diff --git a/.gitignore b/.gitignore index 08b33e6..5989a6c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ xcuserdata/ # Swift Package Manager Packages/ .build/ + +## AppCode +.idea/ diff --git a/Handwriting.xcodeproj/project.pbxproj b/Handwriting.xcodeproj/project.pbxproj index 4fe4c64..40a149b 100644 --- a/Handwriting.xcodeproj/project.pbxproj +++ b/Handwriting.xcodeproj/project.pbxproj @@ -27,7 +27,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - F038598E1EB82F10001F33D1 /* neuralnet-mnist-trained */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "neuralnet-mnist-trained"; sourceTree = SOURCE_ROOT; }; + F038598E1EB82F10001F33D1 /* neuralnet-mnist-trained */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "neuralnet-mnist-trained"; sourceTree = ""; }; F03859911EB82F7F001F33D1 /* UIView+Constraints.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Constraints.swift"; sourceTree = ""; }; F03859931EB83A51001F33D1 /* MainView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainView.swift; sourceTree = ""; }; F03859951EB83AA2001F33D1 /* ShadowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShadowView.swift; sourceTree = ""; }; @@ -64,17 +64,17 @@ children = ( F038598E1EB82F10001F33D1 /* neuralnet-mnist-trained */, ); - name = MNIST; + path = MNIST; sourceTree = ""; }; F03859901EB82F46001F33D1 /* Extensions */ = { isa = PBXGroup; children = ( - F03859911EB82F7F001F33D1 /* UIView+Constraints.swift */, - F03859AB1EB92D8C001F33D1 /* Float+String.swift */, F03859991EB83C15001F33D1 /* Colors.swift */, + F03859AB1EB92D8C001F33D1 /* Float+String.swift */, + F03859911EB82F7F001F33D1 /* UIView+Constraints.swift */, ); - name = Extensions; + path = Extensions; sourceTree = ""; }; F038599C1EB849EF001F33D1 /* NeuralNet */ = { @@ -88,7 +88,7 @@ F03859A21EB84A28001F33D1 /* Storage.swift */, F03859A31EB84A28001F33D1 /* Structure.swift */, ); - name = NeuralNet; + path = NeuralNet; sourceTree = ""; }; F08248361EB82EC200EC951B = { @@ -110,16 +110,16 @@ F08248411EB82EC200EC951B /* Handwriting */ = { isa = PBXGroup; children = ( - F08248421EB82EC200EC951B /* AppDelegate.swift */, - F08248441EB82EC200EC951B /* MainViewController.swift */, - F03859931EB83A51001F33D1 /* MainView.swift */, - F03859951EB83AA2001F33D1 /* ShadowView.swift */, F03859901EB82F46001F33D1 /* Extensions */, - F038599C1EB849EF001F33D1 /* NeuralNet */, F038598D1EB82F00001F33D1 /* MNIST */, + F038599C1EB849EF001F33D1 /* NeuralNet */, + F08248421EB82EC200EC951B /* AppDelegate.swift */, F08248491EB82EC300EC951B /* Assets.xcassets */, - F082484B1EB82EC300EC951B /* LaunchScreen.storyboard */, F082484E1EB82EC300EC951B /* Info.plist */, + F082484B1EB82EC300EC951B /* LaunchScreen.storyboard */, + F03859931EB83A51001F33D1 /* MainView.swift */, + F08248441EB82EC200EC951B /* MainViewController.swift */, + F03859951EB83AA2001F33D1 /* ShadowView.swift */, ); path = Handwriting; sourceTree = ""; @@ -151,12 +151,13 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0910; ORGANIZATIONNAME = "Swift AI"; TargetAttributes = { F082483E1EB82EC200EC951B = { CreatedOnToolsVersion = 8.3.2; DevelopmentTeam = 5ZHKK24J8V; + LastSwiftMigration = 0910; ProvisioningStyle = Automatic; }; }; @@ -223,6 +224,7 @@ F082484C1EB82EC300EC951B /* Base */, ); name = LaunchScreen.storyboard; + path = .; sourceTree = ""; }; /* End PBXVariantGroup section */ @@ -238,7 +240,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -246,7 +250,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -288,7 +296,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -296,7 +306,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -331,7 +345,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "swift-ai.Handwriting"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -345,7 +360,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "swift-ai.Handwriting"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = On; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Handwriting/AppDelegate.swift b/Handwriting/AppDelegate.swift index 689e878..afb2e8b 100644 --- a/Handwriting/AppDelegate.swift +++ b/Handwriting/AppDelegate.swift @@ -24,28 +24,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate { return true } - func applicationWillResignActive(_ application: UIApplication) { - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. - } - - func applicationDidEnterBackground(_ application: UIApplication) { - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. - } - - func applicationWillEnterForeground(_ application: UIApplication) { - // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. - } - - func applicationDidBecomeActive(_ application: UIApplication) { - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. - } - - func applicationWillTerminate(_ application: UIApplication) { - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. - } - - } - diff --git a/Handwriting/Assets.xcassets/AppIcon.appiconset/Contents.json b/Handwriting/Assets.xcassets/AppIcon.appiconset/Contents.json index 0f84764..bcca11a 100644 --- a/Handwriting/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Handwriting/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -47,6 +47,12 @@ "idiom" : "iphone", "filename" : "appIcon@3x.png", "scale" : "3x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "iTunesArtwork@1x.png", + "scale" : "1x" } ], "info" : { diff --git a/Handwriting/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@1x.png b/Handwriting/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@1x.png new file mode 100644 index 0000000..7f2d1ba Binary files /dev/null and b/Handwriting/Assets.xcassets/AppIcon.appiconset/iTunesArtwork@1x.png differ diff --git a/Handwriting/Colors.swift b/Handwriting/Extensions/Colors.swift similarity index 100% rename from Handwriting/Colors.swift rename to Handwriting/Extensions/Colors.swift diff --git a/Handwriting/Float+String.swift b/Handwriting/Extensions/Float+String.swift similarity index 100% rename from Handwriting/Float+String.swift rename to Handwriting/Extensions/Float+String.swift diff --git a/Handwriting/UIView+Constraints.swift b/Handwriting/Extensions/UIView+Constraints.swift similarity index 100% rename from Handwriting/UIView+Constraints.swift rename to Handwriting/Extensions/UIView+Constraints.swift diff --git a/neuralnet-mnist-trained b/Handwriting/MNIST/neuralnet-mnist-trained similarity index 100% rename from neuralnet-mnist-trained rename to Handwriting/MNIST/neuralnet-mnist-trained diff --git a/Handwriting/MainView.swift b/Handwriting/MainView.swift index 85d3501..a5ddf8a 100644 --- a/Handwriting/MainView.swift +++ b/Handwriting/MainView.swift @@ -74,7 +74,7 @@ class MainView: UIView { outputTitleLabel.textAlignment = .center // Output - outputLabel.font = UIFont.systemFont(ofSize: 100, weight: UIFontWeightLight) + outputLabel.font = UIFont.systemFont(ofSize: 100, weight: UIFont.Weight.light) outputLabel.textAlignment = .center // Confidence diff --git a/Handwriting/Activation.swift b/Handwriting/NeuralNet/Activation.swift similarity index 100% rename from Handwriting/Activation.swift rename to Handwriting/NeuralNet/Activation.swift diff --git a/Handwriting/Cache.swift b/Handwriting/NeuralNet/Cache.swift similarity index 100% rename from Handwriting/Cache.swift rename to Handwriting/NeuralNet/Cache.swift diff --git a/Handwriting/Dataset.swift b/Handwriting/NeuralNet/Dataset.swift similarity index 100% rename from Handwriting/Dataset.swift rename to Handwriting/NeuralNet/Dataset.swift diff --git a/Handwriting/Error.swift b/Handwriting/NeuralNet/Error.swift similarity index 100% rename from Handwriting/Error.swift rename to Handwriting/NeuralNet/Error.swift diff --git a/Handwriting/NeuralNet.swift b/Handwriting/NeuralNet/NeuralNet.swift similarity index 100% rename from Handwriting/NeuralNet.swift rename to Handwriting/NeuralNet/NeuralNet.swift diff --git a/Handwriting/Storage.swift b/Handwriting/NeuralNet/Storage.swift similarity index 100% rename from Handwriting/Storage.swift rename to Handwriting/NeuralNet/Storage.swift diff --git a/Handwriting/Structure.swift b/Handwriting/NeuralNet/Structure.swift similarity index 100% rename from Handwriting/Structure.swift rename to Handwriting/NeuralNet/Structure.swift