├── .DS_Store ├── Example ├── .DS_Store ├── Images │ ├── .DS_Store │ ├── meal1.png │ ├── meal2.png │ ├── meal3.png │ ├── emptyStar.png │ ├── filledStar.png │ ├── defaultPhoto.png │ └── highlightedStar.png ├── FoodTracker │ ├── .DS_Store │ ├── FoodTracker │ │ ├── Assets.xcassets │ │ │ ├── Contents.json │ │ │ ├── Rating Images │ │ │ │ ├── Contents.json │ │ │ │ ├── emptyStar.imageset │ │ │ │ │ ├── emptyStar.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── filledStar.imageset │ │ │ │ │ ├── filledStar.png │ │ │ │ │ └── Contents.json │ │ │ │ └── highlightedStar.imageset │ │ │ │ │ ├── highlightedStar.png │ │ │ │ │ └── Contents.json │ │ │ ├── Sample Images │ │ │ │ ├── Contents.json │ │ │ │ ├── meal1.imageset │ │ │ │ │ ├── meal1.png │ │ │ │ │ └── Contents.json │ │ │ │ ├── meal2.imageset │ │ │ │ │ ├── meal2.png │ │ │ │ │ └── Contents.json │ │ │ │ └── meal3.imageset │ │ │ │ │ ├── meal3.png │ │ │ │ │ └── Contents.json │ │ │ ├── defaultPhoto.imageset │ │ │ │ ├── defaultPhoto.png │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── MealTableViewCell.swift │ │ ├── Info.plist │ │ ├── Base.lproj │ │ │ └── LaunchScreen.storyboard │ │ ├── AppDelegate.swift │ │ ├── Meal.swift │ │ ├── RatingControl.swift │ │ ├── MealViewController.swift │ │ └── MealTableViewController.swift │ ├── Pods │ │ ├── Target Support Files │ │ │ ├── iOSGesturizer │ │ │ │ ├── iOSGesturizer.modulemap │ │ │ │ ├── iOSGesturizer-dummy.m │ │ │ │ ├── iOSGesturizer-prefix.pch │ │ │ │ ├── iOSGesturizer-umbrella.h │ │ │ │ ├── iOSGesturizer.xcconfig │ │ │ │ └── Info.plist │ │ │ ├── Pods-FoodTracker │ │ │ │ ├── Pods-FoodTracker.modulemap │ │ │ │ ├── Pods-FoodTracker-dummy.m │ │ │ │ ├── Pods-FoodTracker-umbrella.h │ │ │ │ ├── Pods-FoodTracker.debug.xcconfig │ │ │ │ ├── Pods-FoodTracker.release.xcconfig │ │ │ │ ├── Info.plist │ │ │ │ ├── Pods-FoodTracker-resources.sh │ │ │ │ ├── Pods-FoodTracker-frameworks.sh │ │ │ │ └── Pods-FoodTracker-acknowledgements.markdown │ │ │ └── Pods-FoodTrackerTests │ │ │ │ ├── Pods-FoodTrackerTests.modulemap │ │ │ │ ├── Pods-FoodTrackerTests-acknowledgements.markdown │ │ │ │ ├── Pods-FoodTrackerTests-dummy.m │ │ │ │ ├── Pods-FoodTrackerTests-umbrella.h │ │ │ │ ├── Pods-FoodTrackerTests.debug.xcconfig │ │ │ │ ├── Pods-FoodTrackerTests.release.xcconfig │ │ │ │ ├── Info.plist │ │ │ │ ├── Pods-FoodTrackerTests-acknowledgements.plist │ │ │ │ ├── Pods-FoodTrackerTests-resources.sh │ │ │ │ └── Pods-FoodTrackerTests-frameworks.sh │ │ ├── iOSGesturizer │ │ │ ├── iOSGesturizer │ │ │ │ ├── iOSGesturizer.xcodeproj │ │ │ │ │ └── project.xcworkspace │ │ │ │ │ │ └── contents.xcworkspacedata │ │ │ │ ├── Podfile │ │ │ │ ├── iOSGesturizer │ │ │ │ │ ├── GestureRecognizer │ │ │ │ │ │ ├── Result.swift │ │ │ │ │ │ ├── Template.swift │ │ │ │ │ │ ├── Rectangle.swift │ │ │ │ │ │ ├── Dollar.swift │ │ │ │ │ │ ├── Trigonometric.swift │ │ │ │ │ │ ├── Recognizer.swift │ │ │ │ │ │ ├── TemplateData.swift │ │ │ │ │ │ └── Utils.swift │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── GesturizerUtils.swift │ │ │ │ │ ├── GesturizerWindow.swift │ │ │ │ │ └── GesturizerView.swift │ │ │ │ └── iOSGesturizer.podspec │ │ │ ├── README.md │ │ │ └── LICENSE │ │ ├── Manifest.lock │ │ └── Local Podspecs │ │ │ └── iOSGesturizer.podspec.json │ ├── FoodTracker.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ ├── Podfile.lock │ ├── FoodTracker.xcworkspace │ │ └── contents.xcworkspacedata │ ├── Podfile │ └── FoodTrackerTests │ │ ├── Info.plist │ │ └── FoodTrackerTests.swift └── LICENSE.txt ├── iOSGesturizer ├── .DS_Store ├── iOSGesturizer │ ├── .DS_Store │ ├── GestureRecognizer │ │ ├── Result.swift │ │ ├── Template.swift │ │ ├── Rectangle.swift │ │ ├── Dollar.swift │ │ ├── Trigonometric.swift │ │ ├── Recognizer.swift │ │ ├── TemplateData.swift │ │ └── Utils.swift │ ├── Info.plist │ ├── GesturizerUtils.swift │ ├── GesturizerWindow.swift │ └── GesturizerView.swift ├── iOSGesturizer.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Podfile └── iOSGesturizer.podspec ├── .gitignore ├── README.md └── LICENSE /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/.DS_Store -------------------------------------------------------------------------------- /Example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/.DS_Store -------------------------------------------------------------------------------- /Example/Images/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/.DS_Store -------------------------------------------------------------------------------- /Example/Images/meal1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/meal1.png -------------------------------------------------------------------------------- /Example/Images/meal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/meal2.png -------------------------------------------------------------------------------- /Example/Images/meal3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/meal3.png -------------------------------------------------------------------------------- /iOSGesturizer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/iOSGesturizer/.DS_Store -------------------------------------------------------------------------------- /Example/FoodTracker/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/.DS_Store -------------------------------------------------------------------------------- /Example/Images/emptyStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/emptyStar.png -------------------------------------------------------------------------------- /Example/Images/filledStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/filledStar.png -------------------------------------------------------------------------------- /Example/Images/defaultPhoto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/defaultPhoto.png -------------------------------------------------------------------------------- /Example/Images/highlightedStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/Images/highlightedStar.png -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/iOSGesturizer/iOSGesturizer/.DS_Store -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/iOSGesturizer.modulemap: -------------------------------------------------------------------------------- 1 | framework module iOSGesturizer { 2 | umbrella header "iOSGesturizer-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal1.imageset/meal1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal1.imageset/meal1.png -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal2.imageset/meal2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal2.imageset/meal2.png -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal3.imageset/meal3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal3.imageset/meal3.png -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultPhoto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/defaultPhoto.png -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/iOSGesturizer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_iOSGesturizer : NSObject 3 | @end 4 | @implementation PodsDummy_iOSGesturizer 5 | @end 6 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_FoodTracker { 2 | umbrella header "Pods-FoodTracker-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_FoodTracker : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_FoodTracker 5 | @end 6 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/emptyStar.imageset/emptyStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/emptyStar.imageset/emptyStar.png -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/filledStar.imageset/filledStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/filledStar.imageset/filledStar.png -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_FoodTrackerTests { 2 | umbrella header "Pods-FoodTrackerTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_FoodTrackerTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_FoodTrackerTests 5 | @end 6 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/highlightedStar.imageset/highlightedStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/c0defather/iOSGesturizer/HEAD/Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/highlightedStar.imageset/highlightedStar.png -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/FoodTracker/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - iOSGesturizer (1.0.2) 3 | 4 | DEPENDENCIES: 5 | - iOSGesturizer (= 1.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | iOSGesturizer: 6a2f0e2800d2ed8fdc4e7b12cd9db8309e380c8b 9 | 10 | PODFILE CHECKSUM: f6ff96bb8cd29deae961068b76364817ab2dc5a9 11 | 12 | COCOAPODS: 1.4.0 13 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - iOSGesturizer (1.0.2) 3 | 4 | DEPENDENCIES: 5 | - iOSGesturizer (= 1.0.2) 6 | 7 | SPEC CHECKSUMS: 8 | iOSGesturizer: 6a2f0e2800d2ed8fdc4e7b12cd9db8309e380c8b 9 | 10 | PODFILE CHECKSUM: f6ff96bb8cd29deae961068b76364817ab2dc5a9 11 | 12 | COCOAPODS: 1.4.0 13 | -------------------------------------------------------------------------------- /iOSGesturizer/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'iOSGesturizer' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for iOSGesturizer 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/iOSGesturizer-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'iOSGesturizer' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for iOSGesturizer 9 | 10 | end 11 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/iOSGesturizer-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double iOSGesturizerVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char iOSGesturizerVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "meal1.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "meal2.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Sample Images/meal3.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "meal3.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/defaultPhoto.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "defaultPhoto.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '11.0' 3 | 4 | target 'FoodTracker' do 5 | # Comment the next line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for FoodTracker 9 | pod 'iOSGesturizer' => '1.0.2' 10 | 11 | target 'FoodTrackerTests' do 12 | inherit! :search_paths 13 | # Pods for testing 14 | end 15 | 16 | end 17 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_FoodTrackerVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_FoodTrackerVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/emptyStar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "emptyStar.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/filledStar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filledStar.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/Rating Images/highlightedStar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "highlightedStar.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_FoodTrackerTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_FoodTrackerTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Result 12 | { 13 | public var Index: Int 14 | public var Score: Double 15 | public var Theta: Double 16 | 17 | init(score: Double, index: Int, theta: Double) { 18 | self.Score = score 19 | self.Index = index 20 | self.Theta = theta 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Result.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Result.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Result 12 | { 13 | public var Index: Int 14 | public var Score: Double 15 | public var Theta: Double 16 | 17 | init(score: Double, index: Int, theta: Double) { 18 | self.Score = score 19 | self.Index = index 20 | self.Theta = theta 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Template.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Template.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class Template 12 | { 13 | var mPoints: [CGPoint]! 14 | init (points: [CGPoint]){ 15 | self.mPoints = Utils.Resample(points: points, n: Recognizer.NumPoints); 16 | self.mPoints = Utils.ScaleToSquare(points: self.mPoints, size: Recognizer.SquareSize); 17 | self.mPoints = Utils.TranslateToOrigin(points: self.mPoints); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer/iOSGesturizer.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer/iOSGesturizer.framework/Headers" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Template.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Template.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class Template 12 | { 13 | var mPoints: [CGPoint]! 14 | init (points: [CGPoint]){ 15 | self.mPoints = Utils.Resample(points: points, n: Recognizer.NumPoints); 16 | self.mPoints = Utils.ScaleToSquare(points: self.mPoints, size: Recognizer.SquareSize); 17 | self.mPoints = Utils.TranslateToOrigin(points: self.mPoints); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/iOSGesturizer.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/iOSGesturizer 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Rectangle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Rectangle.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | public class Rectangle { 11 | public var X: Double 12 | public var Y: Double 13 | public var Width: Double 14 | public var Height: Double 15 | 16 | init (x: Double, y: Double, width: Double, height: Double){ 17 | self.X = x; 18 | self.Y = y; 19 | self.Width = width; 20 | self.Height = height; 21 | } 22 | 23 | public func copy(src: Rectangle){ 24 | X = src.X; 25 | Y = src.Y; 26 | Width = src.Width; 27 | Height = src.Height; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "iOSGesturizer" 4 | s.version = "1.0.4" 5 | s.summary = "Enables custom gesture based interaction for iOS apps." 6 | s.description = "The library adds gesture based interaction for any app just in couple lines of code. The gesture interaction is activated using 3D-touch and gestures can be customized." 7 | s.homepage = "https://github.com/c0defather/iOSGesturizer" 8 | s.license = "MIT" 9 | s.author = { "Kuanysh Zhunussov" => "kuanysh.zhunussov@gmail.com" } 10 | s.platform = :ios, "9.0" 11 | s.swift_version = "4.0" 12 | s.source = { :git => "https://github.com/c0defather/iOSGesturizer.git", :tag => "1.0.4" } 13 | s.source_files = "iOSGesturizer/**/*" 14 | end 15 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTrackerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Local Podspecs/iOSGesturizer.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "iOSGesturizer", 3 | "version": "1.0.1", 4 | "summary": "Enables custom gesture based interaction for iOS apps.", 5 | "description": "The library adds gesture based interaction for any app just in couple lines of code. The gesture interaction is activated using 3D-touch and gestures can be customized.", 6 | "homepage": "https://github.com/c0defather/iOSGesturizer", 7 | "license": "MIT", 8 | "authors": { 9 | "Kuanysh Zhunussov": "kuanysh.zhunussov@gmail.com" 10 | }, 11 | "platforms": { 12 | "ios": "11.0" 13 | }, 14 | "swift_version": "4.0", 15 | "source": { 16 | "git": "https://github.com/c0defather/iOSGesturizer.git", 17 | "tag": "1.0.1" 18 | }, 19 | "source_files": "iOSGesturizer/**/*" 20 | } 21 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer/iOSGesturizer.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "iOSGesturizer" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/iOSGesturizer/iOSGesturizer.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "iOSGesturizer" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Rectangle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Rectangle.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | public class Rectangle { 11 | public var X: Double 12 | public var Y: Double 13 | public var Width: Double 14 | public var Height: Double 15 | 16 | init (x: Double, y: Double, width: Double, height: Double){ 17 | self.X = x; 18 | self.Y = y; 19 | self.Width = width; 20 | self.Height = height; 21 | } 22 | 23 | public func copy(src: Rectangle){ 24 | X = src.X; 25 | Y = src.Y; 26 | Width = src.Width; 27 | Height = src.Height; 28 | } 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "iOSGesturizer" 4 | s.version = "1.0.1" 5 | s.summary = "Enables custom gesture based interaction for iOS apps." 6 | s.description = "The library adds gesture based interaction for any app just in couple lines of code. The gesture interaction is activated using 3D-touch and gestures can be customized." 7 | s.homepage = "https://github.com/c0defather/iOSGesturizer" 8 | s.license = "MIT" 9 | s.author = { "Kuanysh Zhunussov" => "kuanysh.zhunussov@gmail.com" } 10 | s.platform = :ios, "11.0" 11 | s.swift_version = "4.0" 12 | s.source = { :git => "https://github.com/c0defather/iOSGesturizer.git", :tag => "1.0.1" } 13 | s.source_files = "iOSGesturizer/**/*" 14 | end 15 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/MealTableViewCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MealTableViewCell.swift 3 | // FoodTracker 4 | // 5 | // Created by Jane Appleseed on 11/15/16. 6 | // Copyright © 2016 Apple Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class MealTableViewCell: UITableViewCell { 12 | 13 | //MARK: Properties 14 | @IBOutlet weak var nameLabel: UILabel! 15 | @IBOutlet weak var photoImageView: UIImageView! 16 | @IBOutlet weak var ratingControl: RatingControl! 17 | 18 | override func awakeFromNib() { 19 | super.awakeFromNib() 20 | // Initialization code 21 | } 22 | 23 | override func setSelected(_ selected: Bool, animated: Bool) { 24 | super.setSelected(selected, animated: animated) 25 | 26 | // Configure the view for the selected state 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/iOSGesturizer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GesturizerUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GesturizerUtils.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/11/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | func lighter(by percentage:CGFloat=30.0) -> UIColor? { 13 | return self.adjust(by: abs(percentage) ) 14 | } 15 | 16 | func darker(by percentage:CGFloat=30.0) -> UIColor? { 17 | return self.adjust(by: -1 * abs(percentage) ) 18 | } 19 | 20 | func adjust(by percentage:CGFloat=30.0) -> UIColor? { 21 | var r:CGFloat=0, g:CGFloat=0, b:CGFloat=0, a:CGFloat=0; 22 | if(self.getRed(&r, green: &g, blue: &b, alpha: &a)){ 23 | return UIColor(red: min(r + percentage/100, 1.0), 24 | green: min(g + percentage/100, 1.0), 25 | blue: min(b + percentage/100, 1.0), 26 | alpha: a) 27 | }else{ 28 | return nil 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GesturizerUtils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GesturizerUtils.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/11/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | extension UIColor { 12 | func lighter(by percentage:CGFloat=30.0) -> UIColor? { 13 | return self.adjust(by: abs(percentage) ) 14 | } 15 | 16 | func darker(by percentage:CGFloat=30.0) -> UIColor? { 17 | return self.adjust(by: -1 * abs(percentage) ) 18 | } 19 | 20 | func adjust(by percentage:CGFloat=30.0) -> UIColor? { 21 | var r:CGFloat=0, g:CGFloat=0, b:CGFloat=0, a:CGFloat=0; 22 | if(self.getRed(&r, green: &g, blue: &b, alpha: &a)){ 23 | return UIColor(red: min(r + percentage/100, 1.0), 24 | green: min(g + percentage/100, 1.0), 25 | blue: min(b + percentage/100, 1.0), 26 | alpha: a) 27 | }else{ 28 | return nil 29 | } 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GesturizerWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GesturizerWindow.swift 3 | // Gesturizer 4 | // 5 | // Created by Kuanysh on 2/10/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class GesturizerWindow: UIWindow { 12 | var view: GesturizerView! 13 | 14 | public func setGestureView(view: GesturizerView) { 15 | self.view = view 16 | self.addSubview(view) 17 | } 18 | 19 | override public func sendEvent(_ event: UIEvent) { 20 | if event.type == .touches { 21 | if let count = event.allTouches?.filter({ $0.phase == .began }).count, count > 0 { 22 | view.touchesBegan(event.allTouches!) 23 | super.sendEvent(event) 24 | } 25 | if let count = event.allTouches?.filter({ $0.phase == .moved }).count, count > 0 { 26 | view.touchesMoved(event.allTouches!) 27 | if (!view.forceTouch){ 28 | super.sendEvent(event) 29 | } 30 | } 31 | if let count = event.allTouches?.filter({ $0.phase == .ended }).count, count > 0 { 32 | view.touchesEnded(event.allTouches!) 33 | super.sendEvent(event) 34 | } 35 | if let count = event.allTouches?.filter({ $0.phase == .cancelled }).count, count > 0 { 36 | super.sendEvent(event) 37 | } 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GesturizerWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GesturizerWindow.swift 3 | // Gesturizer 4 | // 5 | // Created by Kuanysh on 2/10/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class GesturizerWindow: UIWindow { 12 | var view: GesturizerView! 13 | 14 | public func setGestureView(view: GesturizerView) { 15 | self.view = view 16 | } 17 | 18 | override public func sendEvent(_ event: UIEvent) { 19 | if event.type == .touches { 20 | if let count = event.allTouches?.filter({ $0.phase == .began }).count, count > 0 { 21 | view.touchesBegan(event.allTouches!) 22 | super.sendEvent(event) 23 | } 24 | if let count = event.allTouches?.filter({ $0.phase == .moved }).count, count > 0 { 25 | view.touchesMoved(event.allTouches!) 26 | if (!view.forceTouch){ 27 | super.sendEvent(event) 28 | } 29 | } 30 | if let count = event.allTouches?.filter({ $0.phase == .ended }).count, count > 0 { 31 | view.touchesEnded(event.allTouches!) 32 | super.sendEvent(event) 33 | } 34 | if let count = event.allTouches?.filter({ $0.phase == .cancelled }).count, count > 0 { 35 | super.sendEvent(event) 36 | } 37 | } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTrackerTests/FoodTrackerTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FoodTrackerTests.swift 3 | // FoodTrackerTests 4 | // 5 | // Created by Jane Appleseed on 10/17/16. 6 | // Copyright © 2016 Apple Inc. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import FoodTracker 11 | 12 | class FoodTrackerTests: XCTestCase { 13 | 14 | //MARK: Meal Class Tests 15 | 16 | // Confirm that the Meal initializer returns a Meal object when passed valid parameters. 17 | func testMealInitializationSucceeds() { 18 | 19 | // Zero rating 20 | let zeroRatingMeal = Meal.init(name: "Zero", photo: nil, rating: 0) 21 | XCTAssertNotNil(zeroRatingMeal) 22 | 23 | // Positive rating 24 | let positiveRatingMeal = Meal.init(name: "Positive", photo: nil, rating: 5) 25 | XCTAssertNotNil(positiveRatingMeal) 26 | 27 | } 28 | 29 | // Confirm that the Meal initialier returns nil when passed a negative rating or an empty name. 30 | func testMealInitializationFails() { 31 | 32 | // Negative rating 33 | let negativeRatingMeal = Meal.init(name: "Negative", photo: nil, rating: -1) 34 | XCTAssertNil(negativeRatingMeal) 35 | 36 | // Rating exceeds maximum 37 | let largeRatingMeal = Meal.init(name: "Large", photo: nil, rating: 6) 38 | XCTAssertNil(largeRatingMeal) 39 | 40 | // Empty String 41 | let emptyStringMeal = Meal.init(name: "", photo: nil, rating: 0) 42 | XCTAssertNil(emptyStringMeal) 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Dollar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dollar.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class Dollar{ 12 | var x,y: Int! 13 | var state: Int! 14 | 15 | var key = Int(-1) 16 | 17 | var gesture = true 18 | var points = [CGPoint]() 19 | 20 | var recognizer: Recognizer! 21 | var result = Result(score: 0, index: -1, theta: Utils.lastTheta) 22 | 23 | var active = true 24 | 25 | var gestureSet: Int! 26 | 27 | init(){ 28 | recognizer = Recognizer() 29 | } 30 | 31 | public func getPoints() -> [CGPoint] { 32 | return points 33 | } 34 | 35 | public func addPoint(x: Int, y: Int) { 36 | if (active){ 37 | points.append(CGPoint(x: x, y: y)) 38 | } 39 | } 40 | 41 | public func recognize() { 42 | 43 | if (!active){ 44 | return 45 | } 46 | 47 | if (points.count == 0){ 48 | return 49 | } 50 | 51 | result = recognizer.Recognize(points: points) 52 | 53 | } 54 | 55 | public func predict() -> [Result]{ 56 | if (!active){ 57 | return [Result]() 58 | } 59 | 60 | if (points.count == 0){ 61 | return [Result]() 62 | } 63 | return recognizer.Predict(points: points) 64 | } 65 | 66 | 67 | public func clear() { 68 | points.removeAll() 69 | result.Score = 0 70 | result.Index = -1 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Dollar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Dollar.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class Dollar{ 12 | var x,y: Int! 13 | var state: Int! 14 | 15 | var key = Int(-1) 16 | 17 | var gesture = true 18 | var points = [CGPoint]() 19 | 20 | var recognizer: Recognizer! 21 | var result = Result(score: 0, index: -1, theta: Utils.lastTheta) 22 | 23 | var active = true 24 | 25 | var gestureSet: Int! 26 | 27 | init(){ 28 | recognizer = Recognizer() 29 | } 30 | 31 | public func getPoints() -> [CGPoint] { 32 | return points 33 | } 34 | 35 | public func addPoint(x: Int, y: Int) { 36 | if (active){ 37 | points.append(CGPoint(x: x, y: y)) 38 | } 39 | } 40 | 41 | public func recognize() { 42 | 43 | if (!active){ 44 | return 45 | } 46 | 47 | if (points.count == 0){ 48 | return 49 | } 50 | 51 | result = recognizer.Recognize(points: points) 52 | 53 | } 54 | 55 | public func predict() -> [Result]{ 56 | if (!active){ 57 | return [Result]() 58 | } 59 | 60 | if (points.count == 0){ 61 | return [Result]() 62 | } 63 | return recognizer.Predict(points: points) 64 | } 65 | 66 | 67 | public func clear() { 68 | points.removeAll() 69 | result.Score = 0 70 | result.Index = -1 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | .build/ 41 | 42 | # CocoaPods 43 | # 44 | # We recommend against adding the Pods directory to your .gitignore. However 45 | # you should judge for yourself, the pros and cons are mentioned at: 46 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 47 | # 48 | # Pods/ 49 | 50 | # Carthage 51 | # 52 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 53 | # Carthage/Checkouts 54 | 55 | Carthage/Build 56 | 57 | # fastlane 58 | # 59 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 60 | # screenshots whenever they are needed. 61 | # For more information about the recommended setup visit: 62 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 63 | 64 | fastlane/report.xml 65 | fastlane/Preview.html 66 | fastlane/screenshots 67 | fastlane/test_output 68 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSPhotoLibraryUsageDescription 24 | Allows you to add photos to your meals. 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FoodTracker 4 | // 5 | // Created by Jane Appleseed on 10/17/16. 6 | // Copyright © 2016 Apple Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import iOSGesturizer 11 | 12 | @UIApplicationMain 13 | class AppDelegate: UIResponder, UIApplicationDelegate { 14 | 15 | var window: UIWindow? = GesturizerWindow() 16 | 17 | 18 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 19 | // Override point for customization after application launch. 20 | return true 21 | } 22 | 23 | func applicationWillResignActive(_ application: UIApplication) { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 26 | } 27 | 28 | func applicationDidEnterBackground(_ application: UIApplication) { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | func applicationWillEnterForeground(_ application: UIApplication) { 34 | // 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. 35 | } 36 | 37 | func applicationDidBecomeActive(_ application: UIApplication) { 38 | // 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. 39 | } 40 | 41 | func applicationWillTerminate(_ application: UIApplication) { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Example/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Sample code project: FoodTracker 2 | Version: 1.0 3 | 4 | IMPORTANT: This Apple software is supplied to you by Apple 5 | Inc. ("Apple") in consideration of your agreement to the following 6 | terms, and your use, installation, modification or redistribution of 7 | this Apple software constitutes acceptance of these terms. If you do 8 | not agree with these terms, please do not use, install, modify or 9 | redistribute this Apple software. 10 | 11 | In consideration of your agreement to abide by the following terms, and 12 | subject to these terms, Apple grants you a personal, non-exclusive 13 | license, under Apple's copyrights in this original Apple software (the 14 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 15 | Software, with or without modifications, in source and/or binary forms; 16 | provided that if you redistribute the Apple Software in its entirety and 17 | without modifications, you must retain this notice and the following 18 | text and disclaimers in all such redistributions of the Apple Software. 19 | Neither the name, trademarks, service marks or logos of Apple Inc. may 20 | be used to endorse or promote products derived from the Apple Software 21 | without specific prior written permission from Apple. Except as 22 | expressly stated in this notice, no other rights or licenses, express or 23 | implied, are granted by Apple herein, including but not limited to any 24 | patent rights that may be infringed by your derivative works or by other 25 | works in which the Apple Software may be incorporated. 26 | 27 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 28 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 29 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 30 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 31 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 32 | 33 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 34 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 35 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 36 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 37 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 38 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 39 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 40 | POSSIBILITY OF SUCH DAMAGE. 41 | 42 | Copyright (C) 2015 Apple Inc. All Rights Reserved. -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/Meal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Meal.swift 3 | // FoodTracker 4 | // 5 | // Created by Jane Appleseed on 11/10/16. 6 | // Copyright © 2016 Apple Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import os.log 11 | 12 | 13 | class Meal: NSObject, NSCoding { 14 | 15 | //MARK: Properties 16 | 17 | var name: String 18 | var photo: UIImage? 19 | var rating: Int 20 | 21 | //MARK: Archiving Paths 22 | static let DocumentsDirectory = FileManager().urls(for: .documentDirectory, in: .userDomainMask).first! 23 | static let ArchiveURL = DocumentsDirectory.appendingPathComponent("meals") 24 | 25 | //MARK: Types 26 | 27 | struct PropertyKey { 28 | static let name = "name" 29 | static let photo = "photo" 30 | static let rating = "rating" 31 | } 32 | 33 | //MARK: Initialization 34 | 35 | init?(name: String, photo: UIImage?, rating: Int) { 36 | 37 | // The name must not be empty 38 | guard !name.isEmpty else { 39 | return nil 40 | } 41 | 42 | // The rating must be between 0 and 5 inclusively 43 | guard (rating >= 0) && (rating <= 5) else { 44 | return nil 45 | } 46 | 47 | // Initialization should fail if there is no name or if the rating is negative. 48 | if name.isEmpty || rating < 0 { 49 | return nil 50 | } 51 | 52 | // Initialize stored properties. 53 | self.name = name 54 | self.photo = photo 55 | self.rating = rating 56 | 57 | } 58 | 59 | //MARK: NSCoding 60 | 61 | func encode(with aCoder: NSCoder) { 62 | aCoder.encode(name, forKey: PropertyKey.name) 63 | aCoder.encode(photo, forKey: PropertyKey.photo) 64 | aCoder.encode(rating, forKey: PropertyKey.rating) 65 | } 66 | 67 | required convenience init?(coder aDecoder: NSCoder) { 68 | 69 | // The name is required. If we cannot decode a name string, the initializer should fail. 70 | guard let name = aDecoder.decodeObject(forKey: PropertyKey.name) as? String else { 71 | os_log("Unable to decode the name for a Meal object.", log: OSLog.default, type: .debug) 72 | return nil 73 | } 74 | 75 | // Because photo is an optional property of Meal, just use conditional cast. 76 | let photo = aDecoder.decodeObject(forKey: PropertyKey.photo) as? UIImage 77 | 78 | let rating = aDecoder.decodeInteger(forKey: PropertyKey.rating) 79 | 80 | // Must call designated initializer. 81 | self.init(name: name, photo: photo, rating: rating) 82 | 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/README.md: -------------------------------------------------------------------------------- 1 | # iOSGesturizer 2 | Introducing iOSGesturizer - iOS library that easily enables unistroke gesture interaction for any apps running on iOS devices with 3D-touch. 3 | 4 | demo 5 | ## Features 6 | 7 | - Customizable gestures. 8 | - Gestures can be executed anywhere on the screen. 9 | - Gesture mode is activated when a user applies additional pressure to the screen. 10 | - Training mode is activated when a user 'hesitates'. 11 | - Supports training mode to learn gestures (based on OctoPocus). 12 | 13 | ## Requirements 14 | 15 | - Requires iOS 11 or later 16 | - Requires 3D-touch 17 | 18 | ## Demo Project 19 | 20 | Build and run the FoodTrack project in Xcode. Basically, we took an app provided in Apple's tutorials and applied iOSGesturizer to it. 21 | 22 | ## Installation 23 | 24 | ### The Pod Way 25 | 26 | Simply add the following line to your Podfile: 27 | 28 | platform :ios, '11.0' 29 | pod 'iOSGesturizer' 30 | 31 | ### The Old School Way 32 | 33 | The simplest way to use iOSGesturizer with your application is to add iOSGesturizer folder as a framework in Builds Settings in your XCode project. 34 | 35 | ## Usage 36 | 37 | In AppDelegate class add the following line: 38 | ``` 39 | var window: UIWindow? = GesturizerWindow() 40 | ``` 41 | 42 | Also, in your main View Controller add the following lines: 43 | 44 | ``` 45 | override func viewDidAppear(_ animated: Bool) { 46 | super.viewDidAppear(animated) 47 | let window = UIApplication.shared.keyWindow! as! GesturizerWindow 48 | let view = GesturizerView() 49 | view.gestureHandler = {index in 50 | // index is the index of a gesture that was recognizer 51 | // do whatever you need 52 | } 53 | window.setGestureView(view: view) 54 | window.addSubview(view) 55 | } 56 | ``` 57 | 58 | ## Customization 59 | 60 | For customization of gestures provide your data points into TemplateData class. 61 | 62 | 63 | 64 | ## License 65 | 66 | ``` 67 | Copyright 2018 Kuanysh Zhunussov 68 | 69 | Licensed under the Apache License, Version 2.0 (the "License"); 70 | you may not use this file except in compliance with the License. 71 | You may obtain a copy of the License at 72 | 73 | http://www.apache.org/licenses/LICENSE-2.0 74 | 75 | Unless required by applicable law or agreed to in writing, software 76 | distributed under the License is distributed on an "AS IS" BASIS, 77 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 78 | See the License for the specific language governing permissions and 79 | limitations under the License. 80 | ``` 81 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # iOSGesturizer 2 | Introducing iOSGesturizer - the framework that easily enables unistroke gesture interaction for any apps running on iOS devices with 3D-touch. 3 | 4 | iOSGesturizer 5 | 6 | ## Features 7 | 8 | - Gestures can be executed anywhere on the screen without conflicting with existing UI views. 9 | - Gestures are customizable - simply provide your gesture (x,y) points. 10 | - Gesture mode is activated when a user applies additional pressure to the screen. 11 | - Supports training mode to learn gestures (based on OctoPocus). 12 | - Training mode is activated when a user 'hesitates', i.e. after 1 second. 13 | 14 | ## Requirements 15 | 16 | - iOS 9 or later 17 | - iPhone 6s or later (3D-touch) 18 | 19 | ## Demo 20 | 21 | Video demo is available on YouTube. 22 | 23 | Build and run the FoodTrack project in Xcode. Basically, we took an app provided in Apple's tutorials and applied iOSGesturizer to it. 24 | 25 | ## Usage 26 | 27 | In AppDelegate class add the following line: 28 | ```swift 29 | var window: UIWindow? = GesturizerWindow() 30 | ``` 31 | 32 | Also, in your main View Controller add the following lines: 33 | 34 | ```swift 35 | override func viewDidAppear(_ animated: Bool) { 36 | super.viewDidAppear(animated) 37 | let window = UIApplication.shared.keyWindow! as! GesturizerWindow 38 | let view = GesturizerView() 39 | view.gestureHandler = {index in 40 | // write a command related to a gesture with given index 41 | // i.e. do whatever you need 42 | } 43 | window.setGestureView(view: view) 44 | } 45 | ``` 46 | 47 | ## Installation 48 | 49 | ### The Pod Way 50 | 51 | Simply add the following line to your Podfile: 52 | 53 | pod 'iOSGesturizer' 54 | 55 | ### The Old School Way 56 | 57 | Another way to use iOSGesturizer with your application is to add iOSGesturizer folder as a framework in Builds Settings in your XCode project. 58 | 59 | ## Customization 60 | 61 | For customization of gestures provide your data points into TemplateData class. 62 | 63 | ## Acknowledgements 64 | Thanks to Noble Applications for provided resources and help in development of the framework. 65 | 66 | ## License 67 | 68 | ``` 69 | Copyright 2018 Kuanysh Zhunussov 70 | 71 | Licensed under the Apache License, Version 2.0 (the "License"); 72 | you may not use this file except in compliance with the License. 73 | You may obtain a copy of the License at 74 | 75 | http://www.apache.org/licenses/LICENSE-2.0 76 | 77 | Unless required by applicable law or agreed to in writing, software 78 | distributed under the License is distributed on an "AS IS" BASIS, 79 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 80 | See the License for the specific language governing permissions and 81 | limitations under the License. 82 | ``` 83 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Trigonometric.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Trigonometric.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Trigonometric 12 | { 13 | // constants 14 | static let sq2p1 = 2.414213562373095048802e0 15 | static let sq2m1 = 0.414213562373095048802e0 16 | static let p4 = 0.161536412982230228262e2 17 | static let p3 = 0.26842548195503973794141e3 18 | static let p2 = 0.11530293515404850115428136e4 19 | static let p1 = 0.178040631643319697105464587e4 20 | static let p0 = 0.89678597403663861959987488e3 21 | static let q4 = 0.5895697050844462222791e2 22 | static let q3 = 0.536265374031215315104235e3 23 | static let q2 = 0.16667838148816337184521798e4 24 | static let q1 = 0.207933497444540981287275926e4 25 | static let q0 = 0.89678597403663861962481162e3 26 | static let PIO2 = 1.5707963267948966135E0 27 | static let nan = (0.0/0.0) 28 | static let PI = 3.141592653589793 29 | 30 | // reduce 31 | private static func mxatan(arg: Double) -> Double { 32 | var argsq, value: Double 33 | argsq = arg*arg; 34 | value = ((((p4*argsq + p3)*argsq + p2)*argsq + p1)*argsq + p0) 35 | value = value/(((((argsq + q4)*argsq + q3)*argsq + q2)*argsq + q1)*argsq + q0) 36 | return value*arg 37 | } 38 | 39 | // reduce 40 | private static func msatan(arg: Double) -> Double { 41 | if(arg < sq2m1){ 42 | return mxatan(arg: arg) 43 | } 44 | if(arg > sq2p1){ 45 | return PIO2 - mxatan(arg: 1/arg) 46 | } 47 | return PIO2/2 + mxatan(arg: (arg-1)/(arg+1)) 48 | } 49 | 50 | // implementation of atan 51 | public static func atan(arg: Double) -> Double { 52 | if(arg > 0){ 53 | return msatan(arg: arg) 54 | } 55 | return -msatan(arg: -arg) 56 | } 57 | 58 | // implementation of atan2 59 | public static func atan2(arg1: inout Double, arg2: Double) -> Double{ 60 | if(arg1+arg2 == arg1){ 61 | if(arg1 >= 0){ 62 | return PIO2 63 | } 64 | return -PIO2 65 | } 66 | arg1 = atan(arg: arg1/arg2) 67 | if(arg2 < 0){ 68 | if(arg1 <= 0){ 69 | return arg1 + PI 70 | } 71 | return arg1 - PI 72 | } 73 | return arg1 74 | } 75 | 76 | // implementation of asin 77 | public static func asin(arg: inout Double) -> Double { 78 | var temp: Double 79 | var sign = 0 80 | 81 | if(arg < 0){ 82 | arg = -arg 83 | sign += 1 84 | } 85 | if(arg > 1){ 86 | return nan 87 | } 88 | temp = sqrt(1 - arg*arg) 89 | if(arg > 0.7){ 90 | temp = PIO2 - atan(arg: temp/arg) 91 | } else{ 92 | temp = atan(arg: arg/temp) 93 | } 94 | if(sign > 0){ 95 | temp = -temp 96 | } 97 | return temp 98 | } 99 | 100 | // implementation of acos 101 | public static func acos(arg: inout Double) -> Double { 102 | if(arg > 1 || arg < -1){ 103 | return nan 104 | } 105 | return PIO2 - asin(arg: &arg) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Trigonometric.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Trigonometric.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public class Trigonometric 12 | { 13 | // constants 14 | static let sq2p1 = 2.414213562373095048802e0 15 | static let sq2m1 = 0.414213562373095048802e0 16 | static let p4 = 0.161536412982230228262e2 17 | static let p3 = 0.26842548195503973794141e3 18 | static let p2 = 0.11530293515404850115428136e4 19 | static let p1 = 0.178040631643319697105464587e4 20 | static let p0 = 0.89678597403663861959987488e3 21 | static let q4 = 0.5895697050844462222791e2 22 | static let q3 = 0.536265374031215315104235e3 23 | static let q2 = 0.16667838148816337184521798e4 24 | static let q1 = 0.207933497444540981287275926e4 25 | static let q0 = 0.89678597403663861962481162e3 26 | static let PIO2 = 1.5707963267948966135E0 27 | static let nan = (0.0/0.0) 28 | static let PI = 3.141592653589793 29 | 30 | // reduce 31 | private static func mxatan(arg: Double) -> Double { 32 | var argsq, value: Double 33 | argsq = arg*arg; 34 | value = ((((p4*argsq + p3)*argsq + p2)*argsq + p1)*argsq + p0) 35 | value = value/(((((argsq + q4)*argsq + q3)*argsq + q2)*argsq + q1)*argsq + q0) 36 | return value*arg 37 | } 38 | 39 | // reduce 40 | private static func msatan(arg: Double) -> Double { 41 | if(arg < sq2m1){ 42 | return mxatan(arg: arg) 43 | } 44 | if(arg > sq2p1){ 45 | return PIO2 - mxatan(arg: 1/arg) 46 | } 47 | return PIO2/2 + mxatan(arg: (arg-1)/(arg+1)) 48 | } 49 | 50 | // implementation of atan 51 | public static func atan(arg: Double) -> Double { 52 | if(arg > 0){ 53 | return msatan(arg: arg) 54 | } 55 | return -msatan(arg: -arg) 56 | } 57 | 58 | // implementation of atan2 59 | public static func atan2(arg1: inout Double, arg2: Double) -> Double{ 60 | if(arg1+arg2 == arg1){ 61 | if(arg1 >= 0){ 62 | return PIO2 63 | } 64 | return -PIO2 65 | } 66 | arg1 = atan(arg: arg1/arg2) 67 | if(arg2 < 0){ 68 | if(arg1 <= 0){ 69 | return arg1 + PI 70 | } 71 | return arg1 - PI 72 | } 73 | return arg1 74 | } 75 | 76 | // implementation of asin 77 | public static func asin(arg: inout Double) -> Double { 78 | var temp: Double 79 | var sign = 0 80 | 81 | if(arg < 0){ 82 | arg = -arg 83 | sign += 1 84 | } 85 | if(arg > 1){ 86 | return nan 87 | } 88 | temp = sqrt(1 - arg*arg) 89 | if(arg > 0.7){ 90 | temp = PIO2 - atan(arg: temp/arg) 91 | } else{ 92 | temp = atan(arg: arg/temp) 93 | } 94 | if(sign > 0){ 95 | temp = -temp 96 | } 97 | return temp 98 | } 99 | 100 | // implementation of acos 101 | public static func acos(arg: inout Double) -> Double { 102 | if(arg > 1 || arg < -1){ 103 | return nan 104 | } 105 | return PIO2 - asin(arg: &arg) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Recognizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Recognizer.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class Recognizer 12 | { 13 | // 14 | // Recognizer class constants 15 | // 16 | public static let NumPoints = 16 17 | public static let SquareSize = 180.0 18 | let HalfDiagonal = 0.5 * sqrt(2*SquareSize*SquareSize) 19 | let AngleRange = 45.0 20 | let AnglePrecision = 2.0 21 | public static let Phi = 0.5 * (-1.0 + sqrt(5.0)) // Golden Ratio 22 | 23 | public var centroid = CGPoint(x: 0, y: 0) 24 | public var boundingBox = Rectangle(x: 0, y: 0, width: 0, height: 0) 25 | 26 | var bounds = [0, 0, 0, 0] 27 | 28 | var Templates = [Template]() 29 | var RawTemplates = [[CGPoint]]() 30 | 31 | init(){ 32 | loadTemplatesDefault() 33 | } 34 | 35 | func loadTemplatesDefault() { 36 | for i in 0...2 { 37 | Templates.append(loadTemplate(array: TemplateData.DataRight[i])) 38 | } 39 | } 40 | 41 | func loadTemplate(array: [Double]) -> Template { 42 | return Template(points: loadArray(array: array)); 43 | } 44 | 45 | func loadArray(array: [Double]) -> [CGPoint] { 46 | var v = [CGPoint]() 47 | for i in 0...array.count-1{ 48 | if (i%2==0){ 49 | let p = CGPoint(x: array[i], y:array[i+1]); 50 | v.append(p); 51 | } 52 | } 53 | RawTemplates.append(v) 54 | return v 55 | } 56 | 57 | public func Recognize(points: [CGPoint]) -> Result { 58 | var points2 = Utils.Resample(points: points, n: Recognizer.NumPoints) 59 | points2 = Utils.ScaleToSquare(points: points2, size: Recognizer.SquareSize) 60 | points2 = Utils.TranslateToOrigin(points: points2) 61 | bounds[0] = Int(boundingBox.X) 62 | bounds[1] = Int(boundingBox.Y) 63 | bounds[2] = Int(boundingBox.X + boundingBox.Width) 64 | bounds[3] = Int(boundingBox.Y + boundingBox.Height) 65 | 66 | var t = 0 67 | 68 | var b = Double.greatestFiniteMagnitude 69 | for i in 0...Templates.count-1{ 70 | let d = Utils.DistanceAtBestAngle(points: points2, T: Templates[i], a: -AngleRange, b: AngleRange, threshold: AnglePrecision) 71 | if (d < b) { 72 | b = d 73 | t = i 74 | } 75 | } 76 | let score = 1.0 - (b / HalfDiagonal) 77 | return Result(score: score, index: t, theta: Utils.lastTheta) 78 | } 79 | 80 | public func Predict(points: [CGPoint]) -> [Result] { 81 | var answer = [Result]() 82 | var length = 0.0 83 | for i in 1...points.count-1{ 84 | length += Utils.Distance(p1: points[i-1], p2: points[i]) 85 | } 86 | if (length == 0) { 87 | for i in 0...RawTemplates.count-1{ 88 | answer.append(Result(score: 1, index: i, theta: Utils.lastTheta)) 89 | } 90 | return answer 91 | } 92 | for i in 0...RawTemplates.count-1{ 93 | var l = 0.0 94 | var curTemp = [CGPoint]() 95 | curTemp.append(contentsOf: points) 96 | var t=0 97 | while (l 0.8){ 124 | answer.append(Result(score: score, index: i, theta: Utils.lastTheta)) 125 | } 126 | } 127 | 128 | return answer 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Recognizer.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Recognizer.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class Recognizer 12 | { 13 | // 14 | // Recognizer class constants 15 | // 16 | public static let NumPoints = 16 17 | public static let SquareSize = 180.0 18 | let HalfDiagonal = 0.5 * sqrt(2*SquareSize*SquareSize) 19 | let AngleRange = 45.0 20 | let AnglePrecision = 2.0 21 | public static let Phi = 0.5 * (-1.0 + sqrt(5.0)) // Golden Ratio 22 | 23 | public var centroid = CGPoint(x: 0, y: 0) 24 | public var boundingBox = Rectangle(x: 0, y: 0, width: 0, height: 0) 25 | 26 | var bounds = [0, 0, 0, 0] 27 | 28 | var Templates = [Template]() 29 | var RawTemplates = [[CGPoint]]() 30 | 31 | init(){ 32 | loadTemplatesDefault() 33 | } 34 | 35 | func loadTemplatesDefault() { 36 | for i in 0...2 { 37 | Templates.append(loadTemplate(array: TemplateData.DataRight[i])) 38 | } 39 | } 40 | 41 | func loadTemplate(array: [Double]) -> Template { 42 | return Template(points: loadArray(array: array)); 43 | } 44 | 45 | func loadArray(array: [Double]) -> [CGPoint] { 46 | var v = [CGPoint]() 47 | for i in 0...array.count-1{ 48 | if (i%2==0){ 49 | let p = CGPoint(x: array[i], y:array[i+1]); 50 | v.append(p); 51 | } 52 | } 53 | RawTemplates.append(v) 54 | return v 55 | } 56 | 57 | public func Recognize(points: [CGPoint]) -> Result { 58 | var points2 = Utils.Resample(points: points, n: Recognizer.NumPoints) 59 | points2 = Utils.ScaleToSquare(points: points2, size: Recognizer.SquareSize) 60 | points2 = Utils.TranslateToOrigin(points: points2) 61 | bounds[0] = Int(boundingBox.X) 62 | bounds[1] = Int(boundingBox.Y) 63 | bounds[2] = Int(boundingBox.X + boundingBox.Width) 64 | bounds[3] = Int(boundingBox.Y + boundingBox.Height) 65 | 66 | var t = 0 67 | 68 | var b = Double.greatestFiniteMagnitude 69 | for i in 0...Templates.count-1{ 70 | let d = Utils.DistanceAtBestAngle(points: points2, T: Templates[i], a: -AngleRange, b: AngleRange, threshold: AnglePrecision) 71 | if (d < b) { 72 | b = d 73 | t = i 74 | } 75 | } 76 | let score = 1.0 - (b / HalfDiagonal) 77 | return Result(score: score, index: t, theta: Utils.lastTheta) 78 | } 79 | 80 | public func Predict(points: [CGPoint]) -> [Result] { 81 | var answer = [Result]() 82 | var length = 0.0 83 | for i in 1...points.count-1{ 84 | length += Utils.Distance(p1: points[i-1], p2: points[i]) 85 | } 86 | if (length == 0) { 87 | for i in 0...RawTemplates.count-1{ 88 | answer.append(Result(score: 1, index: i, theta: Utils.lastTheta)) 89 | } 90 | return answer 91 | } 92 | for i in 0...RawTemplates.count-1{ 93 | var l = 0.0 94 | var curTemp = [CGPoint]() 95 | curTemp.append(contentsOf: points) 96 | var t=0 97 | while (l 0.8){ 124 | answer.append(Result(score: score, index: i, theta: Utils.lastTheta)) 125 | } 126 | } 127 | 128 | return answer 129 | } 130 | } 131 | 132 | -------------------------------------------------------------------------------- /Example/FoodTracker/FoodTracker/RatingControl.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RatingControl.swift 3 | // FoodTracker 4 | // 5 | // Created by Jane Appleseed on 11/2/16. 6 | // Copyright © 2016 Apple Inc. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @IBDesignable class RatingControl: UIStackView { 12 | 13 | //MARK: Properties 14 | 15 | private var ratingButtons = [UIButton]() 16 | 17 | var rating = 0 { 18 | didSet { 19 | updateButtonSelectionStates() 20 | } 21 | } 22 | 23 | @IBInspectable var starSize: CGSize = CGSize(width: 44.0, height: 44.0) { 24 | didSet { 25 | setupButtons() 26 | } 27 | } 28 | 29 | @IBInspectable var starCount: Int = 5 { 30 | didSet { 31 | setupButtons() 32 | } 33 | } 34 | 35 | //MARK: Initialization 36 | 37 | override init(frame: CGRect) { 38 | super.init(frame: frame) 39 | setupButtons() 40 | } 41 | 42 | required init(coder: NSCoder) { 43 | super.init(coder: coder) 44 | setupButtons() 45 | } 46 | 47 | //MARK: Button Action 48 | 49 | func ratingButtonTapped(button: UIButton) { 50 | guard let index = ratingButtons.index(of: button) else { 51 | fatalError("The button, \(button), is not in the ratingButtons array: \(ratingButtons)") 52 | } 53 | 54 | // Calculate the rating of the selected button 55 | let selectedRating = index + 1 56 | 57 | if selectedRating == rating { 58 | // If the selected star represents the current rating, reset the rating to 0. 59 | rating = 0 60 | } else { 61 | // Otherwise set the rating to the selected star 62 | rating = selectedRating 63 | } 64 | } 65 | 66 | 67 | //MARK: Private Methods 68 | 69 | private func setupButtons() { 70 | 71 | // Clear any existing buttons 72 | for button in ratingButtons { 73 | removeArrangedSubview(button) 74 | button.removeFromSuperview() 75 | } 76 | ratingButtons.removeAll() 77 | 78 | // Load Button Images 79 | let bundle = Bundle(for: type(of: self)) 80 | let filledStar = UIImage(named: "filledStar", in: bundle, compatibleWith: self.traitCollection) 81 | let emptyStar = UIImage(named:"emptyStar", in: bundle, compatibleWith: self.traitCollection) 82 | let highlightedStar = UIImage(named:"highlightedStar", in: bundle, compatibleWith: self.traitCollection) 83 | 84 | for index in 0.. Bool { 52 | // Hide the keyboard. 53 | textField.resignFirstResponder() 54 | return true 55 | } 56 | 57 | func textFieldDidEndEditing(_ textField: UITextField) { 58 | updateSaveButtonState() 59 | navigationItem.title = textField.text 60 | } 61 | 62 | //MARK: UIImagePickerControllerDelegate 63 | func imagePickerControllerDidCancel(_ picker: UIImagePickerController) { 64 | // Dismiss the picker if the user canceled. 65 | dismiss(animated: true, completion: nil) 66 | } 67 | 68 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 69 | 70 | // The info dictionary may contain multiple representations of the image. You want to use the original. 71 | guard let selectedImage = info[UIImagePickerControllerOriginalImage] as? UIImage else { 72 | fatalError("Expected a dictionary containing an image, but was provided the following: \(info)") 73 | } 74 | 75 | // Set photoImageView to display the selected image. 76 | photoImageView.image = selectedImage 77 | 78 | // Dismiss the picker. 79 | dismiss(animated: true, completion: nil) 80 | } 81 | 82 | //MARK: Navigation 83 | 84 | @IBAction func cancel(_ sender: UIBarButtonItem) { 85 | // Depending on style of presentation (modal or push presentation), this view controller needs to be dismissed in two different ways. 86 | let isPresentingInAddMealMode = presentingViewController is UINavigationController 87 | 88 | if isPresentingInAddMealMode { 89 | dismiss(animated: true, completion: nil) 90 | } 91 | else if let owningNavigationController = navigationController{ 92 | owningNavigationController.popViewController(animated: true) 93 | } 94 | else { 95 | fatalError("The MealViewController is not inside a navigation controller.") 96 | } 97 | } 98 | 99 | // This method lets you configure a view controller before it's presented. 100 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 101 | 102 | super.prepare(for: segue, sender: sender) 103 | 104 | // Configure the destination view controller only when the save button is pressed. 105 | guard let button = sender as? UIBarButtonItem, button === saveButton else { 106 | os_log("The save button was not pressed, cancelling", log: OSLog.default, type: .debug) 107 | return 108 | } 109 | 110 | let name = nameTextField.text ?? "" 111 | let photo = photoImageView.image 112 | let rating = ratingControl.rating 113 | 114 | // Set the meal to be passed to MealTableViewController after the unwind segue. 115 | meal = Meal(name: name, photo: photo, rating: rating) 116 | } 117 | 118 | //MARK: Actions 119 | @IBAction func selectImageFromPhotoLibrary(_ sender: UITapGestureRecognizer) { 120 | 121 | // Hide the keyboard. 122 | nameTextField.resignFirstResponder() 123 | 124 | // UIImagePickerController is a view controller that lets a user pick media from their photo library. 125 | let imagePickerController = UIImagePickerController() 126 | 127 | // Only allow photos to be picked, not taken. 128 | imagePickerController.sourceType = .photoLibrary 129 | 130 | // Make sure ViewController is notified when the user picks an image. 131 | imagePickerController.delegate = self 132 | present(imagePickerController, animated: true, completion: nil) 133 | } 134 | 135 | //MARK: Private Methods 136 | 137 | private func updateSaveButtonState() { 138 | // Disable the Save button if the text field is empty. 139 | let text = nameTextField.text ?? "" 140 | saveButton.isEnabled = !text.isEmpty 141 | } 142 | 143 | } 144 | 145 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 12 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 13 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 14 | 15 | case "${TARGETED_DEVICE_FAMILY}" in 16 | 1,2) 17 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 18 | ;; 19 | 1) 20 | TARGET_DEVICE_ARGS="--target-device iphone" 21 | ;; 22 | 2) 23 | TARGET_DEVICE_ARGS="--target-device ipad" 24 | ;; 25 | 3) 26 | TARGET_DEVICE_ARGS="--target-device tv" 27 | ;; 28 | 4) 29 | TARGET_DEVICE_ARGS="--target-device watch" 30 | ;; 31 | *) 32 | TARGET_DEVICE_ARGS="--target-device mac" 33 | ;; 34 | esac 35 | 36 | install_resource() 37 | { 38 | if [[ "$1" = /* ]] ; then 39 | RESOURCE_PATH="$1" 40 | else 41 | RESOURCE_PATH="${PODS_ROOT}/$1" 42 | fi 43 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 44 | cat << EOM 45 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 46 | EOM 47 | exit 1 48 | fi 49 | case $RESOURCE_PATH in 50 | *.storyboard) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.xib) 55 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 56 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 57 | ;; 58 | *.framework) 59 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 60 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 61 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 62 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 63 | ;; 64 | *.xcdatamodel) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 67 | ;; 68 | *.xcdatamodeld) 69 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 70 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 71 | ;; 72 | *.xcmappingmodel) 73 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 74 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 75 | ;; 76 | *.xcassets) 77 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 78 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 79 | ;; 80 | *) 81 | echo "$RESOURCE_PATH" || true 82 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 83 | ;; 84 | esac 85 | } 86 | 87 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 89 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 90 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 91 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 92 | fi 93 | rm -f "$RESOURCES_TO_COPY" 94 | 95 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 96 | then 97 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 98 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 99 | while read line; do 100 | if [[ $line != "${PODS_ROOT}*" ]]; then 101 | XCASSET_FILES+=("$line") 102 | fi 103 | done <<<"$OTHER_XCASSETS" 104 | 105 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 106 | fi 107 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTrackerTests/Pods-FoodTrackerTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 71 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 85 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 86 | else 87 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 136 | wait 137 | fi 138 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # Used as a return value for each invocation of `strip_invalid_archs` function. 10 | STRIP_BINARY_RETVAL=0 11 | 12 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 13 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 14 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 15 | 16 | # Copies and strips a vendored framework 17 | install_framework() 18 | { 19 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 20 | local source="${BUILT_PRODUCTS_DIR}/$1" 21 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 22 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 23 | elif [ -r "$1" ]; then 24 | local source="$1" 25 | fi 26 | 27 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 28 | 29 | if [ -L "${source}" ]; then 30 | echo "Symlinked..." 31 | source="$(readlink "${source}")" 32 | fi 33 | 34 | # Use filter instead of exclude so missing patterns don't throw errors. 35 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 36 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 37 | 38 | local basename 39 | basename="$(basename -s .framework "$1")" 40 | binary="${destination}/${basename}.framework/${basename}" 41 | if ! [ -r "$binary" ]; then 42 | binary="${destination}/${basename}" 43 | fi 44 | 45 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 46 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 47 | strip_invalid_archs "$binary" 48 | fi 49 | 50 | # Resign the code if required by the build settings to avoid unstable apps 51 | code_sign_if_enabled "${destination}/$(basename "$1")" 52 | 53 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 54 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 55 | local swift_runtime_libs 56 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 57 | for lib in $swift_runtime_libs; do 58 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 59 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 60 | code_sign_if_enabled "${destination}/${lib}" 61 | done 62 | fi 63 | } 64 | 65 | # Copies and strips a vendored dSYM 66 | install_dsym() { 67 | local source="$1" 68 | if [ -r "$source" ]; then 69 | # Copy the dSYM into a the targets temp dir. 70 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 71 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 72 | 73 | local basename 74 | basename="$(basename -s .framework.dSYM "$source")" 75 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 76 | 77 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 78 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 79 | strip_invalid_archs "$binary" 80 | fi 81 | 82 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 83 | # Move the stripped file into its final destination. 84 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 85 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 86 | else 87 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 88 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 89 | fi 90 | fi 91 | } 92 | 93 | # Signs a framework with the provided identity 94 | code_sign_if_enabled() { 95 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 96 | # Use the current code_sign_identitiy 97 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 98 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 99 | 100 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 101 | code_sign_cmd="$code_sign_cmd &" 102 | fi 103 | echo "$code_sign_cmd" 104 | eval "$code_sign_cmd" 105 | fi 106 | } 107 | 108 | # Strip invalid architectures 109 | strip_invalid_archs() { 110 | binary="$1" 111 | # Get architectures for current target binary 112 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 113 | # Intersect them with the architectures we are building for 114 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 115 | # If there are no archs supported by this binary then warn the user 116 | if [[ -z "$intersected_archs" ]]; then 117 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 118 | STRIP_BINARY_RETVAL=0 119 | return 120 | fi 121 | stripped="" 122 | for arch in $binary_archs; do 123 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 124 | # Strip non-valid architectures in-place 125 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 126 | stripped="$stripped $arch" 127 | fi 128 | done 129 | if [[ "$stripped" ]]; then 130 | echo "Stripped $binary of architectures:$stripped" 131 | fi 132 | STRIP_BINARY_RETVAL=1 133 | } 134 | 135 | 136 | if [[ "$CONFIGURATION" == "Debug" ]]; then 137 | install_framework "${BUILT_PRODUCTS_DIR}/iOSGesturizer/iOSGesturizer.framework" 138 | fi 139 | if [[ "$CONFIGURATION" == "Release" ]]; then 140 | install_framework "${BUILT_PRODUCTS_DIR}/iOSGesturizer/iOSGesturizer.framework" 141 | fi 142 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 143 | wait 144 | fi 145 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GesturizerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Gesturizer.swift 3 | // Gesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public class GesturizerView: UIImageView { 12 | // MARK: Constants 13 | 14 | static let TRAINING_MODE_ACTIVATION_TIME = 1.0 15 | static let DEFAULT_TOUCH_PRESSURE = 0.8 16 | static let DEFAULT_BRUSH_SIZE: CGFloat = 10.0 17 | static let DEFAULT_OPACITY: CGFloat = 1.0 18 | static let DEFAULT_COLORS = [ 19 | UIColor(red: 186.0/255, green: 34.0/255, blue: 34.0/255, alpha: 1.0), 20 | UIColor(red: 27.0/255, green: 149.0/255, blue: 27.0/255, alpha: 1.0), 21 | UIColor(red: 24.0/255, green: 14.0/255, blue: 197.0/255, alpha: 1.0) 22 | ] 23 | 24 | // MARK: Properties 25 | public var gestureHandler: (_ index: Int) -> () = {_ in 26 | print(index) 27 | } 28 | var brushSize: CGFloat = DEFAULT_BRUSH_SIZE 29 | var colors: [UIColor] = DEFAULT_COLORS 30 | var dollar = Dollar() 31 | public var names: [String] = ["Cut", "Copy", "Paste"] 32 | var timer = Timer() 33 | var time = 0.0 34 | 35 | var lastPoint = CGPoint.zero // Last point touched 36 | var lastPointForce = CGPoint.zero // First point touched with force 37 | 38 | var userPathForce = [CGPoint]() // Touch path with force 39 | var forceTouch = false 40 | 41 | // MARK: Constructors 42 | 43 | public init() { 44 | super.init(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)) 45 | timer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(runTimedCode), userInfo: nil, repeats: true) 46 | } 47 | 48 | required public init?(coder aDecoder: NSCoder) { 49 | super.init(coder: aDecoder) 50 | } 51 | 52 | // MARK: Methods 53 | 54 | func touchesBegan(_ touches: Set) { 55 | if let touch = touches.first { // If touches just began 56 | lastPoint = touch.location(in: self) 57 | } 58 | } 59 | 60 | func touchesMoved(_ touches: Set) { 61 | 62 | if let touch = touches.first { 63 | let currentPoint = touch.location(in: self) 64 | if (touch.force/touch.maximumPossibleForce > 0.5 || userPathForce.count > 0){ 65 | if (!forceTouch) { 66 | userPathForce.removeAll() 67 | dollar.clear() 68 | forceTouch = true 69 | let generator = UIImpactFeedbackGenerator(style: .medium) 70 | generator.impactOccurred() 71 | } 72 | dollar.addPoint(x: Int(currentPoint.x), y: Int(currentPoint.y)) 73 | if (lastPointForce == CGPoint.zero){ 74 | lastPointForce = currentPoint 75 | } 76 | 77 | if (dollar.points.count > 1){ 78 | self.image = nil 79 | for view in self.subviews{ 80 | view.removeFromSuperview() 81 | } 82 | let results = dollar.predict() 83 | if (results.count > 0) { 84 | for i in 0...results.count-1{ 85 | let res = results[i] 86 | let curColor = colors[res.Index] 87 | let points = dollar.recognizer.RawTemplates[res.Index] 88 | if (time > GesturizerView.TRAINING_MODE_ACTIVATION_TIME) { 89 | drawPoints(points, text: names[res.Index], color:curColor, strokeSize: self.brushSize*CGFloat(res.Score)*CGFloat(res.Score)) 90 | } 91 | } 92 | } 93 | } 94 | userPathForce.append(currentPoint) 95 | }else{ 96 | forceTouch = false 97 | self.image = nil 98 | lastPoint = CGPoint.zero 99 | lastPointForce = CGPoint.zero 100 | } 101 | lastPoint = currentPoint 102 | } 103 | } 104 | func touchesEnded(_ touches: Set) { 105 | self.image = nil 106 | for view in self.subviews{ 107 | view.removeFromSuperview() 108 | } 109 | dollar.recognize() 110 | let res = dollar.result 111 | if (res.Score as Double! > 0.8) { 112 | self.gestureHandler(res.Index) 113 | } else { 114 | 115 | } 116 | userPathForce.removeAll() 117 | dollar.clear() 118 | lastPoint = CGPoint.zero 119 | lastPointForce = CGPoint.zero 120 | } 121 | func drawPoints(_ points: [CGPoint], text: String, color: UIColor, strokeSize: CGFloat){ 122 | UIGraphicsBeginImageContext(self.frame.size) 123 | self.image?.draw(in: CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)) 124 | let context = UIGraphicsGetCurrentContext() 125 | let deltaX = points[0].x - lastPointForce.x 126 | let deltaY = points[0].y - lastPointForce.y 127 | var length = 0.0 128 | if (userPathForce.count > 1){ 129 | for i in 1...userPathForce.count-1{ 130 | length += Utils.Distance(p1: userPathForce[i-1], p2: userPathForce[i]) 131 | } 132 | } 133 | 134 | var l = 0.0 135 | var t = 1 136 | while (l < length && t () = {_ in 26 | print(index) 27 | } 28 | var brushSize: CGFloat = DEFAULT_BRUSH_SIZE 29 | var colors: [UIColor] = DEFAULT_COLORS 30 | var dollar = Dollar() 31 | public var names: [String] = ["Cut", "Copy", "Paste"] 32 | var timer = Timer() 33 | var time = 0.0 34 | 35 | var lastPoint = CGPoint.zero // Last point touched 36 | var lastPointForce = CGPoint.zero // First point touched with force 37 | 38 | var userPathForce = [CGPoint]() // Touch path with force 39 | var forceTouch = false 40 | 41 | // MARK: Constructors 42 | 43 | public init() { 44 | super.init(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)) 45 | timer = Timer.scheduledTimer(timeInterval: 0.01, target: self, selector: #selector(runTimedCode), userInfo: nil, repeats: true) 46 | } 47 | 48 | required public init?(coder aDecoder: NSCoder) { 49 | super.init(coder: aDecoder) 50 | } 51 | 52 | // MARK: Methods 53 | 54 | func touchesBegan(_ touches: Set) { 55 | if let touch = touches.first { // If touches just began 56 | lastPoint = touch.location(in: self) 57 | } 58 | } 59 | 60 | func touchesMoved(_ touches: Set) { 61 | 62 | if let touch = touches.first { 63 | let currentPoint = touch.location(in: self) 64 | if (touch.force/touch.maximumPossibleForce > 0.5 || userPathForce.count > 0){ 65 | if (!forceTouch) { 66 | userPathForce.removeAll() 67 | dollar.clear() 68 | forceTouch = true 69 | if #available(iOS 10.0, *) { 70 | let generator = UIImpactFeedbackGenerator(style: .medium) 71 | generator.impactOccurred() 72 | } else { 73 | // Fallback on earlier versions 74 | } 75 | } 76 | dollar.addPoint(x: Int(currentPoint.x), y: Int(currentPoint.y)) 77 | if (lastPointForce == CGPoint.zero){ 78 | lastPointForce = currentPoint 79 | } 80 | 81 | if (dollar.points.count > 1){ 82 | self.image = nil 83 | for view in self.subviews{ 84 | view.removeFromSuperview() 85 | } 86 | let results = dollar.predict() 87 | if (results.count > 0) { 88 | for i in 0...results.count-1{ 89 | let res = results[i] 90 | let curColor = colors[res.Index] 91 | let points = dollar.recognizer.RawTemplates[res.Index] 92 | if (time > GesturizerView.TRAINING_MODE_ACTIVATION_TIME) { 93 | drawPoints(points, text: names[res.Index], color:curColor, strokeSize: self.brushSize*CGFloat(res.Score)*CGFloat(res.Score)) 94 | } 95 | } 96 | } 97 | } 98 | userPathForce.append(currentPoint) 99 | }else{ 100 | forceTouch = false 101 | self.image = nil 102 | lastPoint = CGPoint.zero 103 | lastPointForce = CGPoint.zero 104 | } 105 | lastPoint = currentPoint 106 | } 107 | } 108 | func touchesEnded(_ touches: Set) { 109 | self.image = nil 110 | for view in self.subviews{ 111 | view.removeFromSuperview() 112 | } 113 | dollar.recognize() 114 | let res = dollar.result 115 | if (res.Score as Double! > 0.8) { 116 | self.gestureHandler(res.Index) 117 | } else { 118 | 119 | } 120 | userPathForce.removeAll() 121 | dollar.clear() 122 | lastPoint = CGPoint.zero 123 | lastPointForce = CGPoint.zero 124 | } 125 | func drawPoints(_ points: [CGPoint], text: String, color: UIColor, strokeSize: CGFloat){ 126 | UIGraphicsBeginImageContext(self.frame.size) 127 | self.image?.draw(in: CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height)) 128 | let context = UIGraphicsGetCurrentContext() 129 | let deltaX = points[0].x - lastPointForce.x 130 | let deltaY = points[0].y - lastPointForce.y 131 | var length = 0.0 132 | if (userPathForce.count > 1){ 133 | for i in 1...userPathForce.count-1{ 134 | length += Utils.Distance(p1: userPathForce[i-1], p2: userPathForce[i]) 135 | } 136 | } 137 | 138 | var l = 0.0 139 | var t = 1 140 | while (l < length && t Int { 56 | return 1 57 | } 58 | 59 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 60 | return meals.count 61 | } 62 | 63 | 64 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 65 | 66 | // Table view cells are reused and should be dequeued using a cell identifier. 67 | let cellIdentifier = "MealTableViewCell" 68 | 69 | guard let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as? MealTableViewCell else { 70 | fatalError("The dequeued cell is not an instance of MealTableViewCell.") 71 | } 72 | 73 | // Fetches the appropriate meal for the data source layout. 74 | let meal = meals[indexPath.row] 75 | 76 | cell.nameLabel.text = meal.name 77 | cell.photoImageView.image = meal.photo 78 | cell.ratingControl.rating = meal.rating 79 | 80 | return cell 81 | } 82 | 83 | 84 | 85 | // Override to support conditional editing of the table view. 86 | override func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool { 87 | // Return false if you do not want the specified item to be editable. 88 | return true 89 | } 90 | 91 | 92 | 93 | // Override to support editing the table view. 94 | override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) { 95 | if editingStyle == .delete { 96 | // Delete the row from the data source 97 | meals.remove(at: indexPath.row) 98 | saveMeals() 99 | tableView.deleteRows(at: [indexPath], with: .fade) 100 | } else if editingStyle == .insert { 101 | // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view 102 | } 103 | } 104 | 105 | 106 | /* 107 | // Override to support rearranging the table view. 108 | override func tableView(_ tableView: UITableView, moveRowAt fromIndexPath: IndexPath, to: IndexPath) { 109 | 110 | } 111 | */ 112 | 113 | /* 114 | // Override to support conditional rearranging of the table view. 115 | override func tableView(_ tableView: UITableView, canMoveRowAt indexPath: IndexPath) -> Bool { 116 | // Return false if you do not want the item to be re-orderable. 117 | return true 118 | } 119 | */ 120 | 121 | 122 | //MARK: - Navigation 123 | 124 | // In a storyboard-based application, you will often want to do a little preparation before navigation 125 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 126 | 127 | super.prepare(for: segue, sender: sender) 128 | 129 | switch(segue.identifier ?? "") { 130 | 131 | case "AddItem": 132 | os_log("Adding a new meal.", log: OSLog.default, type: .debug) 133 | 134 | case "ShowDetail": 135 | guard let mealDetailViewController = segue.destination as? MealViewController else { 136 | fatalError("Unexpected destination: \(segue.destination)") 137 | } 138 | 139 | guard let selectedMealCell = sender as? MealTableViewCell else { 140 | fatalError("Unexpected sender: \(sender)") 141 | } 142 | 143 | guard let indexPath = tableView.indexPath(for: selectedMealCell) else { 144 | fatalError("The selected cell is not being displayed by the table") 145 | } 146 | 147 | let selectedMeal = meals[indexPath.row] 148 | mealDetailViewController.meal = selectedMeal 149 | 150 | default: 151 | fatalError("Unexpected Segue Identifier; \(segue.identifier)") 152 | } 153 | } 154 | 155 | 156 | //MARK: Actions 157 | 158 | @IBAction func unwindToMealList(sender: UIStoryboardSegue) { 159 | if let sourceViewController = sender.source as? MealViewController, let meal = sourceViewController.meal { 160 | 161 | if let selectedIndexPath = tableView.indexPathForSelectedRow { 162 | // Update an existing meal. 163 | meals[selectedIndexPath.row] = meal 164 | tableView.reloadRows(at: [selectedIndexPath], with: .none) 165 | } 166 | else { 167 | // Add a new meal. 168 | let newIndexPath = IndexPath(row: meals.count, section: 0) 169 | 170 | meals.append(meal) 171 | tableView.insertRows(at: [newIndexPath], with: .automatic) 172 | } 173 | 174 | // Save the meals. 175 | saveMeals() 176 | } 177 | } 178 | 179 | //MARK: Private Methods 180 | 181 | private func loadSampleMeals() { 182 | 183 | let photo1 = UIImage(named: "meal1") 184 | let photo2 = UIImage(named: "meal2") 185 | let photo3 = UIImage(named: "meal3") 186 | 187 | guard let meal1 = Meal(name: "Caprese Salad", photo: photo1, rating: 4) else { 188 | fatalError("Unable to instantiate meal1") 189 | } 190 | 191 | guard let meal2 = Meal(name: "Chicken and Potatoes", photo: photo2, rating: 5) else { 192 | fatalError("Unable to instantiate meal2") 193 | } 194 | 195 | guard let meal3 = Meal(name: "Pasta with Meatballs", photo: photo3, rating: 3) else { 196 | fatalError("Unable to instantiate meal2") 197 | } 198 | 199 | meals += [meal1, meal2, meal3] 200 | } 201 | 202 | private func saveMeals() { 203 | let isSuccessfulSave = NSKeyedArchiver.archiveRootObject(meals, toFile: Meal.ArchiveURL.path) 204 | if isSuccessfulSave { 205 | os_log("Meals successfully saved.", log: OSLog.default, type: .debug) 206 | } else { 207 | os_log("Failed to save meals...", log: OSLog.default, type: .error) 208 | } 209 | } 210 | 211 | private func loadMeals() -> [Meal]? { 212 | return NSKeyedUnarchiver.unarchiveObject(withFile: Meal.ArchiveURL.path) as? [Meal] 213 | } 214 | 215 | } 216 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/TemplateData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateData.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import Foundation 12 | 13 | public class TemplateData 14 | { 15 | // Template data for RIGHT handed users 16 | public static let DataRight = [ 17 | [337.0,172.0, 333.0,172.0, 329.0,172.0, 325.0,172.0, 321.0,172.0, 317.0,172.0, 313.0,172.0, 309.0,172.0, 305.0,172.0, 301.0,172.0, 297.0,172.0, 293.0,172.0, 289.0,172.0, 285.0,172.0, 281.0,172.0, 277.0,172.0, 273.0,172.0, 269.0,172.0, 265.0,172.0, 261.0,172.0, 257.0,172.0, 253.0,172.0, 249.0,172.0, 245.0,172.0, 241.0,172.0, 237.0,172.0, 235.0,172.0, 235.0,169.41176470588235, 235.0,166.8235294117647, 235.0,164.23529411764707, 235.0,161.64705882352942, 235.0,159.05882352941177, 235.0,156.47058823529412, 235.0,153.88235294117646, 235.0,151.2941176470588, 235.0,148.70588235294116, 235.0,146.11764705882354, 235.0,143.52941176470588, 235.0,140.94117647058823, 235.0,138.35294117647058, 235.0,135.76470588235293, 235.0,133.1764705882353, 235.0,130.58823529411765, 235.0,128.0, 235.0,125.41176470588235, 235.0,122.8235294117647, 235.0,120.23529411764706, 235.0,117.6470588235294, 235.0,115.05882352941177, 235.0,112.47058823529412, 235.0,109.88235294117646, 235.0,107.29411764705883], 18 | [337.0,189.0, 334.3529411764706,186.66666666666666, 331.70588235294116,184.33333333333334, 329.05882352941177,182.0, 326.4117647058824,179.66666666666666, 323.7647058823529,177.33333333333334, 321.11764705882354,175.0, 318.47058823529414,172.66666666666666, 315.8235294117647,170.33333333333334, 313.1764705882353,168.0, 310.52941176470586,165.66666666666666, 307.88235294117646,163.33333333333334, 305.2352941176471,161.0, 302.5882352941176,158.66666666666666, 299.94117647058823,156.33333333333331, 297.29411764705884,154.0, 294.6470588235294,151.66666666666666, 292.0,149.33333333333331, 289.3529411764706,147.0, 286.70588235294116,144.66666666666666, 284.05882352941177,142.33333333333331, 281.4117647058824,140.0, 278.7647058823529,137.66666666666666, 276.11764705882354,135.33333333333331, 273.47058823529414,133.0, 270.8235294117647,130.66666666666666, 268.1764705882353,129.5, 265.52941176470586,131.83333333333334, 262.88235294117646,134.16666666666666, 260.2352941176471,136.5, 257.5882352941177,138.83333333333334, 254.94117647058823,141.16666666666666, 252.29411764705884,143.5, 249.64705882352942,145.83333333333334, 247.0,148.16666666666666, 244.3529411764706,150.5, 241.70588235294116,152.83333333333334, 239.05882352941177,155.16666666666666, 236.41176470588238,157.5, 233.76470588235293,159.83333333333334, 231.11764705882354,162.16666666666669, 228.47058823529412,164.5, 225.8235294117647,166.83333333333334, 223.1764705882353,169.16666666666669, 220.52941176470588,171.5, 217.88235294117646,173.83333333333334, 215.23529411764707,176.16666666666669, 212.58823529411765,178.5, 209.94117647058823,180.83333333333334, 207.29411764705884,183.16666666666669, 204.64705882352942,185.5, 202.0,187.83333333333334], 19 | [336.499954223633, 183.499923706055, 336.499954223633, 183.499923706055, 336.499954223633, 183.499923706055, 336.499954223633, 175.999923706055, 336.499954223633, 173.499923706055, 336.499954223633, 168.999923706055, 336.499938964844, 162.999923706055, 336.499938964844, 156.999923706055, 336.499938964844, 150.499923706055, 336.499938964844, 143.999923706055, 335.999938964844, 136.999923706055, 334.499938964844, 131.999923706055, 332.499938964844, 127.499923706055, 330.499938964844, 122.999923706055, 327.499938964844, 117.999923706055, 323.999938964844, 112.999923706055, 318.999938964844, 106.999938964844, 314.999938964844, 101.499938964844, 310.499938964844, 96.4999389648438, 305.999938964844, 91.4999389648438, 300.499938964844, 86.9999389648438, 295.499938964844, 82.4999389648438, 289.999938964844, 78.9999389648438, 284.499938964844, 75.9999389648438, 278.499938964844, 73.4999389648438, 272.499938964844, 71.4999389648438, 266.499938964844, 69.9999389648438, 260.999938964844, 68.9999389648438, 255.499938964844, 68.4999389648438, 250.499938964844, 68.4999389648438, 246.999938964844, 68.4999389648438, 244.499938964844, 68.4999389648438, 241.999938964844, 68.4999389648438, 239.999938964844, 68.4999389648438, 238.999938964844, 68.4999542236328, 237.999938964844, 68.4999542236328, 237.499938964844, 68.4999542236328, 236.499954223633, 68.4999542236328, 236.499954223633, 68.4999542236328, 236.499938964844, 67.9999542236328, 236.499938964844, 67.9999542236328, 236.499938964844, 67.9999542236328]] 20 | // Template data for LEFT handed users 21 | public static let DataLeft = [ [38.0,172.0,42.0,172.0,46.0,172.0,50.0,172.0,54.0,172.0,58.0,172.0,62.0,172.0,66.0,172.0,70.0,172.0,74.0,172.0,78.0,172.0,82.0,172.0,86.0,172.0,90.0,172.0,94.0,172.0,98.0,172.0,102.0,172.0,106.0,172.0,110.0,172.0,114.0,172.0,118.0,172.0,122.0,172.0,126.0,172.0,130.0,172.0,134.0,172.0,138.0,172.0,140.0,172.0,140.0,169.41176470588235,140.0,166.8235294117647,140.0,164.23529411764707,140.0,161.64705882352942,140.0,159.05882352941177,140.0,156.47058823529412,140.0,153.88235294117646,140.0,151.2941176470588,140.0,148.70588235294116,140.0,146.11764705882354,140.0,143.52941176470588,140.0,140.94117647058823,140.0,138.35294117647058,140.0,135.76470588235293,140.0,133.1764705882353,140.0,130.58823529411765,140.0,128.0,140.0,125.41176470588235,140.0,122.8235294117647,140.0,120.23529411764706,140.0,117.6470588235294,140.0,115.05882352941177,140.0,112.47058823529412,140.0,109.88235294117646,140.0,107.29411764705883,], 22 | [38.0,189.0,40.64705882352939,186.66666666666666,43.29411764705884,184.33333333333334,45.94117647058823,182.0,48.588235294117624,179.66666666666666,51.23529411764707,177.33333333333334,53.882352941176464,175.0,56.529411764705856,172.66666666666666,59.176470588235304,170.33333333333334,61.823529411764696,168.0,64.47058823529414,165.66666666666666,67.11764705882354,163.33333333333334,69.76470588235293,161.0,72.41176470588238,158.66666666666666,75.05882352941177,156.33333333333331,77.70588235294116,154.0,80.35294117647061,151.66666666666666,83.0,149.33333333333331,85.64705882352939,147.0,88.29411764705884,144.66666666666666,90.94117647058823,142.33333333333331,93.58823529411762,140.0,96.23529411764707,137.66666666666666,98.88235294117646,135.33333333333331,101.52941176470586,133.0,104.1764705882353,130.66666666666666,106.8235294117647,129.5,109.47058823529414,131.83333333333334,112.11764705882354,134.16666666666666,114.76470588235293,136.5,117.41176470588232,138.83333333333334,120.05882352941177,141.16666666666666,122.70588235294116,143.5,125.35294117647058,145.83333333333334,128.0,148.16666666666666,130.6470588235294,150.5,133.29411764705884,152.83333333333334,135.94117647058823,155.16666666666666,138.58823529411762,157.5,141.23529411764707,159.83333333333334,143.88235294117646,162.16666666666669,146.52941176470588,164.5,149.1764705882353,166.83333333333334,151.8235294117647,169.16666666666669,154.47058823529412,171.5,157.11764705882354,173.83333333333334,159.76470588235293,176.16666666666669,162.41176470588235,178.5,165.05882352941177,180.83333333333334,167.70588235294116,183.16666666666669,170.35294117647058,185.5,173.0,187.83333333333334,], 23 | [38.50004577636702,183.499923706055,38.50004577636702,183.499923706055,38.50004577636702,183.499923706055,38.50004577636702,175.999923706055,38.50004577636702,173.499923706055,38.50004577636702,168.999923706055,38.50006103515602,162.999923706055,38.50006103515602,156.999923706055,38.50006103515602,150.499923706055,38.50006103515602,143.999923706055,39.00006103515602,136.999923706055,40.50006103515602,131.999923706055,42.50006103515602,127.499923706055,44.50006103515602,122.999923706055,47.50006103515602,117.999923706055,51.00006103515602,112.999923706055,56.00006103515602,106.999938964844,60.00006103515602,101.499938964844,64.50006103515602,96.4999389648438,69.00006103515602,91.4999389648438,74.50006103515602,86.9999389648438,79.50006103515602,82.4999389648438,85.00006103515602,78.9999389648438,90.50006103515602,75.9999389648438,96.50006103515602,73.4999389648438,102.50006103515602,71.4999389648438,108.50006103515602,69.9999389648438,114.00006103515602,68.9999389648438,119.500061035156,68.4999389648438,124.500061035156,68.4999389648438,128.000061035156,68.4999389648438,130.500061035156,68.4999389648438,133.000061035156,68.4999389648438,135.000061035156,68.4999389648438,136.000061035156,68.4999542236328,137.000061035156,68.4999542236328,137.500061035156,68.4999542236328,138.500045776367,68.4999542236328,138.500045776367,68.4999542236328,138.500061035156,67.9999542236328,138.500061035156,67.9999542236328,138.500061035156,67.9999542236328]] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/TemplateData.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TemplateData.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | import Foundation 12 | 13 | public class TemplateData 14 | { 15 | // Template data for RIGHT handed users 16 | public static let DataRight = [ 17 | [337.0,172.0, 333.0,172.0, 329.0,172.0, 325.0,172.0, 321.0,172.0, 317.0,172.0, 313.0,172.0, 309.0,172.0, 305.0,172.0, 301.0,172.0, 297.0,172.0, 293.0,172.0, 289.0,172.0, 285.0,172.0, 281.0,172.0, 277.0,172.0, 273.0,172.0, 269.0,172.0, 265.0,172.0, 261.0,172.0, 257.0,172.0, 253.0,172.0, 249.0,172.0, 245.0,172.0, 241.0,172.0, 237.0,172.0, 235.0,172.0, 235.0,169.41176470588235, 235.0,166.8235294117647, 235.0,164.23529411764707, 235.0,161.64705882352942, 235.0,159.05882352941177, 235.0,156.47058823529412, 235.0,153.88235294117646, 235.0,151.2941176470588, 235.0,148.70588235294116, 235.0,146.11764705882354, 235.0,143.52941176470588, 235.0,140.94117647058823, 235.0,138.35294117647058, 235.0,135.76470588235293, 235.0,133.1764705882353, 235.0,130.58823529411765, 235.0,128.0, 235.0,125.41176470588235, 235.0,122.8235294117647, 235.0,120.23529411764706, 235.0,117.6470588235294, 235.0,115.05882352941177, 235.0,112.47058823529412, 235.0,109.88235294117646, 235.0,107.29411764705883], 18 | [337.0,189.0, 334.3529411764706,186.66666666666666, 331.70588235294116,184.33333333333334, 329.05882352941177,182.0, 326.4117647058824,179.66666666666666, 323.7647058823529,177.33333333333334, 321.11764705882354,175.0, 318.47058823529414,172.66666666666666, 315.8235294117647,170.33333333333334, 313.1764705882353,168.0, 310.52941176470586,165.66666666666666, 307.88235294117646,163.33333333333334, 305.2352941176471,161.0, 302.5882352941176,158.66666666666666, 299.94117647058823,156.33333333333331, 297.29411764705884,154.0, 294.6470588235294,151.66666666666666, 292.0,149.33333333333331, 289.3529411764706,147.0, 286.70588235294116,144.66666666666666, 284.05882352941177,142.33333333333331, 281.4117647058824,140.0, 278.7647058823529,137.66666666666666, 276.11764705882354,135.33333333333331, 273.47058823529414,133.0, 270.8235294117647,130.66666666666666, 268.1764705882353,129.5, 265.52941176470586,131.83333333333334, 262.88235294117646,134.16666666666666, 260.2352941176471,136.5, 257.5882352941177,138.83333333333334, 254.94117647058823,141.16666666666666, 252.29411764705884,143.5, 249.64705882352942,145.83333333333334, 247.0,148.16666666666666, 244.3529411764706,150.5, 241.70588235294116,152.83333333333334, 239.05882352941177,155.16666666666666, 236.41176470588238,157.5, 233.76470588235293,159.83333333333334, 231.11764705882354,162.16666666666669, 228.47058823529412,164.5, 225.8235294117647,166.83333333333334, 223.1764705882353,169.16666666666669, 220.52941176470588,171.5, 217.88235294117646,173.83333333333334, 215.23529411764707,176.16666666666669, 212.58823529411765,178.5, 209.94117647058823,180.83333333333334, 207.29411764705884,183.16666666666669, 204.64705882352942,185.5, 202.0,187.83333333333334], 19 | [336.499954223633, 183.499923706055, 336.499954223633, 183.499923706055, 336.499954223633, 183.499923706055, 336.499954223633, 175.999923706055, 336.499954223633, 173.499923706055, 336.499954223633, 168.999923706055, 336.499938964844, 162.999923706055, 336.499938964844, 156.999923706055, 336.499938964844, 150.499923706055, 336.499938964844, 143.999923706055, 335.999938964844, 136.999923706055, 334.499938964844, 131.999923706055, 332.499938964844, 127.499923706055, 330.499938964844, 122.999923706055, 327.499938964844, 117.999923706055, 323.999938964844, 112.999923706055, 318.999938964844, 106.999938964844, 314.999938964844, 101.499938964844, 310.499938964844, 96.4999389648438, 305.999938964844, 91.4999389648438, 300.499938964844, 86.9999389648438, 295.499938964844, 82.4999389648438, 289.999938964844, 78.9999389648438, 284.499938964844, 75.9999389648438, 278.499938964844, 73.4999389648438, 272.499938964844, 71.4999389648438, 266.499938964844, 69.9999389648438, 260.999938964844, 68.9999389648438, 255.499938964844, 68.4999389648438, 250.499938964844, 68.4999389648438, 246.999938964844, 68.4999389648438, 244.499938964844, 68.4999389648438, 241.999938964844, 68.4999389648438, 239.999938964844, 68.4999389648438, 238.999938964844, 68.4999542236328, 237.999938964844, 68.4999542236328, 237.499938964844, 68.4999542236328, 236.499954223633, 68.4999542236328, 236.499954223633, 68.4999542236328, 236.499938964844, 67.9999542236328, 236.499938964844, 67.9999542236328, 236.499938964844, 67.9999542236328]] 20 | // Template data for LEFT handed users 21 | public static let DataLeft = [ [38.0,172.0,42.0,172.0,46.0,172.0,50.0,172.0,54.0,172.0,58.0,172.0,62.0,172.0,66.0,172.0,70.0,172.0,74.0,172.0,78.0,172.0,82.0,172.0,86.0,172.0,90.0,172.0,94.0,172.0,98.0,172.0,102.0,172.0,106.0,172.0,110.0,172.0,114.0,172.0,118.0,172.0,122.0,172.0,126.0,172.0,130.0,172.0,134.0,172.0,138.0,172.0,140.0,172.0,140.0,169.41176470588235,140.0,166.8235294117647,140.0,164.23529411764707,140.0,161.64705882352942,140.0,159.05882352941177,140.0,156.47058823529412,140.0,153.88235294117646,140.0,151.2941176470588,140.0,148.70588235294116,140.0,146.11764705882354,140.0,143.52941176470588,140.0,140.94117647058823,140.0,138.35294117647058,140.0,135.76470588235293,140.0,133.1764705882353,140.0,130.58823529411765,140.0,128.0,140.0,125.41176470588235,140.0,122.8235294117647,140.0,120.23529411764706,140.0,117.6470588235294,140.0,115.05882352941177,140.0,112.47058823529412,140.0,109.88235294117646,140.0,107.29411764705883,], 22 | [38.0,189.0,40.64705882352939,186.66666666666666,43.29411764705884,184.33333333333334,45.94117647058823,182.0,48.588235294117624,179.66666666666666,51.23529411764707,177.33333333333334,53.882352941176464,175.0,56.529411764705856,172.66666666666666,59.176470588235304,170.33333333333334,61.823529411764696,168.0,64.47058823529414,165.66666666666666,67.11764705882354,163.33333333333334,69.76470588235293,161.0,72.41176470588238,158.66666666666666,75.05882352941177,156.33333333333331,77.70588235294116,154.0,80.35294117647061,151.66666666666666,83.0,149.33333333333331,85.64705882352939,147.0,88.29411764705884,144.66666666666666,90.94117647058823,142.33333333333331,93.58823529411762,140.0,96.23529411764707,137.66666666666666,98.88235294117646,135.33333333333331,101.52941176470586,133.0,104.1764705882353,130.66666666666666,106.8235294117647,129.5,109.47058823529414,131.83333333333334,112.11764705882354,134.16666666666666,114.76470588235293,136.5,117.41176470588232,138.83333333333334,120.05882352941177,141.16666666666666,122.70588235294116,143.5,125.35294117647058,145.83333333333334,128.0,148.16666666666666,130.6470588235294,150.5,133.29411764705884,152.83333333333334,135.94117647058823,155.16666666666666,138.58823529411762,157.5,141.23529411764707,159.83333333333334,143.88235294117646,162.16666666666669,146.52941176470588,164.5,149.1764705882353,166.83333333333334,151.8235294117647,169.16666666666669,154.47058823529412,171.5,157.11764705882354,173.83333333333334,159.76470588235293,176.16666666666669,162.41176470588235,178.5,165.05882352941177,180.83333333333334,167.70588235294116,183.16666666666669,170.35294117647058,185.5,173.0,187.83333333333334,], 23 | [38.50004577636702,183.499923706055,38.50004577636702,183.499923706055,38.50004577636702,183.499923706055,38.50004577636702,175.999923706055,38.50004577636702,173.499923706055,38.50004577636702,168.999923706055,38.50006103515602,162.999923706055,38.50006103515602,156.999923706055,38.50006103515602,150.499923706055,38.50006103515602,143.999923706055,39.00006103515602,136.999923706055,40.50006103515602,131.999923706055,42.50006103515602,127.499923706055,44.50006103515602,122.999923706055,47.50006103515602,117.999923706055,51.00006103515602,112.999923706055,56.00006103515602,106.999938964844,60.00006103515602,101.499938964844,64.50006103515602,96.4999389648438,69.00006103515602,91.4999389648438,74.50006103515602,86.9999389648438,79.50006103515602,82.4999389648438,85.00006103515602,78.9999389648438,90.50006103515602,75.9999389648438,96.50006103515602,73.4999389648438,102.50006103515602,71.4999389648438,108.50006103515602,69.9999389648438,114.00006103515602,68.9999389648438,119.500061035156,68.4999389648438,124.500061035156,68.4999389648438,128.000061035156,68.4999389648438,130.500061035156,68.4999389648438,133.000061035156,68.4999389648438,135.000061035156,68.4999389648438,136.000061035156,68.4999542236328,137.000061035156,68.4999542236328,137.500061035156,68.4999542236328,138.500045776367,68.4999542236328,138.500045776367,68.4999542236328,138.500061035156,67.9999542236328,138.500061035156,67.9999542236328,138.500061035156,67.9999542236328]] 24 | } 25 | 26 | -------------------------------------------------------------------------------- /iOSGesturizer/iOSGesturizer/GestureRecognizer/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh Zhunussov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /* ------------------------------------------------------------------------- 12 | * 13 | * $1 Java 14 | * 15 | * This is a Java port of the $1 Gesture Recognizer by 16 | * Jacob O. Wobbrock, Andrew D. Wilson, Yang Li. 17 | * 18 | * "The $1 Unistroke Recognizer is a 2-D single-stroke recognizer designed for 19 | * rapid prototyping of gesture-based user interfaces." 20 | * 21 | * http://depts.washington.edu/aimgroup/proj/dollar/ 22 | * 23 | * Copyright (C) 2009, Alex Olwal, www.olwal.com 24 | * 25 | * $1 Java free software: you can redistribute it and/or modify 26 | * it under the terms of the GNU General Public License as published by 27 | * the Free Software Foundation, either version 3 of the License, or 28 | * (at your option) any later version. 29 | * 30 | * $1 Java is distributed in the hope that it will be useful, 31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 33 | * GNU General Public License for more details. 34 | * 35 | * You should have received a copy of the GNU General Public License 36 | * along with $1 Java. If not, see . 37 | * 38 | * ------------------------------------------------------------------------- 39 | */ 40 | 41 | public class Utils 42 | { 43 | public static var lastTheta: Double = Double(0) 44 | 45 | public static func Resample(points: [CGPoint], n: Int) -> [CGPoint]{ 46 | let I = PathLength(points: points) / Double(n - 1) 47 | var D = 0.0 48 | 49 | var srcPts = [CGPoint]() 50 | for p in points{ 51 | srcPts.append(p) 52 | } 53 | var dstPts = [CGPoint]() 54 | dstPts.append(srcPts[0]) 55 | var i = 1 56 | while (i < srcPts.count-1){ 57 | let pt1 = srcPts[i-1] 58 | let pt2 = srcPts[i] 59 | 60 | let d = Distance(p1: pt1, p2: pt2) 61 | if ((D + d) >= I) { 62 | let qx = pt1.x + CGFloat((I - D) / d) * (pt2.x - pt1.x) 63 | let qy = pt1.y + CGFloat((I - D) / d) * (pt2.y - pt1.y) 64 | let q = CGPoint (x: qx, y: qy) 65 | dstPts.append(q) 66 | srcPts.insert(q, at: i) 67 | D = 0.0 68 | } else { 69 | D += d 70 | } 71 | i+=1 72 | } 73 | // somtimes we fall a rounding-error short of adding the last point, so add it if so 74 | if (dstPts.count == n - 1) { 75 | dstPts.append(srcPts[srcPts.count - 1]) 76 | } 77 | 78 | return dstPts; 79 | } 80 | 81 | 82 | public static func RotateToZero(points: [CGPoint]) -> [CGPoint] { 83 | return RotateToZero(points: points, centroid: nil, boundingBox: nil) 84 | } 85 | 86 | 87 | public static func RotateToZero(points: [CGPoint], centroid: CGPoint?, boundingBox: Rectangle?) -> [CGPoint] { 88 | let c = Centroid(points: points) 89 | let first = points[0] 90 | let theta = atan2(c.y-first.y, c.x-first.x) 91 | var cent = centroid 92 | if (cent != nil){ 93 | cent!.x = c.x 94 | cent!.y = c.y 95 | } 96 | 97 | if (boundingBox != nil){ 98 | BoundingBox(points: points, dst: boundingBox!) 99 | } 100 | 101 | self.lastTheta = Double(theta) 102 | 103 | return RotateBy(points: points, theta: Double((-1)*theta)) 104 | } 105 | 106 | public static func RotateBy(points: [CGPoint], theta: Double) -> [CGPoint] { 107 | return RotateByRadians(points: points, radians: theta) 108 | } 109 | 110 | // rotate the points by the given radians about their centroid 111 | public static func RotateByRadians(points: [CGPoint], radians: Double) -> [CGPoint] { 112 | var newPoints = [CGPoint]() 113 | let c = Centroid(points: points) 114 | 115 | let cosine = cos(radians) 116 | let sine = sin(radians) 117 | 118 | let cx = c.x; 119 | let cy = c.y; 120 | 121 | for p in points { 122 | let dx = p.x - cx 123 | let dy = p.y - cy 124 | newPoints.append(CGPoint(x: dx * CGFloat(cosine) - dy * CGFloat(sine) + cx, y: dx * CGFloat(sine) + dy * CGFloat(cosine) + cy)) 125 | } 126 | return newPoints 127 | } 128 | 129 | public static func ScaleToSquare(points: [CGPoint], size: Double) -> [CGPoint] { 130 | return ScaleToSquare(points: points, size: size, boundingBox: nil) 131 | } 132 | 133 | public static func ScaleToSquare(points: [CGPoint], size: Double, boundingBox: Rectangle?) -> [CGPoint] { 134 | let B = BoundingBox(points: points) 135 | var newpoints = [CGPoint]() 136 | for p in points { 137 | let qx = Double(p.x) * (size / B.Width) 138 | let qy = Double(p.y) * (size / B.Height) 139 | newpoints.append(CGPoint(x: qx, y: qy)) 140 | } 141 | if (boundingBox != nil){ //this will probably not be used as we are more interested in the pre-rotated bounding box -> see RotateToZero 142 | boundingBox!.copy(src: B) 143 | } 144 | return newpoints 145 | } 146 | 147 | public static func TranslateToOrigin(points: [CGPoint]) -> [CGPoint]{ 148 | let c = Centroid(points: points) 149 | var newpoints = [CGPoint]() 150 | for i in 0...points.count-1{ 151 | let p = points[i] 152 | let qx = p.x - c.x; 153 | let qy = p.y - c.y; 154 | newpoints.append(CGPoint(x: qx, y: qy)) 155 | } 156 | return newpoints 157 | } 158 | 159 | public static func DistanceAtBestAngle(points: [CGPoint], T: Template, a: Double, b: Double, threshold: Double) -> Double { 160 | let Phi = 0.5 * (-1.0 + sqrt(5.0))//Recognizer.Phi; 161 | 162 | var x1 = Phi * a + (1.0 - Phi) * b 163 | var f1 = DistanceAtAngle(points: points, T: T, theta: x1) 164 | var x2 = (1.0 - Phi) * a + Phi * b 165 | var f2 = DistanceAtAngle(points: points, T: T, theta: x2) 166 | var b2 = b 167 | var a2 = a 168 | while (abs(b2 - a2) > threshold) { 169 | if (f1 < f2){ 170 | b2 = x2 171 | x2 = x1 172 | f2 = f1 173 | x1 = Phi * a2 + (1.0 - Phi) * b2 174 | f1 = DistanceAtAngle(points: points, T: T, theta: x1) 175 | } else { 176 | a2 = x1 177 | x1 = x2 178 | f1 = f2 179 | x2 = (1.0 - Phi) * a2 + Phi * b2 180 | f2 = DistanceAtAngle(points: points, T: T, theta: x2) 181 | } 182 | } 183 | return min(f1, f2); 184 | } 185 | 186 | public static func DistanceAtAngle(points: [CGPoint], T: Template, theta: Double) -> Double { 187 | let newpoints = RotateBy(points: points, theta: theta); 188 | return PathDistance(path1: newpoints, path2: T.mPoints) 189 | } 190 | 191 | // #region Lengths and Rects 192 | 193 | public static func BoundingBox(points: [CGPoint]) -> Rectangle { 194 | var minX = CGFloat.greatestFiniteMagnitude 195 | var maxX = CGFloat.leastNormalMagnitude 196 | var minY = CGFloat.greatestFiniteMagnitude 197 | var maxY = CGFloat.leastNormalMagnitude 198 | 199 | for p in points { 200 | if (p.x < minX){ 201 | minX = p.x 202 | } 203 | if (p.x > maxX){ 204 | maxX = p.x 205 | } 206 | 207 | if (p.y < minY){ 208 | minY = p.y 209 | } 210 | if (p.y > maxY){ 211 | maxY = p.y 212 | } 213 | } 214 | 215 | return Rectangle(x: Double(minX), y: Double(minY), width: Double(maxX - minX), height: Double(maxY - minY)) 216 | } 217 | 218 | public static func BoundingBox(points: [CGPoint], dst: Rectangle){ 219 | var minX = CGFloat.leastNormalMagnitude 220 | var maxX = CGFloat.greatestFiniteMagnitude 221 | var minY = CGFloat.leastNormalMagnitude 222 | var maxY = CGFloat.greatestFiniteMagnitude 223 | 224 | for p in points { 225 | if (p.x < minX){ 226 | minX = p.x 227 | } 228 | if (p.x > maxX){ 229 | maxX = p.x 230 | } 231 | 232 | if (p.y < minY){ 233 | minY = p.y 234 | } 235 | if (p.y > maxY){ 236 | maxY = p.y 237 | } 238 | } 239 | 240 | dst.X = Double(minX); 241 | dst.Y = Double(minY); 242 | dst.Width = Double(maxX - minX); 243 | dst.Height = Double(maxY - minY); 244 | } 245 | 246 | public static func Distance(p1: CGPoint, p2: CGPoint) -> Double{ 247 | let dx = p2.x - p1.x 248 | let dy = p2.y - p1.y 249 | return sqrt(Double(dx * dx + dy * dy)) 250 | } 251 | 252 | // compute the centroid of the points given 253 | public static func Centroid(points: [CGPoint]) -> CGPoint { 254 | var xsum = CGFloat(0); 255 | var ysum = CGFloat(0); 256 | 257 | for p in points{ 258 | xsum+=p.x 259 | ysum+=p.y 260 | } 261 | return CGPoint(x: xsum / CGFloat(points.count), y: ysum / CGFloat(points.count)) 262 | } 263 | 264 | public static func PathLength(points: [CGPoint]) -> Double{ 265 | var length = Double(0) 266 | for i in 1...points.count-1{ 267 | length += Distance(p1: points[i - 1], p2: points[i]) 268 | } 269 | return length 270 | } 271 | 272 | // computes the 'distance' between two point paths by summing their corresponding point distances. 273 | // assumes that each path has been resampled to the same number of points at the same distance apart. 274 | public static func PathDistance(path1: [CGPoint],path2: [CGPoint]) ->Double { 275 | var distance = Double(0) 276 | for i in 0...path1.count-1{ 277 | distance += Distance(p1: path1[i], p2: path2[i]) 278 | } 279 | return distance / Double(path1.count) 280 | } 281 | 282 | } 283 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/iOSGesturizer/iOSGesturizer/GestureRecognizer/Utils.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Utils.swift 3 | // iOSGesturizer 4 | // 5 | // Created by Kuanysh on 2/8/18. 6 | // Copyright © 2018 Kuanysh Zhunussov. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | /* ------------------------------------------------------------------------- 12 | * 13 | * $1 Java 14 | * 15 | * This is a Java port of the $1 Gesture Recognizer by 16 | * Jacob O. Wobbrock, Andrew D. Wilson, Yang Li. 17 | * 18 | * "The $1 Unistroke Recognizer is a 2-D single-stroke recognizer designed for 19 | * rapid prototyping of gesture-based user interfaces." 20 | * 21 | * http://depts.washington.edu/aimgroup/proj/dollar/ 22 | * 23 | * Copyright (C) 2009, Alex Olwal, www.olwal.com 24 | * 25 | * $1 Java free software: you can redistribute it and/or modify 26 | * it under the terms of the GNU General Public License as published by 27 | * the Free Software Foundation, either version 3 of the License, or 28 | * (at your option) any later version. 29 | * 30 | * $1 Java is distributed in the hope that it will be useful, 31 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 33 | * GNU General Public License for more details. 34 | * 35 | * You should have received a copy of the GNU General Public License 36 | * along with $1 Java. If not, see . 37 | * 38 | * ------------------------------------------------------------------------- 39 | */ 40 | 41 | public class Utils 42 | { 43 | public static var lastTheta: Double = Double(0) 44 | 45 | public static func Resample(points: [CGPoint], n: Int) -> [CGPoint]{ 46 | let I = PathLength(points: points) / Double(n - 1) 47 | var D = 0.0 48 | 49 | var srcPts = [CGPoint]() 50 | for p in points{ 51 | srcPts.append(p) 52 | } 53 | var dstPts = [CGPoint]() 54 | dstPts.append(srcPts[0]) 55 | var i = 1 56 | while (i < srcPts.count-1){ 57 | let pt1 = srcPts[i-1] 58 | let pt2 = srcPts[i] 59 | 60 | let d = Distance(p1: pt1, p2: pt2) 61 | if ((D + d) >= I) { 62 | let qx = pt1.x + CGFloat((I - D) / d) * (pt2.x - pt1.x) 63 | let qy = pt1.y + CGFloat((I - D) / d) * (pt2.y - pt1.y) 64 | let q = CGPoint (x: qx, y: qy) 65 | dstPts.append(q) 66 | srcPts.insert(q, at: i) 67 | D = 0.0 68 | } else { 69 | D += d 70 | } 71 | i+=1 72 | } 73 | // somtimes we fall a rounding-error short of adding the last point, so add it if so 74 | if (dstPts.count == n - 1) { 75 | dstPts.append(srcPts[srcPts.count - 1]) 76 | } 77 | 78 | return dstPts; 79 | } 80 | 81 | 82 | public static func RotateToZero(points: [CGPoint]) -> [CGPoint] { 83 | return RotateToZero(points: points, centroid: nil, boundingBox: nil) 84 | } 85 | 86 | 87 | public static func RotateToZero(points: [CGPoint], centroid: CGPoint?, boundingBox: Rectangle?) -> [CGPoint] { 88 | let c = Centroid(points: points) 89 | let first = points[0] 90 | let theta = atan2(c.y-first.y, c.x-first.x) 91 | var cent = centroid 92 | if (cent != nil){ 93 | cent!.x = c.x 94 | cent!.y = c.y 95 | } 96 | 97 | if (boundingBox != nil){ 98 | BoundingBox(points: points, dst: boundingBox!) 99 | } 100 | 101 | self.lastTheta = Double(theta) 102 | 103 | return RotateBy(points: points, theta: Double((-1)*theta)) 104 | } 105 | 106 | public static func RotateBy(points: [CGPoint], theta: Double) -> [CGPoint] { 107 | return RotateByRadians(points: points, radians: theta) 108 | } 109 | 110 | // rotate the points by the given radians about their centroid 111 | public static func RotateByRadians(points: [CGPoint], radians: Double) -> [CGPoint] { 112 | var newPoints = [CGPoint]() 113 | let c = Centroid(points: points) 114 | 115 | let cosine = cos(radians) 116 | let sine = sin(radians) 117 | 118 | let cx = c.x; 119 | let cy = c.y; 120 | 121 | for p in points { 122 | let dx = p.x - cx 123 | let dy = p.y - cy 124 | newPoints.append(CGPoint(x: dx * CGFloat(cosine) - dy * CGFloat(sine) + cx, y: dx * CGFloat(sine) + dy * CGFloat(cosine) + cy)) 125 | } 126 | return newPoints 127 | } 128 | 129 | public static func ScaleToSquare(points: [CGPoint], size: Double) -> [CGPoint] { 130 | return ScaleToSquare(points: points, size: size, boundingBox: nil) 131 | } 132 | 133 | public static func ScaleToSquare(points: [CGPoint], size: Double, boundingBox: Rectangle?) -> [CGPoint] { 134 | let B = BoundingBox(points: points) 135 | var newpoints = [CGPoint]() 136 | for p in points { 137 | let qx = Double(p.x) * (size / B.Width) 138 | let qy = Double(p.y) * (size / B.Height) 139 | newpoints.append(CGPoint(x: qx, y: qy)) 140 | } 141 | if (boundingBox != nil){ //this will probably not be used as we are more interested in the pre-rotated bounding box -> see RotateToZero 142 | boundingBox!.copy(src: B) 143 | } 144 | return newpoints 145 | } 146 | 147 | public static func TranslateToOrigin(points: [CGPoint]) -> [CGPoint]{ 148 | let c = Centroid(points: points) 149 | var newpoints = [CGPoint]() 150 | for i in 0...points.count-1{ 151 | let p = points[i] 152 | let qx = p.x - c.x; 153 | let qy = p.y - c.y; 154 | newpoints.append(CGPoint(x: qx, y: qy)) 155 | } 156 | return newpoints 157 | } 158 | 159 | public static func DistanceAtBestAngle(points: [CGPoint], T: Template, a: Double, b: Double, threshold: Double) -> Double { 160 | let Phi = 0.5 * (-1.0 + sqrt(5.0))//Recognizer.Phi; 161 | 162 | var x1 = Phi * a + (1.0 - Phi) * b 163 | var f1 = DistanceAtAngle(points: points, T: T, theta: x1) 164 | var x2 = (1.0 - Phi) * a + Phi * b 165 | var f2 = DistanceAtAngle(points: points, T: T, theta: x2) 166 | var b2 = b 167 | var a2 = a 168 | while (abs(b2 - a2) > threshold) { 169 | if (f1 < f2){ 170 | b2 = x2 171 | x2 = x1 172 | f2 = f1 173 | x1 = Phi * a2 + (1.0 - Phi) * b2 174 | f1 = DistanceAtAngle(points: points, T: T, theta: x1) 175 | } else { 176 | a2 = x1 177 | x1 = x2 178 | f1 = f2 179 | x2 = (1.0 - Phi) * a2 + Phi * b2 180 | f2 = DistanceAtAngle(points: points, T: T, theta: x2) 181 | } 182 | } 183 | return min(f1, f2); 184 | } 185 | 186 | public static func DistanceAtAngle(points: [CGPoint], T: Template, theta: Double) -> Double { 187 | let newpoints = RotateBy(points: points, theta: theta); 188 | return PathDistance(path1: newpoints, path2: T.mPoints) 189 | } 190 | 191 | // #region Lengths and Rects 192 | 193 | public static func BoundingBox(points: [CGPoint]) -> Rectangle { 194 | var minX = CGFloat.greatestFiniteMagnitude 195 | var maxX = CGFloat.leastNormalMagnitude 196 | var minY = CGFloat.greatestFiniteMagnitude 197 | var maxY = CGFloat.leastNormalMagnitude 198 | 199 | for p in points { 200 | if (p.x < minX){ 201 | minX = p.x 202 | } 203 | if (p.x > maxX){ 204 | maxX = p.x 205 | } 206 | 207 | if (p.y < minY){ 208 | minY = p.y 209 | } 210 | if (p.y > maxY){ 211 | maxY = p.y 212 | } 213 | } 214 | 215 | return Rectangle(x: Double(minX), y: Double(minY), width: Double(maxX - minX), height: Double(maxY - minY)) 216 | } 217 | 218 | public static func BoundingBox(points: [CGPoint], dst: Rectangle){ 219 | var minX = CGFloat.leastNormalMagnitude 220 | var maxX = CGFloat.greatestFiniteMagnitude 221 | var minY = CGFloat.leastNormalMagnitude 222 | var maxY = CGFloat.greatestFiniteMagnitude 223 | 224 | for p in points { 225 | if (p.x < minX){ 226 | minX = p.x 227 | } 228 | if (p.x > maxX){ 229 | maxX = p.x 230 | } 231 | 232 | if (p.y < minY){ 233 | minY = p.y 234 | } 235 | if (p.y > maxY){ 236 | maxY = p.y 237 | } 238 | } 239 | 240 | dst.X = Double(minX); 241 | dst.Y = Double(minY); 242 | dst.Width = Double(maxX - minX); 243 | dst.Height = Double(maxY - minY); 244 | } 245 | 246 | public static func Distance(p1: CGPoint, p2: CGPoint) -> Double{ 247 | let dx = p2.x - p1.x 248 | let dy = p2.y - p1.y 249 | return sqrt(Double(dx * dx + dy * dy)) 250 | } 251 | 252 | // compute the centroid of the points given 253 | public static func Centroid(points: [CGPoint]) -> CGPoint { 254 | var xsum = CGFloat(0); 255 | var ysum = CGFloat(0); 256 | 257 | for p in points{ 258 | xsum+=p.x 259 | ysum+=p.y 260 | } 261 | return CGPoint(x: xsum / CGFloat(points.count), y: ysum / CGFloat(points.count)) 262 | } 263 | 264 | public static func PathLength(points: [CGPoint]) -> Double{ 265 | var length = Double(0) 266 | for i in 1...points.count-1{ 267 | length += Distance(p1: points[i - 1], p2: points[i]) 268 | } 269 | return length 270 | } 271 | 272 | // computes the 'distance' between two point paths by summing their corresponding point distances. 273 | // assumes that each path has been resampled to the same number of points at the same distance apart. 274 | public static func PathDistance(path1: [CGPoint],path2: [CGPoint]) ->Double { 275 | var distance = Double(0) 276 | for i in 0...path1.count-1{ 277 | distance += Distance(p1: path1[i], p2: path2[i]) 278 | } 279 | return distance / Double(path1.count) 280 | } 281 | 282 | } 283 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2018 Kuanysh Zhunussov 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/iOSGesturizer/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2018 Kuanysh Zhunussov 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Example/FoodTracker/Pods/Target Support Files/Pods-FoodTracker/Pods-FoodTracker-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## iOSGesturizer 5 | 6 | Apache License 7 | Version 2.0, January 2004 8 | http://www.apache.org/licenses/ 9 | 10 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 11 | 12 | 1. Definitions. 13 | 14 | "License" shall mean the terms and conditions for use, reproduction, 15 | and distribution as defined by Sections 1 through 9 of this document. 16 | 17 | "Licensor" shall mean the copyright owner or entity authorized by 18 | the copyright owner that is granting the License. 19 | 20 | "Legal Entity" shall mean the union of the acting entity and all 21 | other entities that control, are controlled by, or are under common 22 | control with that entity. For the purposes of this definition, 23 | "control" means (i) the power, direct or indirect, to cause the 24 | direction or management of such entity, whether by contract or 25 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 26 | outstanding shares, or (iii) beneficial ownership of such entity. 27 | 28 | "You" (or "Your") shall mean an individual or Legal Entity 29 | exercising permissions granted by this License. 30 | 31 | "Source" form shall mean the preferred form for making modifications, 32 | including but not limited to software source code, documentation 33 | source, and configuration files. 34 | 35 | "Object" form shall mean any form resulting from mechanical 36 | transformation or translation of a Source form, including but 37 | not limited to compiled object code, generated documentation, 38 | and conversions to other media types. 39 | 40 | "Work" shall mean the work of authorship, whether in Source or 41 | Object form, made available under the License, as indicated by a 42 | copyright notice that is included in or attached to the work 43 | (an example is provided in the Appendix below). 44 | 45 | "Derivative Works" shall mean any work, whether in Source or Object 46 | form, that is based on (or derived from) the Work and for which the 47 | editorial revisions, annotations, elaborations, or other modifications 48 | represent, as a whole, an original work of authorship. For the purposes 49 | of this License, Derivative Works shall not include works that remain 50 | separable from, or merely link (or bind by name) to the interfaces of, 51 | the Work and Derivative Works thereof. 52 | 53 | "Contribution" shall mean any work of authorship, including 54 | the original version of the Work and any modifications or additions 55 | to that Work or Derivative Works thereof, that is intentionally 56 | submitted to Licensor for inclusion in the Work by the copyright owner 57 | or by an individual or Legal Entity authorized to submit on behalf of 58 | the copyright owner. For the purposes of this definition, "submitted" 59 | means any form of electronic, verbal, or written communication sent 60 | to the Licensor or its representatives, including but not limited to 61 | communication on electronic mailing lists, source code control systems, 62 | and issue tracking systems that are managed by, or on behalf of, the 63 | Licensor for the purpose of discussing and improving the Work, but 64 | excluding communication that is conspicuously marked or otherwise 65 | designated in writing by the copyright owner as "Not a Contribution." 66 | 67 | "Contributor" shall mean Licensor and any individual or Legal Entity 68 | on behalf of whom a Contribution has been received by Licensor and 69 | subsequently incorporated within the Work. 70 | 71 | 2. Grant of Copyright License. Subject to the terms and conditions of 72 | this License, each Contributor hereby grants to You a perpetual, 73 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 74 | copyright license to reproduce, prepare Derivative Works of, 75 | publicly display, publicly perform, sublicense, and distribute the 76 | Work and such Derivative Works in Source or Object form. 77 | 78 | 3. Grant of Patent License. Subject to the terms and conditions of 79 | this License, each Contributor hereby grants to You a perpetual, 80 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 81 | (except as stated in this section) patent license to make, have made, 82 | use, offer to sell, sell, import, and otherwise transfer the Work, 83 | where such license applies only to those patent claims licensable 84 | by such Contributor that are necessarily infringed by their 85 | Contribution(s) alone or by combination of their Contribution(s) 86 | with the Work to which such Contribution(s) was submitted. If You 87 | institute patent litigation against any entity (including a 88 | cross-claim or counterclaim in a lawsuit) alleging that the Work 89 | or a Contribution incorporated within the Work constitutes direct 90 | or contributory patent infringement, then any patent licenses 91 | granted to You under this License for that Work shall terminate 92 | as of the date such litigation is filed. 93 | 94 | 4. Redistribution. You may reproduce and distribute copies of the 95 | Work or Derivative Works thereof in any medium, with or without 96 | modifications, and in Source or Object form, provided that You 97 | meet the following conditions: 98 | 99 | (a) You must give any other recipients of the Work or 100 | Derivative Works a copy of this License; and 101 | 102 | (b) You must cause any modified files to carry prominent notices 103 | stating that You changed the files; and 104 | 105 | (c) You must retain, in the Source form of any Derivative Works 106 | that You distribute, all copyright, patent, trademark, and 107 | attribution notices from the Source form of the Work, 108 | excluding those notices that do not pertain to any part of 109 | the Derivative Works; and 110 | 111 | (d) If the Work includes a "NOTICE" text file as part of its 112 | distribution, then any Derivative Works that You distribute must 113 | include a readable copy of the attribution notices contained 114 | within such NOTICE file, excluding those notices that do not 115 | pertain to any part of the Derivative Works, in at least one 116 | of the following places: within a NOTICE text file distributed 117 | as part of the Derivative Works; within the Source form or 118 | documentation, if provided along with the Derivative Works; or, 119 | within a display generated by the Derivative Works, if and 120 | wherever such third-party notices normally appear. The contents 121 | of the NOTICE file are for informational purposes only and 122 | do not modify the License. You may add Your own attribution 123 | notices within Derivative Works that You distribute, alongside 124 | or as an addendum to the NOTICE text from the Work, provided 125 | that such additional attribution notices cannot be construed 126 | as modifying the License. 127 | 128 | You may add Your own copyright statement to Your modifications and 129 | may provide additional or different license terms and conditions 130 | for use, reproduction, or distribution of Your modifications, or 131 | for any such Derivative Works as a whole, provided Your use, 132 | reproduction, and distribution of the Work otherwise complies with 133 | the conditions stated in this License. 134 | 135 | 5. Submission of Contributions. Unless You explicitly state otherwise, 136 | any Contribution intentionally submitted for inclusion in the Work 137 | by You to the Licensor shall be under the terms and conditions of 138 | this License, without any additional terms or conditions. 139 | Notwithstanding the above, nothing herein shall supersede or modify 140 | the terms of any separate license agreement you may have executed 141 | with Licensor regarding such Contributions. 142 | 143 | 6. Trademarks. This License does not grant permission to use the trade 144 | names, trademarks, service marks, or product names of the Licensor, 145 | except as required for reasonable and customary use in describing the 146 | origin of the Work and reproducing the content of the NOTICE file. 147 | 148 | 7. Disclaimer of Warranty. Unless required by applicable law or 149 | agreed to in writing, Licensor provides the Work (and each 150 | Contributor provides its Contributions) on an "AS IS" BASIS, 151 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 152 | implied, including, without limitation, any warranties or conditions 153 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 154 | PARTICULAR PURPOSE. You are solely responsible for determining the 155 | appropriateness of using or redistributing the Work and assume any 156 | risks associated with Your exercise of permissions under this License. 157 | 158 | 8. Limitation of Liability. In no event and under no legal theory, 159 | whether in tort (including negligence), contract, or otherwise, 160 | unless required by applicable law (such as deliberate and grossly 161 | negligent acts) or agreed to in writing, shall any Contributor be 162 | liable to You for damages, including any direct, indirect, special, 163 | incidental, or consequential damages of any character arising as a 164 | result of this License or out of the use or inability to use the 165 | Work (including but not limited to damages for loss of goodwill, 166 | work stoppage, computer failure or malfunction, or any and all 167 | other commercial damages or losses), even if such Contributor 168 | has been advised of the possibility of such damages. 169 | 170 | 9. Accepting Warranty or Additional Liability. While redistributing 171 | the Work or Derivative Works thereof, You may choose to offer, 172 | and charge a fee for, acceptance of support, warranty, indemnity, 173 | or other liability obligations and/or rights consistent with this 174 | License. However, in accepting such obligations, You may act only 175 | on Your own behalf and on Your sole responsibility, not on behalf 176 | of any other Contributor, and only if You agree to indemnify, 177 | defend, and hold each Contributor harmless for any liability 178 | incurred by, or claims asserted against, such Contributor by reason 179 | of your accepting any such warranty or additional liability. 180 | 181 | END OF TERMS AND CONDITIONS 182 | 183 | APPENDIX: How to apply the Apache License to your work. 184 | 185 | To apply the Apache License to your work, attach the following 186 | boilerplate notice, with the fields enclosed by brackets "[]" 187 | replaced with your own identifying information. (Don't include 188 | the brackets!) The text should be enclosed in the appropriate 189 | comment syntax for the file format. We also recommend that a 190 | file or class name and description of purpose be included on the 191 | same "printed page" as the copyright notice for easier 192 | identification within third-party archives. 193 | 194 | Copyright 2018 Kuanysh Zhunussov 195 | 196 | Licensed under the Apache License, Version 2.0 (the "License"); 197 | you may not use this file except in compliance with the License. 198 | You may obtain a copy of the License at 199 | 200 | http://www.apache.org/licenses/LICENSE-2.0 201 | 202 | Unless required by applicable law or agreed to in writing, software 203 | distributed under the License is distributed on an "AS IS" BASIS, 204 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 205 | See the License for the specific language governing permissions and 206 | limitations under the License. 207 | 208 | Generated by CocoaPods - https://cocoapods.org 209 | --------------------------------------------------------------------------------