├── .gitignore ├── Example ├── .DS_Store ├── JOTextField.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── JOTextField-Example.xcscheme ├── JOTextField.xcworkspace │ └── contents.xcworkspacedata ├── JOTextField │ ├── Base.lproj │ │ ├── Main_iPad.storyboard │ │ └── Main_iPhone.storyboard │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── LaunchImage.launchimage │ │ │ └── Contents.json │ ├── JOAppDelegate.h │ ├── JOAppDelegate.m │ ├── JOTextField-Info.plist │ ├── JOTextField-Prefix.pch │ ├── JOTextField.h │ ├── JOTextField.m │ ├── JOViewController.h │ ├── JOViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── FBSnapshotTestCase │ │ ├── FBSnapshotTestCase │ │ │ ├── FBSnapshotTestCase.h │ │ │ ├── FBSnapshotTestCase.m │ │ │ ├── FBSnapshotTestController.h │ │ │ ├── FBSnapshotTestController.m │ │ │ ├── UIImage+Compare.h │ │ │ ├── UIImage+Compare.m │ │ │ ├── UIImage+Diff.h │ │ │ └── UIImage+Diff.m │ │ ├── LICENSE │ │ └── README.md │ ├── Headers │ │ ├── Private │ │ │ ├── FBSnapshotTestCase │ │ │ │ ├── FBSnapshotTestCase.h │ │ │ │ ├── FBSnapshotTestController.h │ │ │ │ ├── UIImage+Compare.h │ │ │ │ └── UIImage+Diff.h │ │ │ ├── JOTextField │ │ │ │ ├── JOTextField.h │ │ │ │ └── Vars.h │ │ │ └── pop │ │ │ │ ├── FloatConversion.h │ │ │ │ ├── POP.h │ │ │ │ ├── POPAction.h │ │ │ │ ├── POPAnimatableProperty.h │ │ │ │ ├── POPAnimation.h │ │ │ │ ├── POPAnimationEvent.h │ │ │ │ ├── POPAnimationEventInternal.h │ │ │ │ ├── POPAnimationExtras.h │ │ │ │ ├── POPAnimationInternal.h │ │ │ │ ├── POPAnimationPrivate.h │ │ │ │ ├── POPAnimationRuntime.h │ │ │ │ ├── POPAnimationTracer.h │ │ │ │ ├── POPAnimationTracerInternal.h │ │ │ │ ├── POPAnimator.h │ │ │ │ ├── POPAnimatorPrivate.h │ │ │ │ ├── POPBasicAnimation.h │ │ │ │ ├── POPBasicAnimationInternal.h │ │ │ │ ├── POPCGUtils.h │ │ │ │ ├── POPCustomAnimation.h │ │ │ │ ├── POPDecayAnimation.h │ │ │ │ ├── POPDecayAnimationInternal.h │ │ │ │ ├── POPDefines.h │ │ │ │ ├── POPGeometry.h │ │ │ │ ├── POPLayerExtras.h │ │ │ │ ├── POPMath.h │ │ │ │ ├── POPPropertyAnimation.h │ │ │ │ ├── POPPropertyAnimationInternal.h │ │ │ │ ├── POPSpringAnimation.h │ │ │ │ ├── POPSpringAnimationInternal.h │ │ │ │ ├── POPSpringSolver.h │ │ │ │ ├── POPVector.h │ │ │ │ ├── TransformationMatrix.h │ │ │ │ └── UnitBezier.h │ │ └── Public │ │ │ ├── FBSnapshotTestCase │ │ │ ├── FBSnapshotTestCase.h │ │ │ ├── FBSnapshotTestController.h │ │ │ ├── UIImage+Compare.h │ │ │ └── UIImage+Diff.h │ │ │ ├── JOTextField │ │ │ ├── JOTextField.h │ │ │ └── Vars.h │ │ │ └── pop │ │ │ ├── POP.h │ │ │ ├── POPAnimatableProperty.h │ │ │ ├── POPAnimation.h │ │ │ ├── POPAnimationEvent.h │ │ │ ├── POPAnimationExtras.h │ │ │ ├── POPAnimationTracer.h │ │ │ ├── POPAnimator.h │ │ │ ├── POPBasicAnimation.h │ │ │ ├── POPCustomAnimation.h │ │ │ ├── POPDecayAnimation.h │ │ │ ├── POPDefines.h │ │ │ ├── POPGeometry.h │ │ │ ├── POPLayerExtras.h │ │ │ ├── POPPropertyAnimation.h │ │ │ └── POPSpringAnimation.h │ ├── Local Podspecs │ │ └── JOTextField.podspec.json │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── Target Support Files │ │ ├── Pods-JOTextField-JOTextField │ │ │ ├── Pods-JOTextField-JOTextField-Private.xcconfig │ │ │ ├── Pods-JOTextField-JOTextField-dummy.m │ │ │ ├── Pods-JOTextField-JOTextField-prefix.pch │ │ │ └── Pods-JOTextField-JOTextField.xcconfig │ │ ├── Pods-JOTextField-pop │ │ │ ├── Pods-JOTextField-pop-Private.xcconfig │ │ │ ├── Pods-JOTextField-pop-dummy.m │ │ │ ├── Pods-JOTextField-pop-prefix.pch │ │ │ └── Pods-JOTextField-pop.xcconfig │ │ ├── Pods-JOTextField │ │ │ ├── Pods-JOTextField-acknowledgements.markdown │ │ │ ├── Pods-JOTextField-acknowledgements.plist │ │ │ ├── Pods-JOTextField-dummy.m │ │ │ ├── Pods-JOTextField-environment.h │ │ │ ├── Pods-JOTextField-resources.sh │ │ │ ├── Pods-JOTextField.debug.xcconfig │ │ │ └── Pods-JOTextField.release.xcconfig │ │ ├── Pods-Tests-FBSnapshotTestCase │ │ │ ├── Pods-Tests-FBSnapshotTestCase-Private.xcconfig │ │ │ ├── Pods-Tests-FBSnapshotTestCase-dummy.m │ │ │ ├── Pods-Tests-FBSnapshotTestCase-prefix.pch │ │ │ └── Pods-Tests-FBSnapshotTestCase.xcconfig │ │ ├── Pods-Tests-JOTextField │ │ │ ├── Pods-Tests-JOTextField-Private.xcconfig │ │ │ ├── Pods-Tests-JOTextField-dummy.m │ │ │ ├── Pods-Tests-JOTextField-prefix.pch │ │ │ └── Pods-Tests-JOTextField.xcconfig │ │ ├── Pods-Tests-pop │ │ │ ├── Pods-Tests-pop-Private.xcconfig │ │ │ ├── Pods-Tests-pop-dummy.m │ │ │ ├── Pods-Tests-pop-prefix.pch │ │ │ └── Pods-Tests-pop.xcconfig │ │ └── Pods-Tests │ │ │ ├── Pods-Tests-acknowledgements.markdown │ │ │ ├── Pods-Tests-acknowledgements.plist │ │ │ ├── Pods-Tests-dummy.m │ │ │ ├── Pods-Tests-environment.h │ │ │ ├── Pods-Tests-resources.sh │ │ │ ├── Pods-Tests.debug.xcconfig │ │ │ └── Pods-Tests.release.xcconfig │ └── pop │ │ ├── LICENSE │ │ ├── README.md │ │ └── pop │ │ ├── POP.h │ │ ├── POPAction.h │ │ ├── POPAnimatableProperty.h │ │ ├── POPAnimatableProperty.mm │ │ ├── POPAnimation.h │ │ ├── POPAnimation.mm │ │ ├── POPAnimationEvent.h │ │ ├── POPAnimationEvent.mm │ │ ├── POPAnimationEventInternal.h │ │ ├── POPAnimationExtras.h │ │ ├── POPAnimationExtras.mm │ │ ├── POPAnimationInternal.h │ │ ├── POPAnimationPrivate.h │ │ ├── POPAnimationRuntime.h │ │ ├── POPAnimationRuntime.mm │ │ ├── POPAnimationTracer.h │ │ ├── POPAnimationTracer.mm │ │ ├── POPAnimationTracerInternal.h │ │ ├── POPAnimator.h │ │ ├── POPAnimator.mm │ │ ├── POPAnimatorPrivate.h │ │ ├── POPBasicAnimation.h │ │ ├── POPBasicAnimation.mm │ │ ├── POPBasicAnimationInternal.h │ │ ├── POPCGUtils.h │ │ ├── POPCGUtils.mm │ │ ├── POPCustomAnimation.h │ │ ├── POPCustomAnimation.mm │ │ ├── POPDecayAnimation.h │ │ ├── POPDecayAnimation.mm │ │ ├── POPDecayAnimationInternal.h │ │ ├── POPDefines.h │ │ ├── POPGeometry.h │ │ ├── POPGeometry.mm │ │ ├── POPLayerExtras.h │ │ ├── POPLayerExtras.mm │ │ ├── POPMath.h │ │ ├── POPMath.mm │ │ ├── POPPropertyAnimation.h │ │ ├── POPPropertyAnimation.mm │ │ ├── POPPropertyAnimationInternal.h │ │ ├── POPSpringAnimation.h │ │ ├── POPSpringAnimation.mm │ │ ├── POPSpringAnimationInternal.h │ │ ├── POPSpringSolver.h │ │ ├── POPVector.h │ │ ├── POPVector.mm │ │ └── WebCore │ │ ├── FloatConversion.h │ │ ├── TransformationMatrix.cpp │ │ ├── TransformationMatrix.h │ │ └── UnitBezier.h └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── JOTextField.h ├── JOTextField.m ├── JOTextField.podspec ├── LICENSE ├── Pod ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── JOTextField.h │ ├── JOTextField.m │ ├── Vars.h │ └── Vars.m ├── README.md ├── Vars.h └── Vars.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | .DS_Store 5 | *.DS_Store 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata 15 | *.xccheckout 16 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | *.xcuserstate 21 | 22 | # CocoaPods 23 | # 24 | # We recommend against adding the Pods directory to your .gitignore. However 25 | # you should judge for yourself, the pros and cons are mentioned at: 26 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 27 | # 28 | # Pods/ 29 | 30 | # Carthage 31 | # 32 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 33 | # Carthage/Checkouts 34 | 35 | Carthage/Build 36 | -------------------------------------------------------------------------------- /Example/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lojals/JOTextField/cceffdd3af19afac89b2b47c62b45a06e69afa2a/Example/.DS_Store -------------------------------------------------------------------------------- /Example/JOTextField.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/JOTextField.xcodeproj/xcshareddata/xcschemes/JOTextField-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /Example/JOTextField.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/JOTextField/Base.lproj/Main_iPad.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 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Example/JOTextField/Base.lproj/Main_iPhone.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 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/JOTextField/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "ipad", 20 | "size" : "29x29", 21 | "scale" : "1x" 22 | }, 23 | { 24 | "idiom" : "ipad", 25 | "size" : "29x29", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "ipad", 30 | "size" : "40x40", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "40x40", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "76x76", 41 | "scale" : "1x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "76x76", 46 | "scale" : "2x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/JOTextField/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Example/JOTextField/JOAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // JOAppDelegate.h 3 | // JOTextField 4 | // 5 | // Created by CocoaPods on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JOAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/JOTextField/JOAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // JOAppDelegate.m 3 | // JOTextField 4 | // 5 | // Created by CocoaPods on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | #import "JOAppDelegate.h" 10 | 11 | @implementation JOAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 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 | - (void)applicationWillTerminate:(UIApplication *)application 42 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/JOTextField/JOTextField-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main_iPhone 29 | UIMainStoryboardFile~ipad 30 | Main_iPad 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/JOTextField/JOTextField-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/JOTextField/JOTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // JOTextField.h 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Vars.h" 11 | 12 | @interface JOTextField : UITextField { 13 | NSString *err; 14 | BOOL active; 15 | } 16 | 17 | //@property int type 18 | @property int type; 19 | @property (strong,nonatomic) UIView *view; 20 | @property (strong,nonatomic) UIButton *tooltip; 21 | 22 | 23 | -(void)config; 24 | -(NSString*)validate; 25 | -(void)setError; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/JOTextField/JOTextField.m: -------------------------------------------------------------------------------- 1 | // 2 | // JOTextField.m 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JOTextField.h" 11 | #import "JOLabel.h" 12 | #import "Vars.h" 13 | 14 | @implementation JOTextField 15 | @synthesize type,view,tooltip; 16 | -(void)awakeFromNib{ 17 | self.layer.cornerRadius = 5.0f; 18 | self.layer.borderColor = [UIColor lightGrayColor].CGColor; 19 | self.layer.borderWidth = 0.5; 20 | self.delegate = self; 21 | self.keyboardAppearance = UIKeyboardAppearanceDark; 22 | self.autocorrectionType = UITextAutocorrectionTypeNo; 23 | self.autocapitalizationType = UITextAutocapitalizationTypeNone; 24 | self.font = [UIFont fontWithName:@"Roboto-Light" size:FONT_SMALL]; 25 | UIView *views = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 20)]; 26 | self.leftView = views; 27 | self.leftViewMode = UITextFieldViewModeAlways; 28 | } 29 | 30 | -(void)config{ 31 | switch (type) { 32 | case TYPE_EMAIL: 33 | self.placeholder = @"EJEMPLO@MAIL.COM"; 34 | self.keyboardType = UIKeyboardTypeEmailAddress; 35 | break; 36 | case TYPE_NAME: 37 | self.placeholder = @"EJ: RODOLFO MOTA"; 38 | break; 39 | case TYPE_PASSWORD: 40 | self.placeholder = @"••••••"; 41 | self.secureTextEntry = true; 42 | break; 43 | case TYPE_NUMBER: 44 | self.placeholder = @"45"; 45 | self.keyboardType = UIKeyboardTypeNumberPad; 46 | break; 47 | } 48 | } 49 | 50 | -(void)textFieldDidBeginEditing:(UITextField *)textField{ 51 | self.rightViewMode = UITextFieldViewModeNever; 52 | textField.layer.borderColor = [UIColor colorWithRed:0.067 green:0.608 blue:0.608 alpha:1].CGColor; 53 | textField.layer.borderWidth = 2.0f; 54 | } 55 | 56 | -(void)textFieldDidEndEditing:(UITextField *)textField{ 57 | textField.layer.borderColor = [UIColor lightGrayColor].CGColor; 58 | textField.layer.borderWidth = 0.5f; 59 | } 60 | 61 | -(BOOL)textFieldShouldReturn:(UITextField *)textField{ 62 | if(textField){ 63 | [textField resignFirstResponder]; 64 | } 65 | return NO; 66 | } 67 | 68 | -(NSString*)validate{ 69 | err = @""; 70 | switch (type) { 71 | case TYPE_EMAIL: 72 | err = ([self validateEmail:self.text]&&![self.text isEqualToString:@""])? @"" : @"Email no válido"; 73 | break; 74 | case TYPE_NAME: 75 | err = (![self.text isEqualToString:@""])? @"" : @"Ingresa tu nombre"; 76 | break; 77 | case TYPE_PASSWORD: 78 | err = self.text.length < 6 ? @"Mayor a 6 carácteres" : @""; 79 | break; 80 | case TYPE_NUMBER: 81 | err = (![self.text isEqualToString:@""])? @"" : @"¿Edad?"; 82 | break; 83 | } 84 | if (![err isEqualToString:@""]) { 85 | [self setError]; 86 | } 87 | return err; 88 | } 89 | 90 | - (BOOL) validateEmail: (NSString *) candidate { 91 | NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,6}"; 92 | NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 93 | return [emailTest evaluateWithObject:candidate]; 94 | } 95 | 96 | -(void)setError{ 97 | self.layer.borderColor = [UIColor colorWithRed:0.561 green:0.157 blue:0.063 alpha:1].CGColor; 98 | self.layer.borderWidth = 2.0f; 99 | tooltip = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 30, self.frame.size.height)]; 100 | tooltip.backgroundColor = [UIColor colorWithRed:0.561 green:0.157 blue:0.063 alpha:1]; 101 | [tooltip setBackgroundColor:[UIColor colorWithRed:0.561 green:0.157 blue:0.063 alpha:1]]; 102 | [tooltip setTitle:@"?" forState:UIControlStateNormal]; 103 | [tooltip setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; 104 | tooltip.titleLabel.font = [UIFont fontWithName:@"Roboto-Light" size: FONT_MEDIUM]; 105 | [tooltip addTarget:self action:@selector(extendHelp) forControlEvents:UIControlEventTouchUpInside]; 106 | self.rightView = tooltip; 107 | self.rightViewMode = UITextFieldViewModeUnlessEditing; 108 | } 109 | 110 | 111 | -(void)extendHelp{ 112 | if (active) { 113 | active = false; 114 | tooltip.titleLabel.font = [UIFont fontWithName:@"Roboto-Light" size: FONT_MEDIUM]; 115 | [tooltip setTitle:@"?" forState:UIControlStateNormal]; 116 | POPSpringAnimation *sA1 = [POPSpringAnimation animation]; 117 | sA1.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame]; 118 | sA1.toValue = [NSValue valueWithCGRect:CGRectMake(0, 0, 30, self.frame.size.height)]; 119 | [sA1 setValue:@"toCenter2" forKey:@"animName"]; 120 | sA1.springBounciness = 10; 121 | sA1.springSpeed = 10; 122 | [self.rightView pop_addAnimation:sA1 forKey:@"toCenter2"]; 123 | }else{ 124 | active = true; 125 | tooltip.titleLabel.font = [UIFont fontWithName:@"Roboto-Light" size: FONT_XSMALL]; 126 | [tooltip setTitle:err forState:UIControlStateNormal]; 127 | POPSpringAnimation *sA1 = [POPSpringAnimation animation]; 128 | sA1.property = [POPAnimatableProperty propertyWithName:kPOPViewFrame]; 129 | sA1.toValue = [NSValue valueWithCGRect:self.frame]; 130 | [sA1 setValue:@"toCenter2" forKey:@"animName"]; 131 | sA1.springBounciness = 10; 132 | sA1.springSpeed = 10; 133 | [self.rightView pop_addAnimation:sA1 forKey:@"toCenter2"]; 134 | } 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /Example/JOTextField/JOViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // JOViewController.h 3 | // JOTextField 4 | // 5 | // Created by Jorge Ovalle on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "JOTextField.h" 11 | 12 | @interface JOViewController : UIViewController 13 | 14 | @property (strong,nonatomic) IBOutlet JOTextField *textFieldExample; 15 | @property (strong,nonatomic) IBOutlet JOTextField *textFieldExample2; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/JOTextField/JOViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // JOViewController.m 3 | // JOTextField 4 | // 5 | // Created by Jorge Ovalle on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | #import "JOViewController.h" 10 | 11 | @interface JOViewController () 12 | 13 | @end 14 | 15 | @implementation JOViewController 16 | @synthesize textFieldExample,textFieldExample2; 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | 22 | //Example 1: from Storyboard 23 | textFieldExample.type = TYPE_EMAIL; 24 | //textFieldExample.required = true; 25 | [textFieldExample config]; 26 | 27 | //Example 2: 28 | } 29 | 30 | - (void)didReceiveMemoryWarning 31 | { 32 | [super didReceiveMemoryWarning]; 33 | // Dispose of any resources that can be recreated. 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/JOTextField/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/JOTextField/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // JOTextField 4 | // 5 | // Created by Jorge Ovalle on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "JOAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([JOAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | target 'JOTextField', :exclusive => true do 4 | pod "JOTextField", :path => "../" 5 | end 6 | 7 | target 'Tests', :exclusive => true do 8 | pod "JOTextField", :path => "../" 9 | pod 'FBSnapshotTestCase' 10 | end 11 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FBSnapshotTestCase (1.7) 3 | - JOTextField (0.1.0): 4 | - pop (~> 1.0) 5 | - pop (1.0.7) 6 | 7 | DEPENDENCIES: 8 | - FBSnapshotTestCase 9 | - JOTextField (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | JOTextField: 13 | :path: ../ 14 | 15 | SPEC CHECKSUMS: 16 | FBSnapshotTestCase: 1eea5145c1f2fa907812ab92e1d6063a8d809b4e 17 | JOTextField: 2c2ce190f47207c4d92cb13eb9d9022117878559 18 | pop: 628ffc631644601567ee8bfaaaea493ebd7d0923 19 | 20 | COCOAPODS: 0.36.1 21 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import 12 | 13 | #import 14 | 15 | #import 16 | 17 | #ifndef FB_REFERENCE_IMAGE_DIR 18 | #define FB_REFERENCE_IMAGE_DIR "\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\"" 19 | #endif 20 | 21 | /** 22 | Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. 23 | @param view The view to snapshot 24 | @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. 25 | @param referenceImageDirectorySuffix An optional suffix, appended to the reference image directory path, such as "_iOS8" 26 | */ 27 | #define FBSnapshotVerifyViewWithReferenceDirectorySuffix(view__, identifier__, referenceImagesDirectorySuffix__) \ 28 | { \ 29 | NSError *error__ = nil; \ 30 | NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%s%@", FB_REFERENCE_IMAGE_DIR, referenceImagesDirectorySuffix__]; \ 31 | BOOL comparisonSuccess__ = [self compareSnapshotOfView:(view__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \ 32 | XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \ 33 | XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparsion!"); \ 34 | } 35 | 36 | #define FBSnapshotVerifyView(view__, identifier__) \ 37 | { \ 38 | FBSnapshotVerifyViewWithReferenceDirectorySuffix(view__, identifier__, @""); \ 39 | } 40 | 41 | /** 42 | Similar to our much-loved XCTAssert() macros. Use this to perform your test. No need to write an explanation, though. 43 | @param layer The layer to snapshot 44 | @param identifier An optional identifier, used is there are multiple snapshot tests in a given -test method. 45 | @param referenceImageDirectorySuffix An optional suffix, appended to the reference image directory path, such as "_iOS8" 46 | */ 47 | #define FBSnapshotVerifyLayerWithReferenceDirectorySuffix(layer__, identifier__, referenceImagesDirectorySuffix__) \ 48 | { \ 49 | NSError *error__ = nil; \ 50 | NSString *referenceImagesDirectory__ = [NSString stringWithFormat:@"%s%@", FB_REFERENCE_IMAGE_DIR, referenceImagesDirectorySuffix__]; \ 51 | BOOL comparisonSuccess__ = [self compareSnapshotOfLayer:(layer__) referenceImagesDirectory:referenceImagesDirectory__ identifier:(identifier__) error:&error__]; \ 52 | XCTAssertTrue(comparisonSuccess__, @"Snapshot comparison failed: %@", error__); \ 53 | XCTAssertFalse(self.recordMode, @"Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparsion!"); \ 54 | } 55 | 56 | #define FBSnapshotVerifyLayer(layer__, identifier__) \ 57 | { \ 58 | FBSnapshotVerifyLayerWithReferenceDirectorySuffix(layer__, identifier__, @""); \ 59 | } 60 | 61 | /** 62 | The base class of view snapshotting tests. If you have small UI component, it's often easier to configure it in a test 63 | and compare an image of the view to a reference image that write lots of complex layout-code tests. 64 | 65 | In order to flip the tests in your subclass to record the reference images set `recordMode` to YES before calling 66 | -[super setUp]. 67 | */ 68 | @interface FBSnapshotTestCase : XCTestCase 69 | 70 | /** 71 | When YES, the test macros will save reference images, rather than performing an actual test. 72 | */ 73 | @property (readwrite, nonatomic, assign) BOOL recordMode; 74 | 75 | /** 76 | Performs the comparisong or records a snapshot of the layer if recordMode is YES. 77 | @param layer The Layer to snapshot 78 | @param referenceImagesDirectory The directory in which reference images are stored. 79 | @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. 80 | @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). 81 | @returns YES if the comparison (or saving of the reference image) succeeded. 82 | */ 83 | - (BOOL)compareSnapshotOfLayer:(CALayer *)layer 84 | referenceImagesDirectory:(NSString *)referenceImagesDirectory 85 | identifier:(NSString *)identifier 86 | error:(NSError **)errorPtr; 87 | 88 | /** 89 | Performs the comparisong or records a snapshot of the view if recordMode is YES. 90 | @param view The view to snapshot 91 | @param referenceImagesDirectory The directory in which reference images are stored. 92 | @param identifier An optional identifier, used if there are multiple snapshot tests in a given -test method. 93 | @param error An error to log in an XCTAssert() macro if the method fails (missing reference image, images differ, etc). 94 | @returns YES if the comparison (or saving of the reference image) succeeded. 95 | */ 96 | - (BOOL)compareSnapshotOfView:(UIView *)view 97 | referenceImagesDirectory:(NSString *)referenceImagesDirectory 98 | identifier:(NSString *)identifier 99 | error:(NSError **)errorPtr; 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.m: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | * 9 | */ 10 | 11 | #import "FBSnapshotTestCase.h" 12 | 13 | #import "FBSnapshotTestController.h" 14 | 15 | @interface FBSnapshotTestCase () 16 | 17 | @property (readwrite, nonatomic, retain) FBSnapshotTestController *snapshotController; 18 | 19 | @end 20 | 21 | @implementation FBSnapshotTestCase 22 | 23 | - (void)setUp 24 | { 25 | [super setUp]; 26 | self.snapshotController = [[FBSnapshotTestController alloc] initWithTestName:NSStringFromClass([self class])]; 27 | } 28 | 29 | - (void)tearDown 30 | { 31 | self.snapshotController = nil; 32 | [super tearDown]; 33 | } 34 | 35 | - (BOOL)recordMode 36 | { 37 | return self.snapshotController.recordMode; 38 | } 39 | 40 | - (void)setRecordMode:(BOOL)recordMode 41 | { 42 | self.snapshotController.recordMode = recordMode; 43 | } 44 | 45 | - (BOOL)compareSnapshotOfLayer:(CALayer *)layer 46 | referenceImagesDirectory:(NSString *)referenceImagesDirectory 47 | identifier:(NSString *)identifier 48 | error:(NSError **)errorPtr 49 | { 50 | return [self _compareSnapshotOfViewOrLayer:layer 51 | referenceImagesDirectory:referenceImagesDirectory 52 | identifier:identifier 53 | error:errorPtr]; 54 | } 55 | 56 | - (BOOL)compareSnapshotOfView:(UIView *)view 57 | referenceImagesDirectory:(NSString *)referenceImagesDirectory 58 | identifier:(NSString *)identifier 59 | error:(NSError **)errorPtr 60 | { 61 | return [self _compareSnapshotOfViewOrLayer:view 62 | referenceImagesDirectory:referenceImagesDirectory 63 | identifier:identifier 64 | error:errorPtr]; 65 | } 66 | 67 | #pragma mark - 68 | #pragma mark Private API 69 | 70 | - (BOOL)_compareSnapshotOfViewOrLayer:(id)viewOrLayer 71 | referenceImagesDirectory:(NSString *)referenceImagesDirectory 72 | identifier:(NSString *)identifier 73 | error:(NSError **)errorPtr 74 | { 75 | _snapshotController.referenceImagesDirectory = referenceImagesDirectory; 76 | return [_snapshotController compareSnapshotOfViewOrLayer:viewOrLayer 77 | selector:self.invocation.selector 78 | identifier:identifier 79 | error:errorPtr]; 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import 32 | 33 | @interface UIImage (Compare) 34 | 35 | - (BOOL)compareWithImage:(UIImage *)image; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import "UIImage+Compare.h" 32 | 33 | @implementation UIImage (Compare) 34 | 35 | - (BOOL)compareWithImage:(UIImage *)image 36 | { 37 | NSAssert(CGSizeEqualToSize(self.size, image.size), @"Images must be same size."); 38 | 39 | // The images have the equal size, so we could use the smallest amount of bytes because of byte padding 40 | size_t minBytesPerRow = MIN(CGImageGetBytesPerRow(self.CGImage), CGImageGetBytesPerRow(image.CGImage)); 41 | size_t referenceImageSizeBytes = CGImageGetHeight(self.CGImage) * minBytesPerRow; 42 | void *referenceImagePixels = calloc(1, referenceImageSizeBytes); 43 | void *imagePixels = calloc(1, referenceImageSizeBytes); 44 | 45 | if (!referenceImagePixels || !imagePixels) { 46 | free(referenceImagePixels); 47 | free(imagePixels); 48 | return NO; 49 | } 50 | 51 | CGContextRef referenceImageContext = CGBitmapContextCreate(referenceImagePixels, 52 | CGImageGetWidth(self.CGImage), 53 | CGImageGetHeight(self.CGImage), 54 | CGImageGetBitsPerComponent(self.CGImage), 55 | minBytesPerRow, 56 | CGImageGetColorSpace(self.CGImage), 57 | (CGBitmapInfo)kCGImageAlphaPremultipliedLast 58 | ); 59 | CGContextRef imageContext = CGBitmapContextCreate(imagePixels, 60 | CGImageGetWidth(image.CGImage), 61 | CGImageGetHeight(image.CGImage), 62 | CGImageGetBitsPerComponent(image.CGImage), 63 | minBytesPerRow, 64 | CGImageGetColorSpace(image.CGImage), 65 | (CGBitmapInfo)kCGImageAlphaPremultipliedLast 66 | ); 67 | 68 | CGFloat scaleFactor = [[UIScreen mainScreen] scale]; 69 | CGContextScaleCTM(referenceImageContext, scaleFactor, scaleFactor); 70 | CGContextScaleCTM(imageContext, scaleFactor, scaleFactor); 71 | 72 | if (!referenceImageContext || !imageContext) { 73 | CGContextRelease(referenceImageContext); 74 | CGContextRelease(imageContext); 75 | free(referenceImagePixels); 76 | free(imagePixels); 77 | return NO; 78 | } 79 | 80 | CGContextDrawImage(referenceImageContext, CGRectMake(0.0f, 0.0f, self.size.width, self.size.height), self.CGImage); 81 | CGContextDrawImage(imageContext, CGRectMake(0.0f, 0.0f, image.size.width, image.size.height), image.CGImage); 82 | CGContextRelease(referenceImageContext); 83 | CGContextRelease(imageContext); 84 | 85 | BOOL imageEqual = (memcmp(referenceImagePixels, imagePixels, referenceImageSizeBytes) == 0); 86 | free(referenceImagePixels); 87 | free(imagePixels); 88 | return imageEqual; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import 32 | 33 | @interface UIImage (Diff) 34 | 35 | - (UIImage *)diffWithImage:(UIImage *)image; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Gabriel Handford on 3/1/09. 3 | // Copyright 2009-2013. All rights reserved. 4 | // Created by John Boiles on 10/20/11. 5 | // Copyright (c) 2011. All rights reserved 6 | // Modified by Felix Schulze on 2/11/13. 7 | // Copyright 2013. All rights reserved. 8 | // 9 | // Permission is hereby granted, free of charge, to any person 10 | // obtaining a copy of this software and associated documentation 11 | // files (the "Software"), to deal in the Software without 12 | // restriction, including without limitation the rights to use, 13 | // copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the 15 | // Software is furnished to do so, subject to the following 16 | // conditions: 17 | // 18 | // The above copyright notice and this permission notice shall be 19 | // included in all copies or substantial portions of the Software. 20 | // 21 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 23 | // OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 24 | // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 25 | // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 26 | // WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 27 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 28 | // OTHER DEALINGS IN THE SOFTWARE. 29 | // 30 | 31 | #import "UIImage+Diff.h" 32 | 33 | @implementation UIImage (Diff) 34 | 35 | - (UIImage *)diffWithImage:(UIImage *)image 36 | { 37 | if (!image) { 38 | return nil; 39 | } 40 | CGSize imageSize = CGSizeMake(MAX(self.size.width, image.size.width), MAX(self.size.height, image.size.height)); 41 | UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0.0); 42 | CGContextRef context = UIGraphicsGetCurrentContext(); 43 | [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; 44 | CGContextSetAlpha(context, 0.5f); 45 | CGContextBeginTransparencyLayer(context, NULL); 46 | [image drawInRect:CGRectMake(0, 0, image.size.width, image.size.height)]; 47 | CGContextSetBlendMode(context, kCGBlendModeDifference); 48 | CGContextSetFillColorWithColor(context,[UIColor whiteColor].CGColor); 49 | CGContextFillRect(context, CGRectMake(0, 0, self.size.width, self.size.height)); 50 | CGContextEndTransparencyLayer(context); 51 | UIImage *returnImage = UIGraphicsGetImageFromCurrentImageContext(); 52 | UIGraphicsEndImageContext(); 53 | return returnImage; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For the FBSnapshotTestCase software 4 | 5 | Copyright (c) 2013, Facebook, Inc. 6 | All rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions are met: 10 | 11 | * Redistributions of source code must retain the above copyright notice, 12 | this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | * Neither the name Facebook nor the names of its contributors may be used to 17 | endorse or promote products derived from this software without specific 18 | prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /Example/Pods/FBSnapshotTestCase/README.md: -------------------------------------------------------------------------------- 1 | FBSnapshotTestCase 2 | ====================== 3 | 4 | [![Build Status](https://travis-ci.org/facebook/ios-snapshot-test-case.svg)](https://travis-ci.org/facebook/ios-snapshot-test-case) 5 | 6 | What it does 7 | ------------ 8 | 9 | A "snapshot test case" takes a configured `UIView` or `CALayer` and uses the 10 | `renderInContext:` method to get an image snapshot of its contents. It 11 | compares this snapshot to a "reference image" stored in your source code 12 | repository and fails the test if the two images don't match. 13 | 14 | Why? 15 | ---- 16 | 17 | At Facebook we write a lot of UI code. As you might imagine, each type of 18 | feed story is rendered using a subclass of `UIView`. There are a lot of edge 19 | cases that we want to handle correctly: 20 | 21 | - What if there is more text than can fit in the space available? 22 | - What if an image doesn't match the size of an image view? 23 | - What should the highlighted state look like? 24 | 25 | It's straightforward to test logic code, but less obvious how you should test 26 | views. You can do a lot of rectangle asserts, but these are hard to understand 27 | or visualize. Looking at an image diff shows you exactly what changed and how 28 | it will look to users. 29 | 30 | We developed `FBSnapshotTestCase` to make snapshot tests easy. 31 | 32 | Installation with CocoaPods 33 | --------------------------- 34 | 35 | 1. Add the following lines to your Podfile: 36 | 37 | ``` 38 | target "Tests" do 39 | pod 'FBSnapshotTestCase' 40 | end 41 | ``` 42 | 43 | Replace "Tests" with the name of your test project. 44 | 45 | 2. Define `FB_REFERENCE_IMAGE_DIR` in `GCC_PREPROCESSOR_DEFINITIONS`. This should 46 | point to the directory where you want reference images to be stored. At Facebook, 47 | we normally use this: 48 | 49 | `GCC_PREPROCESSOR_DEFINITIONS = $(inherited) FB_REFERENCE_IMAGE_DIR="\"$(SOURCE_ROOT)/$(PROJECT_NAME)Tests/ReferenceImages\""` 50 | 51 | Creating a snapshot test 52 | ------------------------ 53 | 54 | 1. Subclass `FBSnapshotTestCase` instead of `XCTestCase`. 55 | 2. From within your test, use `FBSnapshotVerifyView`. 56 | 3. Run the test once with `self.recordMode = YES;` in the test's `-setUp` 57 | method. (This creates the reference images on disk.) 58 | 4. Remove the line enabling record mode and run the test. 59 | 60 | Features 61 | -------- 62 | 63 | - Automatically names reference images on disk according to test class and 64 | selector. 65 | - Prints a descriptive error message to the console on failure. (Bonus: 66 | failure message includes a one-line command to see an image diff if 67 | you have [Kaleidoscope](http://www.kaleidoscopeapp.com) installed.) 68 | - Supply an optional "identifier" if you want to perform multiple snapshots 69 | in a single test method. 70 | - Support for `CALayer` via `FBSnapshotVerifyLayer`. 71 | 72 | Notes 73 | ----- 74 | 75 | Your unit test must be an "application test", not a "logic test." (That is, it 76 | must be run within the Simulator so that it has access to UIKit.) In Xcode 5 77 | and later new projects only offer application tests, but older projects will 78 | have separate targets for the two types. 79 | 80 | Authors 81 | ------- 82 | 83 | `FBSnapshotTestCase` was written at Facebook by 84 | [Jonathan Dann](https://facebook.com/j.p.dann) with significant contributions by 85 | [Todd Krabach](https://facebook.com/toddkrabach). 86 | 87 | License 88 | ------- 89 | 90 | `FBSnapshotTestCase` is BSD-licensed. See `LICENSE`. 91 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/FBSnapshotTestCase/FBSnapshotTestCase.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/FBSnapshotTestCase/FBSnapshotTestController.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/FBSnapshotTestCase/UIImage+Compare.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/FBSnapshotTestCase/UIImage+Diff.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JOTextField/JOTextField.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/JOTextField.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/JOTextField/Vars.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/Vars.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/FloatConversion.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/WebCore/FloatConversion.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POP.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POP.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAction.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAction.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimatableProperty.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimatableProperty.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationEvent.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationEvent.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationEventInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationEventInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationExtras.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationExtras.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationPrivate.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationPrivate.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationRuntime.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationRuntime.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationTracer.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationTracer.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimationTracerInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationTracerInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPAnimatorPrivate.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimatorPrivate.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPBasicAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPBasicAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPBasicAnimationInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPBasicAnimationInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPCGUtils.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPCGUtils.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPCustomAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPCustomAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPDecayAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPDecayAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPDecayAnimationInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPDecayAnimationInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPDefines.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPGeometry.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPGeometry.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPLayerExtras.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPLayerExtras.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPMath.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPMath.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPPropertyAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPPropertyAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPPropertyAnimationInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPPropertyAnimationInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPSpringAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPSpringAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPSpringAnimationInternal.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPSpringAnimationInternal.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPSpringSolver.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPSpringSolver.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/POPVector.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPVector.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/TransformationMatrix.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/WebCore/TransformationMatrix.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/pop/UnitBezier.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/WebCore/UnitBezier.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/FBSnapshotTestCase/FBSnapshotTestCase.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestCase.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/FBSnapshotTestCase/FBSnapshotTestController.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/FBSnapshotTestController.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/FBSnapshotTestCase/UIImage+Compare.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Compare.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/FBSnapshotTestCase/UIImage+Diff.h: -------------------------------------------------------------------------------- 1 | ../../../FBSnapshotTestCase/FBSnapshotTestCase/UIImage+Diff.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JOTextField/JOTextField.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/JOTextField.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/JOTextField/Vars.h: -------------------------------------------------------------------------------- 1 | ../../../../../Pod/Classes/Vars.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POP.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POP.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimatableProperty.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimatableProperty.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimationEvent.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationEvent.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimationExtras.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationExtras.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimationTracer.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimationTracer.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPAnimator.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPAnimator.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPBasicAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPBasicAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPCustomAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPCustomAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPDecayAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPDecayAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPDefines.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPDefines.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPGeometry.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPGeometry.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPLayerExtras.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPLayerExtras.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPPropertyAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPPropertyAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/pop/POPSpringAnimation.h: -------------------------------------------------------------------------------- 1 | ../../../pop/pop/POPSpringAnimation.h -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/JOTextField.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "JOTextField", 3 | "version": "0.1.0", 4 | "summary": "A short description of JOTextField.", 5 | "description": "JOTextField is a custom version of UITextField that Includes Validations and more", 6 | "homepage": "https://github.com/lojals/JOTextField", 7 | "license": "MIT", 8 | "authors": { 9 | "Jorge Ovalle": "jroz9105@gmail.com" 10 | }, 11 | "source": { 12 | "git": "https://github.com/lojals/JOTextField.git", 13 | "tag": "0.1.0" 14 | }, 15 | "platforms": { 16 | "ios": "7.0" 17 | }, 18 | "requires_arc": true, 19 | "source_files": "Pod/Classes/**/*", 20 | "resource_bundles": { 21 | "JOTextField": [ 22 | "Pod/Assets/*.png" 23 | ] 24 | }, 25 | "frameworks": "UIKit", 26 | "dependencies": { 27 | "pop": [ 28 | "~> 1.0" 29 | ] 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FBSnapshotTestCase (1.7) 3 | - JOTextField (0.1.0): 4 | - pop (~> 1.0) 5 | - pop (1.0.7) 6 | 7 | DEPENDENCIES: 8 | - FBSnapshotTestCase 9 | - JOTextField (from `../`) 10 | 11 | EXTERNAL SOURCES: 12 | JOTextField: 13 | :path: ../ 14 | 15 | SPEC CHECKSUMS: 16 | FBSnapshotTestCase: 1eea5145c1f2fa907812ab92e1d6063a8d809b4e 17 | JOTextField: 2c2ce190f47207c4d92cb13eb9d9022117878559 18 | pop: 628ffc631644601567ee8bfaaaea493ebd7d0923 19 | 20 | COCOAPODS: 0.36.1 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-JOTextField/Pods-JOTextField-JOTextField-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-JOTextField-JOTextField.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JOTextField" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 4 | OTHER_LDFLAGS = ${PODS_JOTEXTFIELD_JOTEXTFIELD_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-JOTextField/Pods-JOTextField-JOTextField-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JOTextField_JOTextField : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JOTextField_JOTextField 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-JOTextField/Pods-JOTextField-JOTextField-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-JOTextField-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-JOTextField/Pods-JOTextField-JOTextField.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_JOTEXTFIELD_JOTEXTFIELD_OTHER_LDFLAGS = -framework "UIKit" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-pop/Pods-JOTextField-pop-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-JOTextField-pop.xcconfig" 2 | CLANG_CXX_LANGUAGE_STANDARD = ${PODS_JOTEXTFIELD_POP_CLANG_CXX_LANGUAGE_STANDARD} 3 | CLANG_CXX_LIBRARY = ${PODS_JOTEXTFIELD_POP_CLANG_CXX_LIBRARY} 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/pop" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_LDFLAGS = ${PODS_JOTEXTFIELD_POP_OTHER_LDFLAGS} -ObjC 7 | PODS_ROOT = ${SRCROOT} 8 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-pop/Pods-JOTextField-pop-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JOTextField_pop : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JOTextField_pop 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-pop/Pods-JOTextField-pop-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-JOTextField-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField-pop/Pods-JOTextField-pop.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_JOTEXTFIELD_POP_CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | PODS_JOTEXTFIELD_POP_CLANG_CXX_LIBRARY = libc++ 3 | PODS_JOTEXTFIELD_POP_OTHER_LDFLAGS = -l"c++" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## JOTextField 5 | 6 | Copyright (c) 2015 Jorge Ovalle 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## pop 28 | 29 | BSD License 30 | 31 | For Pop software 32 | 33 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 34 | 35 | Redistribution and use in source and binary forms, with or without modification, 36 | are permitted provided that the following conditions are met: 37 | 38 | * Redistributions of source code must retain the above copyright notice, this 39 | list of conditions and the following disclaimer. 40 | 41 | * Redistributions in binary form must reproduce the above copyright notice, 42 | this list of conditions and the following disclaimer in the documentation 43 | and/or other materials provided with the distribution. 44 | 45 | * Neither the name Facebook nor the names of its contributors may be used to 46 | endorse or promote products derived from this software without specific 47 | prior written permission. 48 | 49 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 50 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 51 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 52 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 53 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 54 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 55 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 56 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 57 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 58 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 59 | 60 | Generated by CocoaPods - http://cocoapods.org 61 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField-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 | Copyright (c) 2015 Jorge Ovalle <jroz9105@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | JOTextField 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | BSD License 45 | 46 | For Pop software 47 | 48 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 49 | 50 | Redistribution and use in source and binary forms, with or without modification, 51 | are permitted provided that the following conditions are met: 52 | 53 | * Redistributions of source code must retain the above copyright notice, this 54 | list of conditions and the following disclaimer. 55 | 56 | * Redistributions in binary form must reproduce the above copyright notice, 57 | this list of conditions and the following disclaimer in the documentation 58 | and/or other materials provided with the distribution. 59 | 60 | * Neither the name Facebook nor the names of its contributors may be used to 61 | endorse or promote products derived from this software without specific 62 | prior written permission. 63 | 64 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 65 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 66 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 67 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 68 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 69 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 70 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 71 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 72 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 73 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 74 | 75 | Title 76 | pop 77 | Type 78 | PSGroupSpecifier 79 | 80 | 81 | FooterText 82 | Generated by CocoaPods - http://cocoapods.org 83 | Title 84 | 85 | Type 86 | PSGroupSpecifier 87 | 88 | 89 | StringsTable 90 | Acknowledgements 91 | Title 92 | Acknowledgements 93 | 94 | 95 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_JOTextField : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_JOTextField 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // JOTextField 10 | #define COCOAPODS_POD_AVAILABLE_JOTextField 11 | #define COCOAPODS_VERSION_MAJOR_JOTextField 0 12 | #define COCOAPODS_VERSION_MINOR_JOTextField 1 13 | #define COCOAPODS_VERSION_PATCH_JOTextField 0 14 | 15 | // pop 16 | #define COCOAPODS_POD_AVAILABLE_pop 17 | #define COCOAPODS_VERSION_MAJOR_pop 1 18 | #define COCOAPODS_VERSION_MINOR_pop 0 19 | #define COCOAPODS_VERSION_PATCH_pop 7 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_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 | install_resource() 12 | { 13 | case $1 in 14 | *.storyboard) 15 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 16 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 17 | ;; 18 | *.xib) 19 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 20 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 21 | ;; 22 | *.framework) 23 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 26 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 27 | ;; 28 | *.xcdatamodel) 29 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 30 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 31 | ;; 32 | *.xcdatamodeld) 33 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 34 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 35 | ;; 36 | *.xcmappingmodel) 37 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 38 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 39 | ;; 40 | *.xcassets) 41 | XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'" 42 | ;; 43 | /*) 44 | echo "$1" 45 | echo "$1" >> "$RESOURCES_TO_COPY" 46 | ;; 47 | *) 48 | echo "${PODS_ROOT}/$1" 49 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 50 | ;; 51 | esac 52 | } 53 | if [[ "$CONFIGURATION" == "Debug" ]]; then 54 | install_resource "${BUILT_PRODUCTS_DIR}/JOTextField.bundle" 55 | fi 56 | if [[ "$CONFIGURATION" == "Release" ]]; then 57 | install_resource "${BUILT_PRODUCTS_DIR}/JOTextField.bundle" 58 | fi 59 | 60 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 61 | if [[ "${ACTION}" == "install" ]]; then 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | fi 64 | rm -f "$RESOURCES_TO_COPY" 65 | 66 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 67 | then 68 | case "${TARGETED_DEVICE_FAMILY}" in 69 | 1,2) 70 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 71 | ;; 72 | 1) 73 | TARGET_DEVICE_ARGS="--target-device iphone" 74 | ;; 75 | 2) 76 | TARGET_DEVICE_ARGS="--target-device ipad" 77 | ;; 78 | *) 79 | TARGET_DEVICE_ARGS="--target-device mac" 80 | ;; 81 | esac 82 | while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT") 83 | echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | fi 85 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" -isystem "${PODS_ROOT}/Headers/Public/JOTextField" -isystem "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-JOTextField-JOTextField" -l"Pods-JOTextField-pop" -l"c++" -framework "UIKit" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-JOTextField/Pods-JOTextField.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" -isystem "${PODS_ROOT}/Headers/Public/JOTextField" -isystem "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-JOTextField-JOTextField" -l"Pods-JOTextField-pop" -l"c++" -framework "UIKit" 7 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-FBSnapshotTestCase/Pods-Tests-FBSnapshotTestCase-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-Tests-FBSnapshotTestCase.xcconfig" 2 | FRAMEWORK_SEARCH_PATHS = ${PODS_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS} 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 5 | OTHER_LDFLAGS = ${PODS_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS} -ObjC 6 | PODS_ROOT = ${SRCROOT} 7 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-FBSnapshotTestCase/Pods-Tests-FBSnapshotTestCase-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests_FBSnapshotTestCase : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests_FBSnapshotTestCase 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-FBSnapshotTestCase/Pods-Tests-FBSnapshotTestCase-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-FBSnapshotTestCase/Pods-Tests-FBSnapshotTestCase.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TESTS_FBSNAPSHOTTESTCASE_FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 2 | PODS_TESTS_FBSNAPSHOTTESTCASE_OTHER_LDFLAGS = -framework "XCTest" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-JOTextField/Pods-Tests-JOTextField-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-Tests-JOTextField.xcconfig" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/JOTextField" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 4 | OTHER_LDFLAGS = ${PODS_TESTS_JOTEXTFIELD_OTHER_LDFLAGS} -ObjC 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-JOTextField/Pods-Tests-JOTextField-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests_JOTextField : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests_JOTextField 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-JOTextField/Pods-Tests-JOTextField-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-JOTextField/Pods-Tests-JOTextField.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TESTS_JOTEXTFIELD_OTHER_LDFLAGS = -framework "UIKit" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-pop/Pods-Tests-pop-Private.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods-Tests-pop.xcconfig" 2 | CLANG_CXX_LANGUAGE_STANDARD = ${PODS_TESTS_POP_CLANG_CXX_LANGUAGE_STANDARD} 3 | CLANG_CXX_LIBRARY = ${PODS_TESTS_POP_CLANG_CXX_LIBRARY} 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/pop" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_LDFLAGS = ${PODS_TESTS_POP_OTHER_LDFLAGS} -ObjC 7 | PODS_ROOT = ${SRCROOT} 8 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-pop/Pods-Tests-pop-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests_pop : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests_pop 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-pop/Pods-Tests-pop-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | #import "Pods-Tests-environment.h" 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests-pop/Pods-Tests-pop.xcconfig: -------------------------------------------------------------------------------- 1 | PODS_TESTS_POP_CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | PODS_TESTS_POP_CLANG_CXX_LIBRARY = libc++ 3 | PODS_TESTS_POP_OTHER_LDFLAGS = -l"c++" -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## FBSnapshotTestCase 5 | 6 | BSD License 7 | 8 | For the FBSnapshotTestCase software 9 | 10 | Copyright (c) 2013, Facebook, Inc. 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | 16 | * Redistributions of source code must retain the above copyright notice, 17 | this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright notice, 19 | this list of conditions and the following disclaimer in the documentation 20 | and/or other materials provided with the distribution. 21 | * Neither the name Facebook nor the names of its contributors may be used to 22 | endorse or promote products derived from this software without specific 23 | prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 29 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | 37 | ## JOTextField 38 | 39 | Copyright (c) 2015 Jorge Ovalle 40 | 41 | Permission is hereby granted, free of charge, to any person obtaining a copy 42 | of this software and associated documentation files (the "Software"), to deal 43 | in the Software without restriction, including without limitation the rights 44 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 45 | copies of the Software, and to permit persons to whom the Software is 46 | furnished to do so, subject to the following conditions: 47 | 48 | The above copyright notice and this permission notice shall be included in 49 | all copies or substantial portions of the Software. 50 | 51 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 52 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 53 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 54 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 55 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 56 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 57 | THE SOFTWARE. 58 | 59 | 60 | ## pop 61 | 62 | BSD License 63 | 64 | For Pop software 65 | 66 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 67 | 68 | Redistribution and use in source and binary forms, with or without modification, 69 | are permitted provided that the following conditions are met: 70 | 71 | * Redistributions of source code must retain the above copyright notice, this 72 | list of conditions and the following disclaimer. 73 | 74 | * Redistributions in binary form must reproduce the above copyright notice, 75 | this list of conditions and the following disclaimer in the documentation 76 | and/or other materials provided with the distribution. 77 | 78 | * Neither the name Facebook nor the names of its contributors may be used to 79 | endorse or promote products derived from this software without specific 80 | prior written permission. 81 | 82 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 83 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 84 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 85 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 86 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 87 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 88 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 89 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 90 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 91 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 92 | 93 | Generated by CocoaPods - http://cocoapods.org 94 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-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 | BSD License 18 | 19 | For the FBSnapshotTestCase software 20 | 21 | Copyright (c) 2013, Facebook, Inc. 22 | All rights reserved. 23 | 24 | Redistribution and use in source and binary forms, with or without 25 | modification, are permitted provided that the following conditions are met: 26 | 27 | * Redistributions of source code must retain the above copyright notice, 28 | this list of conditions and the following disclaimer. 29 | * Redistributions in binary form must reproduce the above copyright notice, 30 | this list of conditions and the following disclaimer in the documentation 31 | and/or other materials provided with the distribution. 32 | * Neither the name Facebook nor the names of its contributors may be used to 33 | endorse or promote products derived from this software without specific 34 | prior written permission. 35 | 36 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 37 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 38 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 39 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 40 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 41 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 42 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 43 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 44 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 45 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 46 | 47 | Title 48 | FBSnapshotTestCase 49 | Type 50 | PSGroupSpecifier 51 | 52 | 53 | FooterText 54 | Copyright (c) 2015 Jorge Ovalle <jroz9105@gmail.com> 55 | 56 | Permission is hereby granted, free of charge, to any person obtaining a copy 57 | of this software and associated documentation files (the "Software"), to deal 58 | in the Software without restriction, including without limitation the rights 59 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 60 | copies of the Software, and to permit persons to whom the Software is 61 | furnished to do so, subject to the following conditions: 62 | 63 | The above copyright notice and this permission notice shall be included in 64 | all copies or substantial portions of the Software. 65 | 66 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 67 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 68 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 69 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 70 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 71 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 72 | THE SOFTWARE. 73 | 74 | Title 75 | JOTextField 76 | Type 77 | PSGroupSpecifier 78 | 79 | 80 | FooterText 81 | BSD License 82 | 83 | For Pop software 84 | 85 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 86 | 87 | Redistribution and use in source and binary forms, with or without modification, 88 | are permitted provided that the following conditions are met: 89 | 90 | * Redistributions of source code must retain the above copyright notice, this 91 | list of conditions and the following disclaimer. 92 | 93 | * Redistributions in binary form must reproduce the above copyright notice, 94 | this list of conditions and the following disclaimer in the documentation 95 | and/or other materials provided with the distribution. 96 | 97 | * Neither the name Facebook nor the names of its contributors may be used to 98 | endorse or promote products derived from this software without specific 99 | prior written permission. 100 | 101 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 102 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 103 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 104 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 105 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 106 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 107 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 108 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 109 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 110 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 111 | 112 | Title 113 | pop 114 | Type 115 | PSGroupSpecifier 116 | 117 | 118 | FooterText 119 | Generated by CocoaPods - http://cocoapods.org 120 | Title 121 | 122 | Type 123 | PSGroupSpecifier 124 | 125 | 126 | StringsTable 127 | Acknowledgements 128 | Title 129 | Acknowledgements 130 | 131 | 132 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-environment.h: -------------------------------------------------------------------------------- 1 | 2 | // To check if a library is compiled with CocoaPods you 3 | // can use the `COCOAPODS` macro definition which is 4 | // defined in the xcconfigs so it is available in 5 | // headers also when they are imported in the client 6 | // project. 7 | 8 | 9 | // FBSnapshotTestCase 10 | #define COCOAPODS_POD_AVAILABLE_FBSnapshotTestCase 11 | #define COCOAPODS_VERSION_MAJOR_FBSnapshotTestCase 1 12 | #define COCOAPODS_VERSION_MINOR_FBSnapshotTestCase 7 13 | #define COCOAPODS_VERSION_PATCH_FBSnapshotTestCase 0 14 | 15 | // JOTextField 16 | #define COCOAPODS_POD_AVAILABLE_JOTextField 17 | #define COCOAPODS_VERSION_MAJOR_JOTextField 0 18 | #define COCOAPODS_VERSION_MINOR_JOTextField 1 19 | #define COCOAPODS_VERSION_PATCH_JOTextField 0 20 | 21 | // pop 22 | #define COCOAPODS_POD_AVAILABLE_pop 23 | #define COCOAPODS_VERSION_MAJOR_pop 1 24 | #define COCOAPODS_VERSION_MINOR_pop 0 25 | #define COCOAPODS_VERSION_PATCH_pop 7 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_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 | install_resource() 12 | { 13 | case $1 in 14 | *.storyboard) 15 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 16 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 17 | ;; 18 | *.xib) 19 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 20 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 21 | ;; 22 | *.framework) 23 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 25 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 26 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 27 | ;; 28 | *.xcdatamodel) 29 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 30 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 31 | ;; 32 | *.xcdatamodeld) 33 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 34 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 35 | ;; 36 | *.xcmappingmodel) 37 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 38 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 39 | ;; 40 | *.xcassets) 41 | XCASSET_FILES="$XCASSET_FILES '${PODS_ROOT}/$1'" 42 | ;; 43 | /*) 44 | echo "$1" 45 | echo "$1" >> "$RESOURCES_TO_COPY" 46 | ;; 47 | *) 48 | echo "${PODS_ROOT}/$1" 49 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 50 | ;; 51 | esac 52 | } 53 | if [[ "$CONFIGURATION" == "Debug" ]]; then 54 | install_resource "${BUILT_PRODUCTS_DIR}/JOTextField.bundle" 55 | fi 56 | if [[ "$CONFIGURATION" == "Release" ]]; then 57 | install_resource "${BUILT_PRODUCTS_DIR}/JOTextField.bundle" 58 | fi 59 | 60 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 61 | if [[ "${ACTION}" == "install" ]]; then 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | fi 64 | rm -f "$RESOURCES_TO_COPY" 65 | 66 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 67 | then 68 | case "${TARGETED_DEVICE_FAMILY}" in 69 | 1,2) 70 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 71 | ;; 72 | 1) 73 | TARGET_DEVICE_ARGS="--target-device iphone" 74 | ;; 75 | 2) 76 | TARGET_DEVICE_ARGS="--target-device ipad" 77 | ;; 78 | *) 79 | TARGET_DEVICE_ARGS="--target-device mac" 80 | ;; 81 | esac 82 | while read line; do XCASSET_FILES="$XCASSET_FILES '$line'"; done <<<$(find "$PWD" -name "*.xcassets" | egrep -v "^$PODS_ROOT") 83 | echo $XCASSET_FILES | xargs actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | fi 85 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" -isystem "${PODS_ROOT}/Headers/Public/JOTextField" -isystem "${PODS_ROOT}/Headers/Public/pop" 7 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-FBSnapshotTestCase" -l"Pods-Tests-JOTextField" -l"Pods-Tests-pop" -l"c++" -framework "UIKit" -framework "XCTest" 8 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-Tests/Pods-Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CLANG_CXX_LANGUAGE_STANDARD = c++11 2 | CLANG_CXX_LIBRARY = libc++ 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/Developer/Library/Frameworks" "$(PLATFORM_DIR)/Developer/Library/Frameworks" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" "${PODS_ROOT}/Headers/Public/JOTextField" "${PODS_ROOT}/Headers/Public/pop" 6 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBSnapshotTestCase" -isystem "${PODS_ROOT}/Headers/Public/JOTextField" -isystem "${PODS_ROOT}/Headers/Public/pop" 7 | OTHER_LDFLAGS = $(inherited) -ObjC -l"Pods-Tests-FBSnapshotTestCase" -l"Pods-Tests-JOTextField" -l"Pods-Tests-pop" -l"c++" -framework "UIKit" -framework "XCTest" 8 | OTHER_LIBTOOLFLAGS = $(OTHER_LDFLAGS) 9 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Example/Pods/pop/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For Pop software 4 | 5 | Copyright (c) 2014, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POP.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #ifndef POP_POP_H 11 | #define POP_POP_H 12 | 13 | #import 14 | #import 15 | #import 16 | #import 17 | #import 18 | #import 19 | #import 20 | #import 21 | #import 22 | #import 23 | #import 24 | #import 25 | #import 26 | 27 | 28 | #endif /* POP_POP_H */ 29 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAction.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #ifndef POPACTION_H 11 | #define POPACTION_H 12 | 13 | #import 14 | #import 15 | 16 | #ifdef __cplusplus 17 | 18 | namespace POP { 19 | 20 | /** 21 | @abstract Disables Core Animation actions using RAII. 22 | @discussion The disablement of actions is scoped to the current transaction. 23 | */ 24 | class ActionDisabler 25 | { 26 | BOOL state; 27 | 28 | public: 29 | ActionDisabler() POP_NOTHROW 30 | { 31 | state = [CATransaction disableActions]; 32 | [CATransaction setDisableActions:YES]; 33 | } 34 | 35 | ~ActionDisabler() 36 | { 37 | [CATransaction setDisableActions:state]; 38 | } 39 | }; 40 | 41 | /** 42 | @abstract Enables Core Animation actions using RAII. 43 | @discussion The enablement of actions is scoped to the current transaction. 44 | */ 45 | class ActionEnabler 46 | { 47 | BOOL state; 48 | 49 | public: 50 | ActionEnabler() POP_NOTHROW 51 | { 52 | state = [CATransaction disableActions]; 53 | [CATransaction setDisableActions:NO]; 54 | } 55 | 56 | ~ActionEnabler() 57 | { 58 | [CATransaction setDisableActions:state]; 59 | } 60 | }; 61 | 62 | } 63 | 64 | #endif /* __cplusplus */ 65 | 66 | #endif /* POPACTION_H */ 67 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationEvent.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | @abstract Enumeraton of animation event types. 14 | */ 15 | typedef NS_ENUM(NSUInteger, POPAnimationEventType) { 16 | kPOPAnimationEventPropertyRead = 0, 17 | kPOPAnimationEventPropertyWrite, 18 | kPOPAnimationEventToValueUpdate, 19 | kPOPAnimationEventFromValueUpdate, 20 | kPOPAnimationEventVelocityUpdate, 21 | kPOPAnimationEventBouncinessUpdate, 22 | kPOPAnimationEventSpeedUpdate, 23 | kPOPAnimationEventFrictionUpdate, 24 | kPOPAnimationEventMassUpdate, 25 | kPOPAnimationEventTensionUpdate, 26 | kPOPAnimationEventDidStart, 27 | kPOPAnimationEventDidStop, 28 | kPOPAnimationEventDidReachToValue, 29 | kPOPAnimationEventAutoreversed 30 | }; 31 | 32 | /** 33 | @abstract The base animation event class. 34 | */ 35 | @interface POPAnimationEvent : NSObject 36 | 37 | /** 38 | @abstract The event type. See {@ref POPAnimationEventType} for possible values. 39 | */ 40 | @property (readonly, nonatomic, assign) POPAnimationEventType type; 41 | 42 | /** 43 | @abstract The time of event. 44 | */ 45 | @property (readonly, nonatomic, assign) CFTimeInterval time; 46 | 47 | /** 48 | @abstract Optional string describing the animation at time of event. 49 | */ 50 | @property (readonly, nonatomic, copy) NSString *animationDescription; 51 | 52 | @end 53 | 54 | /** 55 | @abstract An animation event subclass for recording value and velocity. 56 | */ 57 | @interface POPAnimationValueEvent : POPAnimationEvent 58 | 59 | /** 60 | @abstract The value recorded. 61 | */ 62 | @property (readonly, nonatomic, strong) id value; 63 | 64 | /** 65 | @abstract The velocity recorded, if any. 66 | */ 67 | @property (readonly, nonatomic, strong) id velocity; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationEvent.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPAnimationEvent.h" 11 | #import "POPAnimationEventInternal.h" 12 | 13 | static NSString *stringFromType(POPAnimationEventType aType) 14 | { 15 | switch (aType) { 16 | case kPOPAnimationEventPropertyRead: 17 | return @"read"; 18 | case kPOPAnimationEventPropertyWrite: 19 | return @"write"; 20 | case kPOPAnimationEventToValueUpdate: 21 | return @"toValue"; 22 | case kPOPAnimationEventFromValueUpdate: 23 | return @"fromValue"; 24 | case kPOPAnimationEventVelocityUpdate: 25 | return @"velocity"; 26 | case kPOPAnimationEventSpeedUpdate: 27 | return @"speed"; 28 | case kPOPAnimationEventBouncinessUpdate: 29 | return @"bounciness"; 30 | case kPOPAnimationEventFrictionUpdate: 31 | return @"friction"; 32 | case kPOPAnimationEventMassUpdate: 33 | return @"mass"; 34 | case kPOPAnimationEventTensionUpdate: 35 | return @"tension"; 36 | case kPOPAnimationEventDidStart: 37 | return @"didStart"; 38 | case kPOPAnimationEventDidStop: 39 | return @"didStop"; 40 | case kPOPAnimationEventDidReachToValue: 41 | return @"didReachToValue"; 42 | case kPOPAnimationEventAutoreversed: 43 | return @"autoreversed"; 44 | default: 45 | return nil; 46 | } 47 | } 48 | 49 | @implementation POPAnimationEvent 50 | @synthesize type = _type; 51 | @synthesize time = _time; 52 | @synthesize animationDescription = _animationDescription; 53 | 54 | - (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime 55 | { 56 | self = [super init]; 57 | if (nil != self) { 58 | _type = aType; 59 | _time = aTime; 60 | } 61 | return self; 62 | } 63 | 64 | - (NSString *)description 65 | { 66 | NSMutableString *s = [NSMutableString stringWithFormat:@""]; 69 | return s; 70 | } 71 | 72 | // subclass override 73 | - (void)_appendDescription:(NSMutableString *)s 74 | { 75 | if (0 != _animationDescription.length) { 76 | [s appendFormat:@"; animation = %@", _animationDescription]; 77 | } 78 | } 79 | 80 | @end 81 | 82 | @implementation POPAnimationValueEvent 83 | @synthesize value = _value; 84 | @synthesize velocity = _velocity; 85 | 86 | - (instancetype)initWithType:(POPAnimationEventType)aType time:(CFTimeInterval)aTime value:(id)aValue 87 | { 88 | self = [self initWithType:aType time:aTime]; 89 | if (nil != self) { 90 | _value = aValue; 91 | } 92 | return self; 93 | } 94 | 95 | - (void)_appendDescription:(NSMutableString *)s 96 | { 97 | [super _appendDescription:s]; 98 | 99 | if (nil != _value) { 100 | [s appendFormat:@"; value = %@", _value]; 101 | } 102 | 103 | if (nil != _velocity) { 104 | [s appendFormat:@"; velocity = %@", _velocity]; 105 | } 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationEventInternal.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "POPAnimationEvent.h" 13 | 14 | @interface POPAnimationEvent () 15 | 16 | /** 17 | @abstract Default initializer. 18 | */ 19 | - (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time; 20 | 21 | /** 22 | @abstract Readwrite redefinition of public property. 23 | */ 24 | @property (readwrite, nonatomic, copy) NSString *animationDescription; 25 | 26 | @end 27 | 28 | @interface POPAnimationValueEvent () 29 | 30 | /** 31 | @abstract Default initializer. 32 | */ 33 | - (instancetype)initWithType:(POPAnimationEventType)type time:(CFTimeInterval)time value:(id)value; 34 | 35 | /** 36 | @abstract Readwrite redefinition of public property. 37 | */ 38 | @property (readwrite, nonatomic, strong) id velocity; 39 | 40 | @end 41 | 42 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationExtras.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | 15 | /** 16 | @abstract The current drag coefficient. 17 | @discussion A value greater than 1.0 indicates Simulator slow-motion animations are enabled. Defaults to 1.0. 18 | */ 19 | extern CGFloat POPAnimationDragCoefficient(); 20 | 21 | @interface CAAnimation (POPAnimationExtras) 22 | 23 | /** 24 | @abstract Apply the current drag coefficient to animation speed. 25 | @discussion Convenience utility to respect Simulator slow-motion animation settings. 26 | */ 27 | - (void)pop_applyDragCoefficient; 28 | 29 | @end 30 | 31 | @interface POPSpringAnimation (POPAnimationExtras) 32 | 33 | /** 34 | @abstract Converts from spring bounciness and speed to tension, friction and mass dynamics values. 35 | */ 36 | + (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass; 37 | 38 | /** 39 | @abstract Converts from dynamics tension, friction and mass to spring bounciness and speed values. 40 | */ 41 | + (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationExtras.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPAnimationExtras.h" 11 | 12 | #import "POPAnimationPrivate.h" 13 | #import "POPMath.h" 14 | 15 | #if TARGET_OS_IPHONE 16 | #import 17 | #endif 18 | 19 | #if TARGET_IPHONE_SIMULATOR 20 | UIKIT_EXTERN CGFloat UIAnimationDragCoefficient(); // UIKit private drag coeffient, use judiciously 21 | #endif 22 | 23 | CGFloat POPAnimationDragCoefficient() 24 | { 25 | #if TARGET_IPHONE_SIMULATOR 26 | return UIAnimationDragCoefficient(); 27 | #else 28 | return 1.0; 29 | #endif 30 | } 31 | 32 | @implementation CAAnimation (POPAnimationExtras) 33 | 34 | - (void)pop_applyDragCoefficient 35 | { 36 | CGFloat k = POPAnimationDragCoefficient(); 37 | if (k != 0 && k != 1) 38 | self.speed = 1 / k; 39 | } 40 | 41 | @end 42 | 43 | @implementation POPSpringAnimation (POPAnimationExtras) 44 | 45 | static const CGFloat POPBouncy3NormalizationRange = 20.0; 46 | static const CGFloat POPBouncy3NormalizationScale = 1.7; 47 | static const CGFloat POPBouncy3BouncinessNormalizedMin = 0.0; 48 | static const CGFloat POPBouncy3BouncinessNormalizedMax = 0.8; 49 | static const CGFloat POPBouncy3SpeedNormalizedMin = 0.5; 50 | static const CGFloat POPBouncy3SpeedNormalizedMax = 200; 51 | static const CGFloat POPBouncy3FrictionInterpolationMax = 0.01; 52 | 53 | + (void)convertBounciness:(CGFloat)bounciness speed:(CGFloat)speed toTension:(CGFloat *)outTension friction:(CGFloat *)outFriction mass:(CGFloat *)outMass 54 | { 55 | double b = POPNormalize(bounciness / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange); 56 | b = POPProjectNormal(b, POPBouncy3BouncinessNormalizedMin, POPBouncy3BouncinessNormalizedMax); 57 | 58 | double s = POPNormalize(speed / POPBouncy3NormalizationScale, 0, POPBouncy3NormalizationRange); 59 | 60 | CGFloat tension = POPProjectNormal(s, POPBouncy3SpeedNormalizedMin, POPBouncy3SpeedNormalizedMax); 61 | CGFloat friction = POPQuadraticOutInterpolation(b, POPBouncy3NoBounce(tension), POPBouncy3FrictionInterpolationMax); 62 | 63 | tension = POP_ANIMATION_TENSION_FOR_QC_TENSION(tension); 64 | friction = POP_ANIMATION_FRICTION_FOR_QC_FRICTION(friction); 65 | 66 | if (outTension) { 67 | *outTension = tension; 68 | } 69 | 70 | if (outFriction) { 71 | *outFriction = friction; 72 | } 73 | 74 | if (outMass) { 75 | *outMass = 1.0; 76 | } 77 | } 78 | 79 | + (void)convertTension:(CGFloat)tension friction:(CGFloat)friction toBounciness:(CGFloat *)outBounciness speed:(CGFloat *)outSpeed 80 | { 81 | // Convert to QC values, in which our calculations are done. 82 | CGFloat qcFriction = QC_FRICTION_FOR_POP_ANIMATION_FRICTION(friction); 83 | CGFloat qcTension = QC_TENSION_FOR_POP_ANIMATION_TENSION(tension); 84 | 85 | // Friction is a function of bounciness and tension, according to the following: 86 | // friction = POPQuadraticOutInterpolation(b, POPBouncy3NoBounce(tension), POPBouncy3FrictionInterpolationMax); 87 | // Solve for bounciness, given a tension and friction. 88 | 89 | CGFloat nobounceTension = POPBouncy3NoBounce(qcTension); 90 | CGFloat bounciness1, bounciness2; 91 | 92 | POPQuadraticSolve((nobounceTension - POPBouncy3FrictionInterpolationMax), // a 93 | 2 * (POPBouncy3FrictionInterpolationMax - nobounceTension), // b 94 | (nobounceTension - qcFriction), // c 95 | bounciness1, // x1 96 | bounciness2); // x2 97 | 98 | 99 | // Choose the quadratic solution within the normalized bounciness range 100 | CGFloat projectedNormalizedBounciness = (bounciness2 < POPBouncy3BouncinessNormalizedMax) ? bounciness2 : bounciness1; 101 | CGFloat projectedNormalizedSpeed = qcTension; 102 | 103 | // Reverse projection + normalization 104 | CGFloat bounciness = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3BouncinessNormalizedMax - POPBouncy3BouncinessNormalizedMin)) * (projectedNormalizedBounciness - POPBouncy3BouncinessNormalizedMin); 105 | CGFloat speed = ((POPBouncy3NormalizationRange * POPBouncy3NormalizationScale) / (POPBouncy3SpeedNormalizedMax - POPBouncy3SpeedNormalizedMin)) * (projectedNormalizedSpeed - POPBouncy3SpeedNormalizedMin); 106 | 107 | // Write back results 108 | if (outBounciness) { 109 | *outBounciness = bounciness; 110 | } 111 | 112 | if (outSpeed) { 113 | *outSpeed = speed; 114 | } 115 | } 116 | 117 | @end 118 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationPrivate.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #define POP_ANIMATION_FRICTION_FOR_QC_FRICTION(qcFriction) (25.0 + (((qcFriction - 8.0) / 2.0) * (25.0 - 19.0))) 13 | #define POP_ANIMATION_TENSION_FOR_QC_TENSION(qcTension) (194.0 + (((qcTension - 30.0) / 50.0) * (375.0 - 194.0))) 14 | 15 | #define QC_FRICTION_FOR_POP_ANIMATION_FRICTION(fbFriction) (8.0 + 2.0 * ((fbFriction - 25.0)/(25.0 - 19.0))) 16 | #define QC_TENSION_FOR_POP_ANIMATION_TENSION(fbTension) (30.0 + 50.0 * ((fbTension - 194.0)/(375.0 - 194.0))) 17 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationRuntime.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | #import "POPVector.h" 15 | 16 | enum POPValueType 17 | { 18 | kPOPValueUnknown = 0, 19 | kPOPValueInteger, 20 | kPOPValueFloat, 21 | kPOPValuePoint, 22 | kPOPValueSize, 23 | kPOPValueRect, 24 | kPOPValueEdgeInsets, 25 | kPOPValueAffineTransform, 26 | kPOPValueTransform, 27 | kPOPValueRange, 28 | kPOPValueColor, 29 | }; 30 | 31 | using namespace POP; 32 | 33 | /** 34 | Returns value type based on objc type description, given list of supported value types and length. 35 | */ 36 | extern POPValueType POPSelectValueType(const char *objctype, const POPValueType *types, size_t length); 37 | 38 | /** 39 | Returns value type based on objc object, given a list of supported value types and length. 40 | */ 41 | extern POPValueType POPSelectValueType(id obj, const POPValueType *types, size_t length); 42 | 43 | /** 44 | Array of all value types. 45 | */ 46 | extern const POPValueType kPOPAnimatableAllTypes[10]; 47 | 48 | /** 49 | Array of all value types supported for animation. 50 | */ 51 | extern const POPValueType kPOPAnimatableSupportTypes[8]; 52 | 53 | /** 54 | Returns a string description of a value type. 55 | */ 56 | extern NSString *POPValueTypeToString(POPValueType t); 57 | 58 | /** 59 | Returns a mutable dictionary of weak pointer keys to weak pointer values. 60 | */ 61 | extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToWeakPointer(NSUInteger capacity) CF_RETURNS_RETAINED; 62 | 63 | /** 64 | Returns a mutable dictionary of weak pointer keys to weak pointer values. 65 | */ 66 | extern CFMutableDictionaryRef POPDictionaryCreateMutableWeakPointerToStrongObject(NSUInteger capacity) CF_RETURNS_RETAINED; 67 | 68 | /** 69 | Box a vector. 70 | */ 71 | extern id POPBox(VectorConstRef vec, POPValueType type, bool force = false); 72 | 73 | /** 74 | Unbox a vector. 75 | */ 76 | extern VectorRef POPUnbox(id value, POPValueType &type, NSUInteger &count, bool validate); 77 | 78 | /** 79 | Read/write block typedefs for convenience. 80 | */ 81 | typedef void(^pop_animatable_read_block)(id obj, CGFloat *value); 82 | typedef void(^pop_animatable_write_block)(id obj, const CGFloat *value); 83 | 84 | /** 85 | Read object value and return a Vector4r. 86 | */ 87 | NS_INLINE Vector4r read_values(pop_animatable_read_block read, id obj, size_t count) 88 | { 89 | Vector4r vec = Vector4r::Zero(); 90 | if (0 == count) 91 | return vec; 92 | 93 | read(obj, vec.data()); 94 | 95 | return vec; 96 | } 97 | 98 | NS_INLINE NSString *POPStringFromBOOL(BOOL value) 99 | { 100 | return value ? @"YES" : @"NO"; 101 | } 102 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationTracer.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @class POPAnimation; 15 | 16 | /** 17 | @abstract Tracer of animation events to fasciliate unit testing & debugging. 18 | */ 19 | @interface POPAnimationTracer : NSObject 20 | 21 | /** 22 | @abstract Start recording events. 23 | */ 24 | - (void)start; 25 | 26 | /** 27 | @abstract Stop recording events. 28 | */ 29 | - (void)stop; 30 | 31 | /** 32 | @abstract Resets any recoded events. Continues recording events if already started. 33 | */ 34 | - (void)reset; 35 | 36 | /** 37 | @abstract Property representing all recorded events. 38 | @discussion Events are returned in order of occurence. 39 | */ 40 | @property (nonatomic, assign, readonly) NSArray *allEvents; 41 | 42 | /** 43 | @abstract Property representing all recorded write events for convenience. 44 | @discussion Events are returned in order of occurence. 45 | */ 46 | @property (nonatomic, assign, readonly) NSArray *writeEvents; 47 | 48 | /** 49 | @abstract Queries for events of specified type. 50 | @param type The type of event to return. 51 | @returns An array of events of specified type in order of occurence. 52 | */ 53 | - (NSArray *)eventsWithType:(POPAnimationEventType)type; 54 | 55 | /** 56 | @abstract Property indicating whether tracer should automatically log events and reset collection on animation completion. 57 | */ 58 | @property (nonatomic, assign) BOOL shouldLogAndResetOnCompletion; 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationTracer.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPAnimationTracer.h" 11 | 12 | #import 13 | 14 | #import "POPAnimationEventInternal.h" 15 | #import "POPAnimationInternal.h" 16 | #import "POPSpringAnimation.h" 17 | 18 | @implementation POPAnimationTracer 19 | { 20 | __weak POPAnimation *_animation; 21 | POPAnimationState *_animationState; 22 | NSMutableArray *_events; 23 | BOOL _animationHasVelocity; 24 | } 25 | @synthesize shouldLogAndResetOnCompletion = _shouldLogAndResetOnCompletion; 26 | 27 | static POPAnimationEvent *create_event(POPAnimationTracer *self, POPAnimationEventType type, id value = nil, bool recordAnimation = false) 28 | { 29 | bool useLocalTime = 0 != self->_animationState->startTime; 30 | CFTimeInterval time = useLocalTime 31 | ? self->_animationState->lastTime - self->_animationState->startTime 32 | : self->_animationState->lastTime; 33 | 34 | POPAnimationEvent *event; 35 | 36 | if (!value) { 37 | event = [[POPAnimationEvent alloc] initWithType:type time:time]; 38 | } else { 39 | event = [[POPAnimationValueEvent alloc] initWithType:type time:time value:value]; 40 | if (self->_animationHasVelocity) { 41 | [(POPAnimationValueEvent *)event setVelocity:[(POPSpringAnimation *)self->_animation velocity]]; 42 | } 43 | } 44 | 45 | if (recordAnimation) { 46 | event.animationDescription = [self->_animation description]; 47 | } 48 | 49 | return event; 50 | } 51 | 52 | - (id)initWithAnimation:(POPAnimation *)anAnim 53 | { 54 | self = [super init]; 55 | if (nil != self) { 56 | _animation = anAnim; 57 | _animationState = POPAnimationGetState(anAnim); 58 | _events = [[NSMutableArray alloc] initWithCapacity:50]; 59 | _animationHasVelocity = [anAnim respondsToSelector:@selector(velocity)]; 60 | } 61 | return self; 62 | } 63 | 64 | - (void)readPropertyValue:(id)aValue 65 | { 66 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventPropertyRead, aValue); 67 | [_events addObject:event]; 68 | } 69 | 70 | - (void)writePropertyValue:(id)aValue 71 | { 72 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventPropertyWrite, aValue); 73 | [_events addObject:event]; 74 | } 75 | 76 | - (void)updateToValue:(id)aValue 77 | { 78 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventToValueUpdate, aValue); 79 | [_events addObject:event]; 80 | } 81 | 82 | - (void)updateFromValue:(id)aValue 83 | { 84 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventFromValueUpdate, aValue); 85 | [_events addObject:event]; 86 | } 87 | 88 | - (void)updateVelocity:(id)aValue 89 | { 90 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventVelocityUpdate, aValue); 91 | [_events addObject:event]; 92 | } 93 | 94 | - (void)updateSpeed:(float)aFloat 95 | { 96 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventSpeedUpdate, @(aFloat)); 97 | [_events addObject:event]; 98 | } 99 | 100 | - (void)updateBounciness:(float)aFloat 101 | { 102 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventBouncinessUpdate, @(aFloat)); 103 | [_events addObject:event]; 104 | } 105 | 106 | - (void)updateFriction:(float)aFloat 107 | { 108 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventFrictionUpdate, @(aFloat)); 109 | [_events addObject:event]; 110 | } 111 | 112 | - (void)updateMass:(float)aFloat 113 | { 114 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventMassUpdate, @(aFloat)); 115 | [_events addObject:event]; 116 | } 117 | 118 | - (void)updateTension:(float)aFloat 119 | { 120 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventTensionUpdate, @(aFloat)); 121 | [_events addObject:event]; 122 | } 123 | 124 | - (void)didStart 125 | { 126 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidStart, nil, true); 127 | [_events addObject:event]; 128 | } 129 | 130 | - (void)didStop:(BOOL)finished 131 | { 132 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidStop, @(finished), true); 133 | [_events addObject:event]; 134 | 135 | if (_shouldLogAndResetOnCompletion) { 136 | NSLog(@"events:%@", self.allEvents); 137 | [self reset]; 138 | } 139 | } 140 | 141 | - (void)didReachToValue:(id)aValue 142 | { 143 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventDidReachToValue, aValue); 144 | [_events addObject:event]; 145 | } 146 | 147 | - (void)autoreversed 148 | { 149 | POPAnimationEvent *event = create_event(self, kPOPAnimationEventAutoreversed); 150 | [_events addObject:event]; 151 | } 152 | 153 | - (void)start 154 | { 155 | POPAnimationState *s = POPAnimationGetState(_animation); 156 | s->tracing = true; 157 | } 158 | 159 | - (void)stop 160 | { 161 | POPAnimationState *s = POPAnimationGetState(_animation); 162 | s->tracing = false; 163 | } 164 | 165 | - (void)reset 166 | { 167 | [_events removeAllObjects]; 168 | } 169 | 170 | - (NSArray *)allEvents 171 | { 172 | return [_events copy]; 173 | } 174 | 175 | - (NSArray *)writeEvents 176 | { 177 | return [self eventsWithType:kPOPAnimationEventPropertyWrite]; 178 | } 179 | 180 | - (NSArray *)eventsWithType:(POPAnimationEventType)aType 181 | { 182 | NSMutableArray *array = [NSMutableArray array]; 183 | for (POPAnimationEvent *event in _events) { 184 | if (aType == event.type) { 185 | [array addObject:event]; 186 | } 187 | } 188 | return array; 189 | } 190 | 191 | @end 192 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimationTracerInternal.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | @interface POPAnimationTracer (Internal) 15 | 16 | /** 17 | @abstract Designated initalizer. Pass the animation being traced. 18 | */ 19 | - (instancetype)initWithAnimation:(POPAnimation *)anAnim; 20 | 21 | /** 22 | @abstract Records read value. 23 | */ 24 | - (void)readPropertyValue:(id)aValue; 25 | 26 | /** 27 | @abstract Records write value. 28 | */ 29 | - (void)writePropertyValue:(id)aValue; 30 | 31 | /** 32 | Records to value update. 33 | */ 34 | - (void)updateToValue:(id)aValue; 35 | 36 | /** 37 | @abstract Records from value update. 38 | */ 39 | - (void)updateFromValue:(id)aValue; 40 | 41 | /** 42 | @abstract Records from value update. 43 | */ 44 | - (void)updateVelocity:(id)aValue; 45 | 46 | /** 47 | @abstract Records bounciness update. 48 | */ 49 | - (void)updateBounciness:(float)aFloat; 50 | 51 | /** 52 | @abstract Records speed update. 53 | */ 54 | - (void)updateSpeed:(float)aFloat; 55 | 56 | /** 57 | @abstract Records friction update. 58 | */ 59 | - (void)updateFriction:(float)aFloat; 60 | 61 | /** 62 | @abstract Records mass update. 63 | */ 64 | - (void)updateMass:(float)aFloat; 65 | 66 | /** 67 | @abstract Records tension update. 68 | */ 69 | - (void)updateTension:(float)aFloat; 70 | 71 | /** 72 | @abstract Records did add. 73 | */ 74 | - (void)didAdd; 75 | 76 | /** 77 | @abstract Records did start. 78 | */ 79 | - (void)didStart; 80 | 81 | /** 82 | @abstract Records did stop. 83 | */ 84 | - (void)didStop:(BOOL)finished; 85 | 86 | /** 87 | @abstract Records did reach to value. 88 | */ 89 | - (void)didReachToValue:(id)aValue; 90 | 91 | /** 92 | @abstract Records when an autoreverse animation takes place. 93 | */ 94 | - (void)autoreversed; 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimator.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @protocol POPAnimatorDelegate; 13 | 14 | /** 15 | @abstract The animator class renders animations. 16 | */ 17 | @interface POPAnimator : NSObject 18 | 19 | /** 20 | @abstract The shared animator instance. 21 | @discussion Consumers should generally use the shared instance in lieu of creating new instances. 22 | */ 23 | + (instancetype)sharedAnimator; 24 | 25 | /** 26 | @abstract The optional animator delegate. 27 | */ 28 | @property (weak, nonatomic) id delegate; 29 | 30 | @end 31 | 32 | /** 33 | @abstract The animator delegate. 34 | */ 35 | @protocol POPAnimatorDelegate 36 | 37 | /** 38 | @abstract Called on each frame before animation application. 39 | */ 40 | - (void)animatorWillAnimate:(POPAnimator *)animator; 41 | 42 | /** 43 | @abstract Called on each frame after animation application. 44 | */ 45 | - (void)animatorDidAnimate:(POPAnimator *)animator; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPAnimatorPrivate.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class POPAnimation; 13 | 14 | @protocol POPAnimatorObserving 15 | @required 16 | 17 | /** 18 | @abstract Called on each observer after animator has advanced. Core Animation actions are disabled by default. 19 | */ 20 | - (void)animatorDidAnimate:(POPAnimator *)animator; 21 | 22 | @end 23 | 24 | @interface POPAnimator () 25 | 26 | #if !TARGET_OS_IPHONE 27 | /** 28 | Determines whether or not to use a high priority background thread for animation updates. Using a background thread can result in faster, more responsive updates, but may be less compatible. Defaults to YES. 29 | */ 30 | + (BOOL)disableBackgroundThread; 31 | + (void)setDisableBackgroundThread:(BOOL)flag; 32 | #endif 33 | 34 | /** 35 | Used for externally driven animator instances. 36 | */ 37 | @property (assign, nonatomic) BOOL disableDisplayLink; 38 | 39 | /** 40 | Time used when starting animations. Defaults to 0 meaning current media time is used. Exposed for unit testing. 41 | */ 42 | @property (assign, nonatomic) CFTimeInterval beginTime; 43 | 44 | /** 45 | Exposed for unit testing. 46 | */ 47 | - (void)renderTime:(CFTimeInterval)time; 48 | 49 | /** 50 | Funnel methods for category additions. 51 | */ 52 | - (void)addAnimation:(POPAnimation *)anim forObject:(id)obj key:(NSString *)key; 53 | - (void)removeAllAnimationsForObject:(id)obj; 54 | - (void)removeAnimationForObject:(id)obj key:(NSString *)key; 55 | - (NSArray *)animationKeysForObject:(id)obj; 56 | - (POPAnimation *)animationForObject:(id)obj key:(NSString *)key; 57 | 58 | /** 59 | @abstract Add an animator observer. Observer will be notified of each subsequent animator advance until removal. 60 | */ 61 | - (void)addObserver:(id)observer; 62 | 63 | /** 64 | @abstract Remove an animator observer. 65 | */ 66 | - (void)removeObserver:(id)observer; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPBasicAnimation.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | @abstract A concrete basic animation class. 14 | @discussion Animation is achieved through interpolation. 15 | */ 16 | @interface POPBasicAnimation : POPPropertyAnimation 17 | 18 | /** 19 | @abstract The designated initializer. 20 | @returns An instance of a basic animation. 21 | */ 22 | + (instancetype)animation; 23 | 24 | /** 25 | @abstract Convenience initializer that returns an animation with animatable property of name. 26 | @param name The name of the animatable property. 27 | @returns An instance of a basic animation configured with specified animatable property. 28 | */ 29 | + (instancetype)animationWithPropertyNamed:(NSString *)name; 30 | 31 | /** 32 | @abstract Convenience constructor. 33 | @returns Returns a basic animation with kCAMediaTimingFunctionDefault timing function. 34 | */ 35 | + (instancetype)defaultAnimation; 36 | 37 | /** 38 | @abstract Convenience constructor. 39 | @returns Returns a basic animation with kCAMediaTimingFunctionLinear timing function. 40 | */ 41 | + (instancetype)linearAnimation; 42 | 43 | /** 44 | @abstract Convenience constructor. 45 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseIn timing function. 46 | */ 47 | + (instancetype)easeInAnimation; 48 | 49 | /** 50 | @abstract Convenience constructor. 51 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseOut timing function. 52 | */ 53 | + (instancetype)easeOutAnimation; 54 | 55 | /** 56 | @abstract Convenience constructor. 57 | @returns Returns a basic animation with kCAMediaTimingFunctionEaseInEaseOut timing function. 58 | */ 59 | + (instancetype)easeInEaseOutAnimation; 60 | 61 | /** 62 | @abstract The duration in seconds. Defaults to 0.4. 63 | */ 64 | @property (assign, nonatomic) CFTimeInterval duration; 65 | 66 | /** 67 | @abstract A timing function defining the pacing of the animation. Defaults to nil indicating pacing according to kCAMediaTimingFunctionDefault. 68 | */ 69 | @property (strong, nonatomic) CAMediaTimingFunction *timingFunction; 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPBasicAnimation.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPBasicAnimationInternal.h" 11 | 12 | @implementation POPBasicAnimation 13 | 14 | #undef __state 15 | #define __state ((POPBasicAnimationState *)_state) 16 | 17 | #pragma mark - Lifecycle 18 | 19 | + (instancetype)animation 20 | { 21 | return [[self alloc] init]; 22 | } 23 | 24 | + (instancetype)animationWithPropertyNamed:(NSString *)aName 25 | { 26 | POPBasicAnimation *anim = [self animation]; 27 | anim.property = [POPAnimatableProperty propertyWithName:aName]; 28 | return anim; 29 | } 30 | 31 | - (void)_initState 32 | { 33 | _state = new POPBasicAnimationState(self); 34 | } 35 | 36 | + (instancetype)linearAnimation 37 | { 38 | POPBasicAnimation *anim = [self animation]; 39 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionLinear]; 40 | return anim; 41 | } 42 | 43 | + (instancetype)easeInAnimation 44 | { 45 | POPBasicAnimation *anim = [self animation]; 46 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; 47 | return anim; 48 | } 49 | 50 | + (instancetype)easeOutAnimation 51 | { 52 | POPBasicAnimation *anim = [self animation]; 53 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; 54 | return anim; 55 | } 56 | 57 | + (instancetype)easeInEaseOutAnimation 58 | { 59 | POPBasicAnimation *anim = [self animation]; 60 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; 61 | return anim; 62 | } 63 | 64 | + (instancetype)defaultAnimation 65 | { 66 | POPBasicAnimation *anim = [self animation]; 67 | anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 68 | return anim; 69 | } 70 | 71 | - (id)init 72 | { 73 | return [self _init]; 74 | } 75 | 76 | #pragma mark - Properties 77 | 78 | DEFINE_RW_PROPERTY(POPBasicAnimationState, duration, setDuration:, CFTimeInterval); 79 | DEFINE_RW_PROPERTY_OBJ(POPBasicAnimationState, timingFunction, setTimingFunction:, CAMediaTimingFunction*, __state->updatedTimingFunction();); 80 | 81 | #pragma mark - Utility 82 | 83 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug 84 | { 85 | [super _appendDescription:s debug:debug]; 86 | if (__state->duration) 87 | [s appendFormat:@"; duration = %f", __state->duration]; 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPBasicAnimationInternal.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPBasicAnimation.h" 11 | #import "POPPropertyAnimationInternal.h" 12 | 13 | // default animation duration 14 | static CGFloat const kPOPAnimationDurationDefault = 0.4; 15 | 16 | // progress threshold for computing done 17 | static CGFloat const kPOPProgressThreshold = 1e-6; 18 | 19 | static void interpolate(POPValueType valueType, NSUInteger count, const CGFloat *fromVec, const CGFloat *toVec, CGFloat *outVec, CGFloat p) 20 | { 21 | switch (valueType) { 22 | case kPOPValueInteger: 23 | case kPOPValueFloat: 24 | case kPOPValuePoint: 25 | case kPOPValueSize: 26 | case kPOPValueRect: 27 | case kPOPValueEdgeInsets: 28 | case kPOPValueColor: 29 | POPInterpolateVector(count, outVec, fromVec, toVec, p); 30 | break; 31 | default: 32 | NSCAssert(false, @"unhandled type %d", valueType); 33 | break; 34 | } 35 | } 36 | 37 | struct _POPBasicAnimationState : _POPPropertyAnimationState 38 | { 39 | CAMediaTimingFunction *timingFunction; 40 | double timingControlPoints[4]; 41 | CFTimeInterval duration; 42 | CFTimeInterval timeProgress; 43 | 44 | _POPBasicAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim), 45 | timingFunction(nil), 46 | timingControlPoints{0.}, 47 | duration(kPOPAnimationDurationDefault), 48 | timeProgress(0.) 49 | { 50 | type = kPOPAnimationBasic; 51 | } 52 | 53 | bool isDone() { 54 | if (_POPPropertyAnimationState::isDone()) { 55 | return true; 56 | } 57 | return timeProgress + kPOPProgressThreshold >= 1.; 58 | } 59 | 60 | void updatedTimingFunction() 61 | { 62 | float vec[4] = {0.}; 63 | [timingFunction getControlPointAtIndex:1 values:&vec[0]]; 64 | [timingFunction getControlPointAtIndex:2 values:&vec[2]]; 65 | for (NSUInteger idx = 0; idx < POP_ARRAY_COUNT(vec); idx++) { 66 | timingControlPoints[idx] = vec[idx]; 67 | } 68 | } 69 | 70 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { 71 | // default timing function 72 | if (!timingFunction) { 73 | ((POPBasicAnimation *)self).timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault]; 74 | } 75 | 76 | // solve for normalized time, aka progresss [0, 1] 77 | CGFloat p = 1.0f; 78 | if (duration > 0.0f) { 79 | // cap local time to duration 80 | CFTimeInterval t = MIN(time - startTime, duration) / duration; 81 | p = POPTimingFunctionSolve(timingControlPoints, t, SOLVE_EPS(duration)); 82 | timeProgress = t; 83 | } else { 84 | timeProgress = 1.; 85 | } 86 | 87 | // interpolate and advance 88 | interpolate(valueType, valueCount, fromVec->data(), toVec->data(), currentVec->data(), p); 89 | progress = p; 90 | clampCurrentValue(); 91 | 92 | return true; 93 | } 94 | }; 95 | 96 | typedef struct _POPBasicAnimationState POPBasicAnimationState; 97 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPCGUtils.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #if TARGET_OS_IPHONE 12 | #import 13 | #endif 14 | #import "POPDefines.h" 15 | 16 | #if TARGET_OS_IPHONE 17 | @class UIColor; 18 | #endif 19 | 20 | POP_EXTERN_C_BEGIN 21 | 22 | NS_INLINE CGPoint values_to_point(const CGFloat values[]) 23 | { 24 | return CGPointMake(values[0], values[1]); 25 | } 26 | 27 | NS_INLINE CGSize values_to_size(const CGFloat values[]) 28 | { 29 | return CGSizeMake(values[0], values[1]); 30 | } 31 | 32 | NS_INLINE CGRect values_to_rect(const CGFloat values[]) 33 | { 34 | return CGRectMake(values[0], values[1], values[2], values[3]); 35 | } 36 | 37 | #if TARGET_OS_IPHONE 38 | 39 | NS_INLINE UIEdgeInsets values_to_edge_insets(const CGFloat values[]) 40 | { 41 | return UIEdgeInsetsMake(values[0], values[1], values[2], values[3]); 42 | } 43 | 44 | #endif 45 | 46 | NS_INLINE void values_from_point(CGFloat values[], CGPoint p) 47 | { 48 | values[0] = p.x; 49 | values[1] = p.y; 50 | } 51 | 52 | NS_INLINE void values_from_size(CGFloat values[], CGSize s) 53 | { 54 | values[0] = s.width; 55 | values[1] = s.height; 56 | } 57 | 58 | NS_INLINE void values_from_rect(CGFloat values[], CGRect r) 59 | { 60 | values[0] = r.origin.x; 61 | values[1] = r.origin.y; 62 | values[2] = r.size.width; 63 | values[3] = r.size.height; 64 | } 65 | 66 | #if TARGET_OS_IPHONE 67 | 68 | NS_INLINE void values_from_edge_insets(CGFloat values[], UIEdgeInsets i) 69 | { 70 | values[0] = i.top; 71 | values[1] = i.left; 72 | values[2] = i.bottom; 73 | values[3] = i.right; 74 | } 75 | 76 | #endif 77 | 78 | /** 79 | Takes a CGColorRef and converts it into RGBA components, if necessary. 80 | */ 81 | extern void POPCGColorGetRGBAComponents(CGColorRef color, CGFloat components[]); 82 | 83 | /** 84 | Takes RGBA components and returns a CGColorRef. 85 | */ 86 | extern CGColorRef POPCGColorRGBACreate(const CGFloat components[]) CF_RETURNS_RETAINED; 87 | 88 | /** 89 | Takes a color reference and returns a CGColor. 90 | */ 91 | extern CGColorRef POPCGColorWithColor(id color); 92 | 93 | #if TARGET_OS_IPHONE 94 | 95 | /** 96 | Takes a UIColor and converts it into RGBA components, if necessary. 97 | */ 98 | extern void POPUIColorGetRGBAComponents(UIColor *color, CGFloat components[]); 99 | 100 | /** 101 | Takes RGBA components and returns a UIColor. 102 | */ 103 | extern UIColor *POPUIColorRGBACreate(const CGFloat components[]) NS_RETURNS_RETAINED; 104 | 105 | #endif 106 | 107 | POP_EXTERN_C_END 108 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPCGUtils.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPCGUtils.h" 11 | 12 | #if TARGET_OS_IPHONE 13 | #import 14 | #else 15 | #import 16 | #endif 17 | 18 | void POPCGColorGetRGBAComponents(CGColorRef color, CGFloat components[]) 19 | { 20 | if (!color) { 21 | #if TARGET_OS_IPHONE 22 | color = [UIColor clearColor].CGColor; 23 | #else 24 | color = [NSColor clearColor].CGColor; 25 | #endif 26 | } 27 | 28 | const CGFloat *colors = CGColorGetComponents(color); 29 | size_t count = CGColorGetNumberOfComponents(color); 30 | 31 | if (4 == count) { 32 | // RGB colorspace 33 | components[0] = colors[0]; 34 | components[1] = colors[1]; 35 | components[2] = colors[2]; 36 | components[3] = colors[3]; 37 | } else if (2 == count) { 38 | // Grey colorspace 39 | components[0] = components[1] = components[2] = colors[0]; 40 | components[3] = colors[1]; 41 | } else { 42 | // Use CI to convert 43 | CIColor *ciColor = [CIColor colorWithCGColor:color]; 44 | components[0] = ciColor.red; 45 | components[1] = ciColor.green; 46 | components[2] = ciColor.blue; 47 | components[3] = ciColor.alpha; 48 | } 49 | } 50 | 51 | CGColorRef POPCGColorRGBACreate(const CGFloat components[]) 52 | { 53 | #if TARGET_OS_IPHONE 54 | CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); 55 | CGColorRef color = CGColorCreate(space, components); 56 | CGColorSpaceRelease(space); 57 | return color; 58 | #else 59 | return CGColorCreateGenericRGB(components[0], components[1], components[2], components[3]); 60 | #endif 61 | } 62 | 63 | CGColorRef POPCGColorWithColor(id color) 64 | { 65 | if (CFGetTypeID((__bridge CFTypeRef)color) == CGColorGetTypeID()) { 66 | return ((__bridge CGColorRef)color); 67 | } 68 | #if TARGET_OS_IPHONE 69 | else if ([color isKindOfClass:[UIColor class]]) { 70 | return [color CGColor]; 71 | } 72 | #else 73 | else if ([color isKindOfClass:[NSColor class]]) { 74 | return [color CGColor]; 75 | } 76 | #endif 77 | return nil; 78 | } 79 | 80 | #if TARGET_OS_IPHONE 81 | 82 | void POPUIColorGetRGBAComponents(UIColor *color, CGFloat components[]) 83 | { 84 | return POPCGColorGetRGBAComponents(color.CGColor, components); 85 | } 86 | 87 | UIColor *POPUIColorRGBACreate(const CGFloat components[]) 88 | { 89 | CGColorRef colorRef = POPCGColorRGBACreate(components); 90 | UIColor *color = [[UIColor alloc] initWithCGColor:colorRef]; 91 | CGColorRelease(colorRef); 92 | return color; 93 | } 94 | 95 | #endif 96 | 97 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPCustomAnimation.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class POPCustomAnimation; 13 | 14 | /** 15 | @abstract POPCustomAnimationBlock is the callback block of a custom animation. 16 | @discussion This block will be executed for each animation frame and should update the property or properties being animated based on current timing. 17 | @param target The object being animated. Reference the passed in target to help avoid retain loops. 18 | @param animation The custom animation instance. Use to determine the current and elapsed time since last callback. Reference the passed in animation to help avoid retain loops. 19 | @return Flag indicating whether the animation should continue animating. Return NO to indicate animation is done. 20 | */ 21 | typedef BOOL (^POPCustomAnimationBlock)(id target, POPCustomAnimation *animation); 22 | 23 | /** 24 | @abstract POPCustomAnimation is a concrete animation subclass for custom animations. 25 | */ 26 | @interface POPCustomAnimation : POPAnimation 27 | 28 | /** 29 | @abstract Creates and returns an initialized custom animation instance. 30 | @discussion This is the designated initializer. 31 | @param block The custom animation callback block. See {@ref POPCustomAnimationBlock}. 32 | @return The initialized custom animation instance. 33 | */ 34 | + (instancetype)animationWithBlock:(POPCustomAnimationBlock)block; 35 | 36 | /** 37 | @abstract The current animation time at time of callback. 38 | */ 39 | @property (readonly, nonatomic) CFTimeInterval currentTime; 40 | 41 | /** 42 | @abstract The elapsed animation time since last callback. 43 | */ 44 | @property (readonly, nonatomic) CFTimeInterval elapsedTime; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPCustomAnimation.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPCustomAnimation.h" 11 | #import "POPAnimationInternal.h" 12 | 13 | @interface POPCustomAnimation () 14 | @property (nonatomic, copy) POPCustomAnimationBlock animate; 15 | @end 16 | 17 | @implementation POPCustomAnimation 18 | @synthesize currentTime = _currentTime; 19 | @synthesize elapsedTime = _elapsedTime; 20 | @synthesize animate = _animate; 21 | 22 | + (instancetype)animationWithBlock:(BOOL(^)(id target, POPCustomAnimation *))block 23 | { 24 | POPCustomAnimation *b = [[self alloc] _init]; 25 | b.animate = block; 26 | return b; 27 | } 28 | 29 | - (id)_init 30 | { 31 | self = [super _init]; 32 | if (nil != self) { 33 | _state->type = kPOPAnimationCustom; 34 | } 35 | return self; 36 | } 37 | 38 | - (CFTimeInterval)beginTime 39 | { 40 | POPAnimationState *s = POPAnimationGetState(self); 41 | return s->startTime > 0 ? s->startTime : s->beginTime; 42 | } 43 | 44 | - (BOOL)_advance:(id)object currentTime:(CFTimeInterval)currentTime elapsedTime:(CFTimeInterval)elapsedTime 45 | { 46 | _currentTime = currentTime; 47 | _elapsedTime = elapsedTime; 48 | return _animate(object, self); 49 | } 50 | 51 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug 52 | { 53 | [s appendFormat:@"; elapsedTime = %f; currentTime = %f;", _elapsedTime, _currentTime]; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPDecayAnimation.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | @abstract A concrete decay animation class. 14 | @discussion Animation is achieved through gradual decay of animation value. 15 | */ 16 | @interface POPDecayAnimation : POPPropertyAnimation 17 | 18 | /** 19 | @abstract The designated initializer. 20 | @returns An instance of a decay animation. 21 | */ 22 | + (instancetype)animation; 23 | 24 | /** 25 | @abstract Convenience initializer that returns an animation with animatable property of name. 26 | @param name The name of the animatable property. 27 | @returns An instance of a decay animation configured with specified animatable property. 28 | */ 29 | + (instancetype)animationWithPropertyNamed:(NSString *)name; 30 | 31 | /** 32 | @abstract The current velocity value. 33 | @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second. The only POPValueTypes supported for velocity are: kPOPValuePoint, kPOPValueInteger, kPOPValueFloat, kPOPValueRect, and kPOPValueSize. 34 | */ 35 | @property (copy, nonatomic) id velocity; 36 | 37 | /** 38 | @abstract The original velocity value. 39 | @discussion Since the velocity property is modified as the animation progresses, this property stores the original, passed in velocity to support autoreverse and repeatCount. 40 | */ 41 | @property (copy, nonatomic, readonly) id originalVelocity; 42 | 43 | /** 44 | @abstract The deceleration factor. 45 | @discussion Values specifies should be in the range [0, 1]. Lower values results in faster deceleration. Defaults to 0.998. 46 | */ 47 | @property (assign, nonatomic) CGFloat deceleration; 48 | 49 | /** 50 | @abstract The expected duration. 51 | @discussion Derived based on input velocity and deceleration values. 52 | */ 53 | @property (readonly, assign, nonatomic) CFTimeInterval duration; 54 | 55 | /** 56 | The to value is derived based on input velocity and deceleration. 57 | */ 58 | - (void)setToValue:(id)toValue NS_UNAVAILABLE; 59 | 60 | /** 61 | @abstract The reversed velocity. 62 | @discussion The reversed velocity based on the originalVelocity when the animation was set up. 63 | */ 64 | - (id)reversedVelocity; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPDecayAnimationInternal.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPDecayAnimation.h" 11 | #import "POPPropertyAnimationInternal.h" 12 | 13 | // minimal velocity factor before decay animation is considered complete, in units / s 14 | static CGFloat kPOPAnimationDecayMinimalVelocityFactor = 5.; 15 | 16 | // default decay animation deceleration 17 | static CGFloat kPOPAnimationDecayDecelerationDefault = 0.998; 18 | 19 | static void decay_position(CGFloat *x, CGFloat *v, NSUInteger count, CFTimeInterval dt, CGFloat deceleration) 20 | { 21 | dt *= 1000; 22 | 23 | // v0 = v / 1000 24 | // v = v0 * powf(deceleration, dt); 25 | // v = v * 1000; 26 | 27 | // x0 = x; 28 | // x = x0 + v0 * deceleration * (1 - powf(deceleration, dt)) / (1 - deceleration) 29 | float v0[count]; 30 | float kv = powf(deceleration, dt); 31 | float kx = deceleration * (1 - kv) / (1 - deceleration); 32 | 33 | for (NSUInteger idx = 0; idx < count; idx++) { 34 | v0[idx] = v[idx] / 1000.; 35 | v[idx] = v0[idx] * kv * 1000.; 36 | x[idx] = x[idx] + v0[idx] * kx; 37 | } 38 | } 39 | 40 | struct _POPDecayAnimationState : _POPPropertyAnimationState 41 | { 42 | double deceleration; 43 | CFTimeInterval duration; 44 | 45 | _POPDecayAnimationState(id __unsafe_unretained anim) : 46 | _POPPropertyAnimationState(anim), 47 | deceleration(kPOPAnimationDecayDecelerationDefault), 48 | duration(0) 49 | { 50 | type = kPOPAnimationDecay; 51 | } 52 | 53 | bool isDone() { 54 | if (_POPPropertyAnimationState::isDone()) { 55 | return true; 56 | } 57 | 58 | CGFloat f = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor; 59 | const CGFloat *velocityValues = vec_data(velocityVec); 60 | for (NSUInteger idx = 0; idx < valueCount; idx++) { 61 | if (fabsf(velocityValues[idx]) >= f) 62 | return false; 63 | } 64 | return true; 65 | 66 | } 67 | 68 | void computeDuration() { 69 | 70 | // compute duration till threshold velocity 71 | Vector4r scaledVelocity = vector4(velocityVec) / 1000.; 72 | 73 | double k = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor / 1000.; 74 | double vx = k / scaledVelocity.x; 75 | double vy = k / scaledVelocity.y; 76 | double vz = k / scaledVelocity.z; 77 | double vw = k / scaledVelocity.w; 78 | double d = log(deceleration) * 1000.; 79 | duration = MAX(MAX(MAX(log(fabs(vx)) / d, log(fabs(vy)) / d), log(fabs(vz)) / d), log(fabs(vw)) / d); 80 | 81 | // ensure velocity threshold is exceeded 82 | if (isnan(duration) || duration < 0) { 83 | duration = 0; 84 | } 85 | } 86 | 87 | void computeToValue() { 88 | // to value assuming final velocity as a factor of dynamics threshold 89 | // derived from v' = v * d^dt used in decay_position 90 | // to compute the to value with maximal dt, p' = p + (v * d) / (1 - d) 91 | VectorRef fromValue = NULL != currentVec ? currentVec : fromVec; 92 | if (!fromValue) { 93 | return; 94 | } 95 | 96 | // ensure duration is computed 97 | if (0 == duration) { 98 | computeDuration(); 99 | } 100 | 101 | // compute to value 102 | VectorRef toValue(Vector::new_vector(fromValue.get())); 103 | Vector4r velocity = velocityVec->vector4r(); 104 | decay_position(toValue->data(), velocity.data(), valueCount, duration, deceleration); 105 | toVec = toValue; 106 | } 107 | 108 | void computeDestinationValues() { 109 | // to value assuming final velocity as a factor of dynamics threshold 110 | // derived from v' = v * d^dt used in decay_position 111 | // to compute the to value with maximal dt, p' = p + (v * d) / (1 - d) 112 | VectorRef fromValue = NULL != currentVec ? currentVec : fromVec; 113 | if (!fromValue) { 114 | return; 115 | } 116 | 117 | VectorRef toValue(Vector::new_vector(fromValue.get())); 118 | 119 | // compute duration till threshold velocity 120 | Vector4r scaledVelocity = vector4(velocityVec) / 1000.; 121 | 122 | double k = dynamicsThreshold * kPOPAnimationDecayMinimalVelocityFactor / 1000.; 123 | double vx = k / scaledVelocity.x; 124 | double vy = k / scaledVelocity.y; 125 | double vz = k / scaledVelocity.z; 126 | double vw = k / scaledVelocity.w; 127 | double d = log(deceleration) * 1000.; 128 | duration = MAX(MAX(MAX(log(fabs(vx)) / d, log(fabs(vy)) / d), log(fabs(vz)) / d), log(fabs(vw)) / d); 129 | 130 | // ensure velocity threshold is exceeded 131 | if (isnan(duration) || duration < 0) { 132 | duration = 0; 133 | } else { 134 | // compute to value 135 | Vector4r velocity = velocityVec->vector4r(); 136 | decay_position(toValue->data(), velocity.data(), valueCount, duration, deceleration); 137 | } 138 | 139 | toVec = toValue; 140 | } 141 | 142 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { 143 | // advance past not yet initialized animations 144 | if (NULL == currentVec) { 145 | return false; 146 | } 147 | 148 | decay_position(currentVec->data(), velocityVec->data(), valueCount, dt, deceleration); 149 | 150 | // clamp to compute end value; avoid possibility of decaying past 151 | clampCurrentValue(kPOPAnimationClampEnd | clampMode); 152 | 153 | return true; 154 | } 155 | 156 | }; 157 | 158 | typedef struct _POPDecayAnimationState POPDecayAnimationState; 159 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPDefines.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #ifndef POP_POPDefines_h 11 | #define POP_POPDefines_h 12 | 13 | #ifdef __cplusplus 14 | # define POP_EXTERN_C_BEGIN extern "C" { 15 | # define POP_EXTERN_C_END } 16 | #else 17 | # define POP_EXTERN_C_BEGIN 18 | # define POP_EXTERN_C_END 19 | #endif 20 | 21 | #define POP_ARRAY_COUNT(x) sizeof(x) / sizeof(x[0]) 22 | 23 | #if defined (__cplusplus) && defined (__GNUC__) 24 | # define POP_NOTHROW __attribute__ ((nothrow)) 25 | #else 26 | # define POP_NOTHROW 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPGeometry.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #if TARGET_OS_IPHONE 13 | #import 14 | #endif 15 | 16 | #if !TARGET_OS_IPHONE 17 | 18 | /** NSValue extensions to support animatable types. */ 19 | @interface NSValue (POP) 20 | 21 | /** 22 | @abstract Creates an NSValue given a CGPoint. 23 | */ 24 | + (NSValue *)valueWithCGPoint:(CGPoint)point; 25 | 26 | /** 27 | @abstract Creates an NSValue given a CGSize. 28 | */ 29 | + (NSValue *)valueWithCGSize:(CGSize)size; 30 | 31 | /** 32 | @abstract Creates an NSValue given a CGRect. 33 | */ 34 | + (NSValue *)valueWithCGRect:(CGRect)rect; 35 | 36 | /** 37 | @abstract Creates an NSValue given a CFRange. 38 | */ 39 | + (NSValue *)valueWithCFRange:(CFRange)range; 40 | 41 | /** 42 | @abstract Creates an NSValue given a CGAffineTransform. 43 | */ 44 | + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform; 45 | 46 | /** 47 | @abstract Returns the underlying CGPoint value. 48 | */ 49 | - (CGPoint)CGPointValue; 50 | 51 | /** 52 | @abstract Returns the underlying CGSize value. 53 | */ 54 | - (CGSize)CGSizeValue; 55 | 56 | /** 57 | @abstract Returns the underlying CGRect value. 58 | */ 59 | - (CGRect)CGRectValue; 60 | 61 | /** 62 | @abstract Returns the underlying CFRange value. 63 | */ 64 | - (CFRange)CFRangeValue; 65 | 66 | /** 67 | @abstract Returns the underlying CGAffineTransform value. 68 | */ 69 | - (CGAffineTransform)CGAffineTransformValue; 70 | 71 | @end 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPGeometry.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPGeometry.h" 11 | 12 | #if !TARGET_OS_IPHONE 13 | @implementation NSValue (POP) 14 | 15 | + (NSValue *)valueWithCGPoint:(CGPoint)point { 16 | return [NSValue valueWithBytes:&point objCType:@encode(CGPoint)]; 17 | } 18 | 19 | + (NSValue *)valueWithCGSize:(CGSize)size { 20 | return [NSValue valueWithBytes:&size objCType:@encode(CGSize)]; 21 | } 22 | 23 | + (NSValue *)valueWithCGRect:(CGRect)rect { 24 | return [NSValue valueWithBytes:&rect objCType:@encode(CGRect)]; 25 | } 26 | 27 | + (NSValue *)valueWithCFRange:(CFRange)range { 28 | return [NSValue valueWithBytes:&range objCType:@encode(CFRange)]; 29 | } 30 | 31 | + (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform 32 | { 33 | return [NSValue valueWithBytes:&transform objCType:@encode(CGAffineTransform)]; 34 | } 35 | 36 | - (CGPoint)CGPointValue { 37 | CGPoint result; 38 | [self getValue:&result]; 39 | return result; 40 | } 41 | 42 | - (CGSize)CGSizeValue { 43 | CGSize result; 44 | [self getValue:&result]; 45 | return result; 46 | } 47 | 48 | - (CGRect)CGRectValue { 49 | CGRect result; 50 | [self getValue:&result]; 51 | return result; 52 | } 53 | 54 | - (CFRange)CFRangeValue { 55 | CFRange result; 56 | [self getValue:&result]; 57 | return result; 58 | } 59 | 60 | - (CGAffineTransform)CGAffineTransformValue { 61 | CGAffineTransform result; 62 | [self getValue:&result]; 63 | return result; 64 | } 65 | @end 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPLayerExtras.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | POP_EXTERN_C_BEGIN 15 | 16 | #pragma mark - Scale 17 | 18 | /** 19 | @abstract Returns layer scale factor for the x axis. 20 | */ 21 | extern CGFloat POPLayerGetScaleX(CALayer *l); 22 | 23 | /** 24 | @abstract Set layer scale factor for the x axis. 25 | */ 26 | extern void POPLayerSetScaleX(CALayer *l, CGFloat f); 27 | 28 | /** 29 | @abstract Returns layer scale factor for the y axis. 30 | */ 31 | extern CGFloat POPLayerGetScaleY(CALayer *l); 32 | 33 | /** 34 | @abstract Set layer scale factor for the y axis. 35 | */ 36 | extern void POPLayerSetScaleY(CALayer *l, CGFloat f); 37 | 38 | /** 39 | @abstract Returns layer scale factor for the z axis. 40 | */ 41 | extern CGFloat POPLayerGetScaleZ(CALayer *l); 42 | 43 | /** 44 | @abstract Set layer scale factor for the z axis. 45 | */ 46 | extern void POPLayerSetScaleZ(CALayer *l, CGFloat f); 47 | 48 | /** 49 | @abstract Returns layer scale factors for x and y access as point. 50 | */ 51 | extern CGPoint POPLayerGetScaleXY(CALayer *l); 52 | 53 | /** 54 | @abstract Sets layer x and y scale factors given point. 55 | */ 56 | extern void POPLayerSetScaleXY(CALayer *l, CGPoint p); 57 | 58 | #pragma mark - Translation 59 | 60 | /** 61 | @abstract Returns layer translation factor for the x axis. 62 | */ 63 | extern CGFloat POPLayerGetTranslationX(CALayer *l); 64 | 65 | /** 66 | @abstract Set layer translation factor for the x axis. 67 | */ 68 | extern void POPLayerSetTranslationX(CALayer *l, CGFloat f); 69 | 70 | /** 71 | @abstract Returns layer translation factor for the y axis. 72 | */ 73 | extern CGFloat POPLayerGetTranslationY(CALayer *l); 74 | 75 | /** 76 | @abstract Set layer translation factor for the y axis. 77 | */ 78 | extern void POPLayerSetTranslationY(CALayer *l, CGFloat f); 79 | 80 | /** 81 | @abstract Returns layer translation factor for the z axis. 82 | */ 83 | extern CGFloat POPLayerGetTranslationZ(CALayer *l); 84 | 85 | /** 86 | @abstract Set layer translation factor for the z axis. 87 | */ 88 | extern void POPLayerSetTranslationZ(CALayer *l, CGFloat f); 89 | 90 | /** 91 | @abstract Returns layer translation factors for x and y access as point. 92 | */ 93 | extern CGPoint POPLayerGetTranslationXY(CALayer *l); 94 | 95 | /** 96 | @abstract Sets layer x and y translation factors given point. 97 | */ 98 | extern void POPLayerSetTranslationXY(CALayer *l, CGPoint p); 99 | 100 | #pragma mark - Rotation 101 | 102 | /** 103 | @abstract Returns layer rotation, in radians, in the X axis. 104 | */ 105 | extern CGFloat POPLayerGetRotationX(CALayer *l); 106 | 107 | /** 108 | @abstract Sets layer rotation, in radians, in the X axis. 109 | */ 110 | extern void POPLayerSetRotationX(CALayer *l, CGFloat f); 111 | 112 | /** 113 | @abstract Returns layer rotation, in radians, in the Y axis. 114 | */ 115 | extern CGFloat POPLayerGetRotationY(CALayer *l); 116 | 117 | /** 118 | @abstract Sets layer rotation, in radians, in the Y axis. 119 | */ 120 | extern void POPLayerSetRotationY(CALayer *l, CGFloat f); 121 | 122 | /** 123 | @abstract Returns layer rotation, in radians, in the Z axis. 124 | */ 125 | extern CGFloat POPLayerGetRotationZ(CALayer *l); 126 | 127 | /** 128 | @abstract Sets layer rotation, in radians, in the Z axis. 129 | */ 130 | extern void POPLayerSetRotationZ(CALayer *l, CGFloat f); 131 | 132 | /** 133 | @abstract Returns layer rotation, in radians, in the Z axis. 134 | */ 135 | extern CGFloat POPLayerGetRotation(CALayer *l); 136 | 137 | /** 138 | @abstract Sets layer rotation, in radians, in the Z axis. 139 | */ 140 | extern void POPLayerSetRotation(CALayer *l, CGFloat f); 141 | 142 | #pragma mark - Sublayer Scale 143 | 144 | /** 145 | @abstract Returns sublayer scale factors for x and y access as point. 146 | */ 147 | extern CGPoint POPLayerGetSubScaleXY(CALayer *l); 148 | 149 | /** 150 | @abstract Sets sublayer x and y scale factors given point. 151 | */ 152 | extern void POPLayerSetSubScaleXY(CALayer *l, CGPoint p); 153 | 154 | #pragma mark - Sublayer Translation 155 | 156 | /** 157 | @abstract Returns sublayer translation factor for the x axis. 158 | */ 159 | extern CGFloat POPLayerGetSubTranslationX(CALayer *l); 160 | 161 | /** 162 | @abstract Set sublayer translation factor for the x axis. 163 | */ 164 | extern void POPLayerSetSubTranslationX(CALayer *l, CGFloat f); 165 | 166 | /** 167 | @abstract Returns sublayer translation factor for the y axis. 168 | */ 169 | extern CGFloat POPLayerGetSubTranslationY(CALayer *l); 170 | 171 | /** 172 | @abstract Set sublayer translation factor for the y axis. 173 | */ 174 | extern void POPLayerSetSubTranslationY(CALayer *l, CGFloat f); 175 | 176 | /** 177 | @abstract Returns sublayer translation factor for the z axis. 178 | */ 179 | extern CGFloat POPLayerGetSubTranslationZ(CALayer *l); 180 | 181 | /** 182 | @abstract Set sublayer translation factor for the z axis. 183 | */ 184 | extern void POPLayerSetSubTranslationZ(CALayer *l, CGFloat f); 185 | 186 | /** 187 | @abstract Returns sublayer translation factors for x and y access as point. 188 | */ 189 | extern CGPoint POPLayerGetSubTranslationXY(CALayer *l); 190 | 191 | /** 192 | @abstract Sets sublayer x and y translation factors given point. 193 | */ 194 | extern void POPLayerSetSubTranslationXY(CALayer *l, CGPoint p); 195 | 196 | POP_EXTERN_C_END 197 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPMath.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "POPDefines.h" 14 | #import "POPVector.h" 15 | 16 | NS_INLINE CGFloat sqrtr(CGFloat f) 17 | { 18 | #if CGFLOAT_IS_DOUBLE 19 | return sqrt(f); 20 | #else 21 | return sqrtf(f); 22 | #endif 23 | } 24 | 25 | // round to nearest sub; pass 2.0 to round to every 0.5 (eg: retina pixels) 26 | NS_INLINE CGFloat POPSubRound(CGFloat f, CGFloat sub) 27 | { 28 | return round(f * sub) / sub; 29 | } 30 | 31 | #define MIX(a, b, f) ((a) + (f) * ((b) - (a))) 32 | 33 | // the longer the duration, the higher the necessary precision 34 | #define SOLVE_EPS(dur) (1. / (1000. * (dur))) 35 | 36 | #define _EQLF_(x, y, epsilon) (fabsf ((x) - (y)) < epsilon) 37 | 38 | extern void POPInterpolateVector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, CGFloat f); 39 | 40 | extern double POPTimingFunctionSolve(const double vec[4], double t, double eps); 41 | 42 | // quadratic mapping of t [0, 1] to [start, end] 43 | extern double POPQuadraticOutInterpolation(double t, double start, double end); 44 | 45 | // normalize value to [0, 1] based on its range [startValue, endValue] 46 | extern double POPNormalize(double value, double startValue, double endValue); 47 | 48 | // project a normalized value [0, 1] to a given range [start, end] 49 | extern double POPProjectNormal(double n, double start, double end); 50 | 51 | // solve a quadratic equation of the form a * x^2 + b * x + c = 0 52 | extern void POPQuadraticSolve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2); 53 | 54 | // for a given tension return the bouncy 3 friction that produces no bounce 55 | extern double POPBouncy3NoBounce(double tension); 56 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPMath.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPMath.h" 11 | #import "UnitBezier.h" 12 | #import "POPAnimationPrivate.h" 13 | 14 | void POPInterpolateVector(NSUInteger count, CGFloat *dst, const CGFloat *from, const CGFloat *to, CGFloat f) 15 | { 16 | for (NSUInteger idx = 0; idx < count; idx++) { 17 | dst[idx] = MIX(from[idx], to[idx], f); 18 | } 19 | } 20 | 21 | double POPTimingFunctionSolve(const double vec[4], double t, double eps) 22 | { 23 | WebCore::UnitBezier bezier(vec[0], vec[1], vec[2], vec[3]); 24 | return bezier.solve(t, eps); 25 | } 26 | 27 | double POPNormalize(double value, double startValue, double endValue) 28 | { 29 | return (value - startValue) / (endValue - startValue); 30 | } 31 | 32 | double POPProjectNormal(double n, double start, double end) 33 | { 34 | return start + (n * (end - start)); 35 | } 36 | 37 | static double linear_interpolation(double t, double start, double end) 38 | { 39 | return t * end + (1.f - t) * start; 40 | } 41 | 42 | double POPQuadraticOutInterpolation(double t, double start, double end) 43 | { 44 | return linear_interpolation(2*t - t*t, start, end); 45 | } 46 | 47 | static double b3_friction1(double x) 48 | { 49 | return (0.0007 * pow(x, 3)) - (0.031 * pow(x, 2)) + 0.64 * x + 1.28; 50 | } 51 | 52 | static double b3_friction2(double x) 53 | { 54 | return (0.000044 * pow(x, 3)) - (0.006 * pow(x, 2)) + 0.36 * x + 2.; 55 | } 56 | 57 | static double b3_friction3(double x) 58 | { 59 | return (0.00000045 * pow(x, 3)) - (0.000332 * pow(x, 2)) + 0.1078 * x + 5.84; 60 | } 61 | 62 | double POPBouncy3NoBounce(double tension) 63 | { 64 | double friction = 0; 65 | if (tension <= 18.) { 66 | friction = b3_friction1(tension); 67 | } else if (tension > 18 && tension <= 44) { 68 | friction = b3_friction2(tension); 69 | } else if (tension > 44) { 70 | friction = b3_friction3(tension); 71 | } else { 72 | assert(false); 73 | } 74 | return friction; 75 | } 76 | 77 | void POPQuadraticSolve(CGFloat a, CGFloat b, CGFloat c, CGFloat &x1, CGFloat &x2) 78 | { 79 | CGFloat discriminant = sqrt(b * b - 4 * a * c); 80 | x1 = (-b + discriminant) / (2 * a); 81 | x2 = (-b - discriminant) / (2 * a); 82 | } 83 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPPropertyAnimation.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | /** 14 | @abstract Flags for clamping animation values. 15 | @discussion Animation values can optionally be clamped to avoid overshoot. kPOPAnimationClampStart ensures values are more than fromValue and kPOPAnimationClampEnd ensures values are less than toValue. 16 | */ 17 | typedef NS_OPTIONS(NSUInteger, POPAnimationClampFlags) 18 | { 19 | kPOPAnimationClampNone = 0, 20 | kPOPAnimationClampStart = 1UL << 0, 21 | kPOPAnimationClampEnd = 1UL << 1, 22 | kPOPAnimationClampBoth = kPOPAnimationClampStart | kPOPAnimationClampEnd, 23 | }; 24 | 25 | /** 26 | @abstract The semi-concrete property animation subclass. 27 | */ 28 | @interface POPPropertyAnimation : POPAnimation 29 | 30 | /** 31 | @abstract The property to animate. 32 | */ 33 | @property (strong, nonatomic) POPAnimatableProperty *property; 34 | 35 | /** 36 | @abstract The value to animate from. 37 | @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start. 38 | */ 39 | @property (copy, nonatomic) id fromValue; 40 | 41 | /** 42 | @abstract The value to animate to. 43 | @discussion The value type should match the property. If unspecified, the value is initialized to the object's current value on animation start. 44 | */ 45 | @property (copy, nonatomic) id toValue; 46 | 47 | /** 48 | @abstract The rounding factor applied to the current animated value. 49 | @discussion Specify 1.0 to animate between integral values. Defaults to 0 meaning no rounding. 50 | */ 51 | @property (assign, nonatomic) CGFloat roundingFactor; 52 | 53 | /** 54 | @abstract The clamp mode applied to the current animated value. 55 | @discussion See {@ref POPAnimationClampFlags} for possible values. Defaults to kPOPAnimationClampNone. 56 | */ 57 | @property (assign, nonatomic) NSUInteger clampMode; 58 | 59 | /** 60 | @abstract The flag indicating whether values should be "added" each frame, rather than set. 61 | @discussion Addition may be type dependent. Defaults to NO. 62 | */ 63 | @property (assign, nonatomic, getter = isAdditive) BOOL additive; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPPropertyAnimation.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPPropertyAnimationInternal.h" 11 | 12 | @implementation POPPropertyAnimation 13 | 14 | #pragma mark - Lifecycle 15 | 16 | #undef __state 17 | #define __state ((POPPropertyAnimationState *)_state) 18 | 19 | - (void)_initState 20 | { 21 | _state = new POPPropertyAnimationState(self); 22 | } 23 | 24 | #pragma mark - Properties 25 | 26 | DEFINE_RW_FLAG(POPPropertyAnimationState, additive, isAdditive, setAdditive:); 27 | DEFINE_RW_PROPERTY(POPPropertyAnimationState, roundingFactor, setRoundingFactor:, CGFloat); 28 | DEFINE_RW_PROPERTY(POPPropertyAnimationState, clampMode, setClampMode:, NSUInteger); 29 | DEFINE_RW_PROPERTY_OBJ(POPPropertyAnimationState, property, setProperty:, POPAnimatableProperty*, ((POPPropertyAnimationState*)_state)->updatedDynamicsThreshold();); 30 | DEFINE_RW_PROPERTY_OBJ_COPY(POPPropertyAnimationState, progressMarkers, setProgressMarkers:, NSArray*, ((POPPropertyAnimationState*)_state)->updatedProgressMarkers();); 31 | 32 | - (id)fromValue 33 | { 34 | return POPBox(__state->fromVec, __state->valueType); 35 | } 36 | 37 | - (void)setFromValue:(id)aValue 38 | { 39 | POPPropertyAnimationState *s = __state; 40 | VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); 41 | if (!vec_equal(vec, s->fromVec)) { 42 | s->fromVec = vec; 43 | 44 | if (s->tracing) { 45 | [s->tracer updateFromValue:aValue]; 46 | } 47 | } 48 | } 49 | 50 | - (id)toValue 51 | { 52 | return POPBox(__state->toVec, __state->valueType); 53 | } 54 | 55 | - (void)setToValue:(id)aValue 56 | { 57 | POPPropertyAnimationState *s = __state; 58 | VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); 59 | 60 | if (!vec_equal(vec, s->toVec)) { 61 | s->toVec = vec; 62 | 63 | // invalidate to dependent state 64 | s->didReachToValue = false; 65 | s->distanceVec = NULL; 66 | 67 | if (s->tracing) { 68 | [s->tracer updateToValue:aValue]; 69 | } 70 | 71 | // automatically unpause active animations 72 | if (s->active && s->paused) { 73 | s->setPaused(false); 74 | } 75 | } 76 | } 77 | 78 | - (id)currentValue 79 | { 80 | return POPBox(__state->currentValue(), __state->valueType); 81 | } 82 | 83 | #pragma mark - Utility 84 | 85 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug 86 | { 87 | [s appendFormat:@"; from = %@; to = %@", describe(__state->fromVec), describe(__state->toVec)]; 88 | 89 | if (_state->active) 90 | [s appendFormat:@"; currentValue = %@", describe(__state->currentValue())]; 91 | 92 | if (__state->velocityVec && 0 != __state->velocityVec->norm()) 93 | [s appendFormat:@"; velocity = %@", describe(__state->velocityVec)]; 94 | 95 | if (!self.removedOnCompletion) 96 | [s appendFormat:@"; removedOnCompletion = %@", POPStringFromBOOL(self.removedOnCompletion)]; 97 | 98 | if (__state->progressMarkers) 99 | [s appendFormat:@"; progressMarkers = [%@]", [__state->progressMarkers componentsJoinedByString:@", "]]; 100 | 101 | if (_state->active) 102 | [s appendFormat:@"; progress = %f", __state->progress]; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPSpringAnimation.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | @abstract A concrete spring animation class. 14 | @discussion Animation is achieved through modeling spring dynamics. 15 | */ 16 | @interface POPSpringAnimation : POPPropertyAnimation 17 | 18 | /** 19 | @abstract The designated initializer. 20 | @returns An instance of a spring animation. 21 | */ 22 | + (instancetype)animation; 23 | 24 | /** 25 | @abstract Convenience initializer that returns an animation with animatable property of name. 26 | @param name The name of the animatable property. 27 | @returns An instance of a spring animation configured with specified animatable property. 28 | */ 29 | + (instancetype)animationWithPropertyNamed:(NSString *)name; 30 | 31 | /** 32 | @abstract The current velocity value. 33 | @discussion Set before animation start to account for initial velocity. Expressed in change of value units per second. 34 | */ 35 | @property (copy, nonatomic) id velocity; 36 | 37 | /** 38 | @abstract The effective bounciness. 39 | @discussion Use in conjunction with 'springSpeed' to change animation effect. Values are converted into corresponding dynamics constants. Defined as a value in the range [0, 20]. Defaults to 4. 40 | */ 41 | @property (assign, nonatomic) CGFloat springBounciness; 42 | 43 | /** 44 | @abstract The effective speed. 45 | @discussion Use in conjunction with 'springBounciness' to change animation effect. Values are converted into corresponding dynamics constants. Defined as a value in the range [0, 20]. Defaults to 12. 46 | */ 47 | @property (assign, nonatomic) CGFloat springSpeed; 48 | 49 | /** 50 | @abstract The tension used in the dynamics simulation. 51 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. 52 | */ 53 | @property (assign, nonatomic) CGFloat dynamicsTension; 54 | 55 | /** 56 | @abstract The friction used in the dynamics simulation. 57 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. 58 | */ 59 | @property (assign, nonatomic) CGFloat dynamicsFriction; 60 | 61 | /** 62 | @abstract The mass used in the dynamics simulation. 63 | @discussion Can be used over bounciness and speed for finer grain tweaking of animation effect. 64 | */ 65 | @property (assign, nonatomic) CGFloat dynamicsMass; 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPSpringAnimation.mm: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPSpringAnimationInternal.h" 11 | 12 | @implementation POPSpringAnimation 13 | 14 | #pragma mark - Lifecycle 15 | 16 | #undef __state 17 | #define __state ((POPSpringAnimationState *)_state) 18 | 19 | + (instancetype)animation 20 | { 21 | return [[self alloc] init]; 22 | } 23 | 24 | + (instancetype)animationWithPropertyNamed:(NSString *)aName 25 | { 26 | POPSpringAnimation *anim = [self animation]; 27 | anim.property = [POPAnimatableProperty propertyWithName:aName]; 28 | return anim; 29 | } 30 | 31 | - (void)_initState 32 | { 33 | _state = new POPSpringAnimationState(self); 34 | } 35 | 36 | - (id)init 37 | { 38 | self = [super _init]; 39 | if (nil != self) { 40 | __state->solver = new SpringSolver4d(1, 1, 1); 41 | __state->updatedDynamicsThreshold(); 42 | __state->updatedBouncinessAndSpeed(); 43 | } 44 | return self; 45 | } 46 | 47 | - (void)dealloc 48 | { 49 | if (__state) { 50 | delete __state->solver; 51 | __state->solver = NULL; 52 | } 53 | } 54 | 55 | #pragma mark - Properties 56 | 57 | - (id)velocity 58 | { 59 | return POPBox(__state->velocityVec, __state->valueType); 60 | } 61 | 62 | - (void)setVelocity:(id)aValue 63 | { 64 | POPPropertyAnimationState *s = __state; 65 | VectorRef vec = POPUnbox(aValue, s->valueType, s->valueCount, YES); 66 | if (!vec_equal(vec, s->velocityVec)) { 67 | s->velocityVec = vec; 68 | 69 | if (s->tracing) { 70 | [s->tracer updateVelocity:aValue]; 71 | } 72 | } 73 | } 74 | 75 | DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsTension, setDynamicsTension:, CGFloat, [self _updatedDynamicsTension];); 76 | DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsFriction, setDynamicsFriction:, CGFloat, [self _updatedDynamicsFriction];); 77 | DEFINE_RW_PROPERTY(POPSpringAnimationState, dynamicsMass, setDynamicsMass:, CGFloat, [self _updatedDynamicsMass];); 78 | 79 | FB_PROPERTY_GET(POPSpringAnimationState, springSpeed, CGFloat); 80 | - (void)setSpringSpeed:(CGFloat)aFloat 81 | { 82 | POPSpringAnimationState *s = __state; 83 | if (s->userSpecifiedDynamics || aFloat != s->springSpeed) { 84 | s->springSpeed = aFloat; 85 | s->userSpecifiedDynamics = false; 86 | s->updatedBouncinessAndSpeed(); 87 | if (s->tracing) { 88 | [s->tracer updateSpeed:aFloat]; 89 | } 90 | } 91 | } 92 | 93 | FB_PROPERTY_GET(POPSpringAnimationState, springBounciness, CGFloat); 94 | - (void)setSpringBounciness:(CGFloat)aFloat 95 | { 96 | POPSpringAnimationState *s = __state; 97 | if (s->userSpecifiedDynamics || aFloat != s->springBounciness) { 98 | s->springBounciness = aFloat; 99 | s->userSpecifiedDynamics = false; 100 | s->updatedBouncinessAndSpeed(); 101 | if (s->tracing) { 102 | [s->tracer updateBounciness:aFloat]; 103 | } 104 | } 105 | } 106 | 107 | - (SpringSolver4d *)solver 108 | { 109 | return __state->solver; 110 | } 111 | 112 | - (void)setSolver:(SpringSolver4d *)aSolver 113 | { 114 | if (aSolver != __state->solver) { 115 | if (__state->solver) { 116 | delete(__state->solver); 117 | } 118 | __state->solver = aSolver; 119 | } 120 | } 121 | 122 | #pragma mark - Utility 123 | 124 | - (void)_updatedDynamicsTension 125 | { 126 | __state->userSpecifiedDynamics = true; 127 | if(__state->tracing) { 128 | [__state->tracer updateTension:__state->dynamicsTension]; 129 | } 130 | __state->updatedDynamics(); 131 | } 132 | 133 | - (void)_updatedDynamicsFriction 134 | { 135 | __state->userSpecifiedDynamics = true; 136 | if(__state->tracing) { 137 | [__state->tracer updateFriction:__state->dynamicsFriction]; 138 | } 139 | __state->updatedDynamics(); 140 | } 141 | 142 | - (void)_updatedDynamicsMass 143 | { 144 | __state->userSpecifiedDynamics = true; 145 | if(__state->tracing) { 146 | [__state->tracer updateMass:__state->dynamicsMass]; 147 | } 148 | __state->updatedDynamics(); 149 | } 150 | 151 | - (void)_appendDescription:(NSMutableString *)s debug:(BOOL)debug 152 | { 153 | [super _appendDescription:s debug:debug]; 154 | 155 | if (debug) { 156 | if (_state->userSpecifiedDynamics) { 157 | [s appendFormat:@"; dynamics = (tension:%f, friction:%f, mass:%f)", __state->dynamicsTension, __state->dynamicsFriction, __state->dynamicsMass]; 158 | } else { 159 | [s appendFormat:@"; bounciness = %f; speed = %f", __state->springBounciness, __state->springSpeed]; 160 | } 161 | } 162 | } 163 | 164 | @end 165 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPSpringAnimationInternal.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "POPAnimationExtras.h" 11 | #import "POPPropertyAnimationInternal.h" 12 | 13 | struct _POPSpringAnimationState : _POPPropertyAnimationState 14 | { 15 | SpringSolver4d *solver; 16 | CGFloat springSpeed; 17 | CGFloat springBounciness; // normalized springiness 18 | CGFloat dynamicsTension; // tension 19 | CGFloat dynamicsFriction; // friction 20 | CGFloat dynamicsMass; // mass 21 | 22 | _POPSpringAnimationState(id __unsafe_unretained anim) : _POPPropertyAnimationState(anim), 23 | solver(nullptr), 24 | springSpeed(12.), 25 | springBounciness(4.), 26 | dynamicsTension(0), 27 | dynamicsFriction(0), 28 | dynamicsMass(0) 29 | { 30 | type = kPOPAnimationSpring; 31 | } 32 | 33 | bool hasConverged() 34 | { 35 | NSUInteger count = valueCount; 36 | if (shouldRound()) { 37 | return vec_equal(previous2Vec, previousVec) && vec_equal(previousVec, toVec); 38 | } else { 39 | if (!previousVec || !previous2Vec) 40 | return false; 41 | 42 | CGFloat t = dynamicsThreshold / 5; 43 | 44 | const CGFloat *toValues = toVec->data(); 45 | const CGFloat *previousValues = previousVec->data(); 46 | const CGFloat *previous2Values = previous2Vec->data(); 47 | 48 | for (NSUInteger idx = 0; idx < count; idx++) { 49 | if ((fabsf(toValues[idx] - previousValues[idx]) >= t) || (fabsf(previous2Values[idx] - previousValues[idx]) >= t)) { 50 | return false; 51 | } 52 | } 53 | return true; 54 | } 55 | } 56 | 57 | bool isDone() { 58 | if (_POPPropertyAnimationState::isDone()) { 59 | return true; 60 | } 61 | return solver->started() && (hasConverged() || solver->hasConverged()); 62 | } 63 | 64 | void updatedDynamics() 65 | { 66 | if (NULL != solver) { 67 | solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass); 68 | } 69 | } 70 | 71 | void updatedDynamicsThreshold() 72 | { 73 | _POPPropertyAnimationState::updatedDynamicsThreshold(); 74 | if (NULL != solver) { 75 | solver->setThreshold(dynamicsThreshold); 76 | } 77 | } 78 | 79 | void updatedBouncinessAndSpeed() { 80 | [POPSpringAnimation convertBounciness:springBounciness speed:springSpeed toTension:&dynamicsTension friction:&dynamicsFriction mass:&dynamicsMass]; 81 | updatedDynamics(); 82 | } 83 | 84 | bool advance(CFTimeInterval time, CFTimeInterval dt, id obj) { 85 | // advance past not yet initialized animations 86 | if (NULL == currentVec) { 87 | return false; 88 | } 89 | 90 | CFTimeInterval localTime = time - startTime; 91 | 92 | Vector4d value = vector4d(currentVec); 93 | Vector4d toValue = vector4d(toVec); 94 | Vector4d velocity = vector4d(velocityVec); 95 | 96 | SSState4d state; 97 | state.p = toValue - value; 98 | 99 | // the solver assumes a spring of size zero 100 | // flip the velocity from user perspective to solver perspective 101 | state.v = velocity * -1; 102 | 103 | solver->advance(state, localTime, dt); 104 | value = toValue - state.p; 105 | 106 | // flip velocity back to user perspective 107 | velocity = state.v * -1; 108 | 109 | *currentVec = value; 110 | 111 | if (velocityVec) { 112 | *velocityVec = velocity; 113 | } 114 | 115 | clampCurrentValue(); 116 | 117 | return true; 118 | } 119 | 120 | virtual void reset(bool all) { 121 | _POPPropertyAnimationState::reset(all); 122 | 123 | if (solver) { 124 | solver->setConstants(dynamicsTension, dynamicsFriction, dynamicsMass); 125 | solver->reset(); 126 | } 127 | } 128 | }; 129 | 130 | typedef struct _POPSpringAnimationState POPSpringAnimationState; 131 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/POPSpringSolver.h: -------------------------------------------------------------------------------- 1 | /** 2 | Copyright (c) 2014-present, Facebook, Inc. 3 | All rights reserved. 4 | 5 | This source code is licensed under the BSD-style license found in the 6 | LICENSE file in the root directory of this source tree. An additional grant 7 | of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "POPVector.h" 13 | 14 | namespace POP { 15 | 16 | template 17 | struct SSState 18 | { 19 | T p; 20 | T v; 21 | }; 22 | 23 | template 24 | struct SSDerivative 25 | { 26 | T dp; 27 | T dv; 28 | }; 29 | 30 | typedef SSState SSState4d; 31 | typedef SSDerivative SSDerivative4d; 32 | 33 | const CFTimeInterval solverDt = 0.001f; 34 | const CFTimeInterval maxSolverDt = 30.0f; 35 | 36 | /** 37 | Templated spring solver class. 38 | */ 39 | template 40 | class SpringSolver 41 | { 42 | double _k; // stiffness 43 | double _b; // dampening 44 | double _m; // mass 45 | 46 | double _tp; // threshold 47 | double _tv; // threshold velocity 48 | double _ta; // threshold acceleration 49 | 50 | CFTimeInterval _accumulatedTime; 51 | SSState _lastState; 52 | T _lastDv; 53 | bool _started; 54 | 55 | public: 56 | SpringSolver(double k, double b, double m = 1) : _k(k), _b(b), _m(m), _started(false) 57 | { 58 | _accumulatedTime = 0; 59 | _lastState.p = T::Zero(); 60 | _lastState.v = T::Zero(); 61 | _lastDv = T::Zero(); 62 | setThreshold(1.); 63 | } 64 | 65 | ~SpringSolver() 66 | { 67 | } 68 | 69 | bool started() 70 | { 71 | return _started; 72 | } 73 | 74 | void setConstants(double k, double b, double m) 75 | { 76 | _k = k; 77 | _b = b; 78 | _m = m; 79 | } 80 | 81 | void setThreshold(double t) 82 | { 83 | _tp = t / 2; // half a unit 84 | _tv = 25.0 * t; // 5 units per second, squared for comparison 85 | _ta = 625.0 * t * t; // 5 units per second squared, squared for comparison 86 | } 87 | 88 | T acceleration(const SSState &state, double t) 89 | { 90 | return state.p*(-_k/_m) - state.v*(_b/_m); 91 | } 92 | 93 | SSDerivative evaluate(const SSState &initial, double t) 94 | { 95 | SSDerivative output; 96 | output.dp = initial.v; 97 | output.dv = acceleration(initial, t); 98 | return output; 99 | } 100 | 101 | SSDerivative evaluate(const SSState &initial, double t, double dt, const SSDerivative &d) 102 | { 103 | SSState state; 104 | state.p = initial.p + d.dp*dt; 105 | state.v = initial.v + d.dv*dt; 106 | SSDerivative output; 107 | output.dp = state.v; 108 | output.dv = acceleration(state, t+dt); 109 | return output; 110 | } 111 | 112 | void integrate(SSState &state, double t, double dt) 113 | { 114 | SSDerivative a = evaluate(state, t); 115 | SSDerivative b = evaluate(state, t, dt*0.5, a); 116 | SSDerivative c = evaluate(state, t, dt*0.5, b); 117 | SSDerivative d = evaluate(state, t, dt, c); 118 | 119 | T dpdt = (a.dp + (b.dp + c.dp)*2.0 + d.dp) * (1.0/6.0); 120 | T dvdt = (a.dv + (b.dv + c.dv)*2.0 + d.dv) * (1.0/6.0); 121 | 122 | state.p = state.p + dpdt*dt; 123 | state.v = state.v + dvdt*dt; 124 | 125 | _lastDv = dvdt; 126 | } 127 | 128 | SSState interpolate(const SSState &previous, const SSState ¤t, double alpha) 129 | { 130 | SSState state; 131 | state.p = current.p*alpha + previous.p*(1-alpha); 132 | state.v = current.v*alpha + previous.v*(1-alpha); 133 | return state; 134 | } 135 | 136 | void advance(SSState &state, double t, double dt) 137 | { 138 | _started = true; 139 | 140 | if (dt > maxSolverDt) { 141 | // excessive time step, force shut down 142 | _lastDv = _lastState.v = _lastState.p = T::Zero(); 143 | } else { 144 | _accumulatedTime += dt; 145 | 146 | SSState previousState = state, currentState = state; 147 | while (_accumulatedTime >= solverDt) { 148 | previousState = currentState; 149 | this->integrate(currentState, t, solverDt); 150 | t += solverDt; 151 | _accumulatedTime -= solverDt; 152 | } 153 | CFTimeInterval alpha = _accumulatedTime / solverDt; 154 | _lastState = state = this->interpolate(previousState, currentState, alpha); 155 | } 156 | } 157 | 158 | bool hasConverged() 159 | { 160 | if (!_started) { 161 | return false; 162 | } 163 | 164 | for (size_t idx = 0; idx < _lastState.p.size(); idx++) { 165 | if (fabs(_lastState.p(idx)) >= _tp) { 166 | return false; 167 | } 168 | } 169 | 170 | return (_lastState.v.squaredNorm() < _tv) && (_lastDv.squaredNorm() < _ta); 171 | } 172 | 173 | void reset() 174 | { 175 | _accumulatedTime = 0; 176 | _lastState.p = T::Zero(); 177 | _lastState.v = T::Zero(); 178 | _lastDv = T::Zero(); 179 | _started = false; 180 | } 181 | }; 182 | 183 | /** 184 | Convenience spring solver type definitions. 185 | */ 186 | typedef SpringSolver SpringSolver2d; 187 | typedef SpringSolver SpringSolver3d; 188 | typedef SpringSolver SpringSolver4d; 189 | } 190 | 191 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/WebCore/FloatConversion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2007 Apple Inc. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of 14 | * its contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY 18 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY 21 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef FloatConversion_h 30 | #define FloatConversion_h 31 | 32 | #include 33 | 34 | namespace WebCore { 35 | 36 | template 37 | float narrowPrecisionToFloat(T); 38 | 39 | template<> 40 | inline float narrowPrecisionToFloat(double number) 41 | { 42 | return static_cast(number); 43 | } 44 | 45 | template 46 | CGFloat narrowPrecisionToCGFloat(T); 47 | 48 | template<> 49 | inline CGFloat narrowPrecisionToCGFloat(double number) 50 | { 51 | return static_cast(number); 52 | } 53 | 54 | } // namespace WebCore 55 | 56 | #endif // FloatConversion_h 57 | -------------------------------------------------------------------------------- /Example/Pods/pop/pop/WebCore/UnitBezier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2008 Apple Inc. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions 6 | * are met: 7 | * 1. Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * 2. Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY 14 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR 17 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 18 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 20 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 21 | * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | */ 25 | 26 | #ifndef UnitBezier_h 27 | #define UnitBezier_h 28 | 29 | #include 30 | 31 | namespace WebCore { 32 | 33 | struct UnitBezier { 34 | UnitBezier(double p1x, double p1y, double p2x, double p2y) 35 | { 36 | // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1). 37 | cx = 3.0 * p1x; 38 | bx = 3.0 * (p2x - p1x) - cx; 39 | ax = 1.0 - cx -bx; 40 | 41 | cy = 3.0 * p1y; 42 | by = 3.0 * (p2y - p1y) - cy; 43 | ay = 1.0 - cy - by; 44 | } 45 | 46 | double sampleCurveX(double t) 47 | { 48 | // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule. 49 | return ((ax * t + bx) * t + cx) * t; 50 | } 51 | 52 | double sampleCurveY(double t) 53 | { 54 | return ((ay * t + by) * t + cy) * t; 55 | } 56 | 57 | double sampleCurveDerivativeX(double t) 58 | { 59 | return (3.0 * ax * t + 2.0 * bx) * t + cx; 60 | } 61 | 62 | // Given an x value, find a parametric value it came from. 63 | double solveCurveX(double x, double epsilon) 64 | { 65 | double t0; 66 | double t1; 67 | double t2; 68 | double x2; 69 | double d2; 70 | int i; 71 | 72 | // First try a few iterations of Newton's method -- normally very fast. 73 | for (t2 = x, i = 0; i < 8; i++) { 74 | x2 = sampleCurveX(t2) - x; 75 | if (fabs (x2) < epsilon) 76 | return t2; 77 | d2 = sampleCurveDerivativeX(t2); 78 | if (fabs(d2) < 1e-6) 79 | break; 80 | t2 = t2 - x2 / d2; 81 | } 82 | 83 | // Fall back to the bisection method for reliability. 84 | t0 = 0.0; 85 | t1 = 1.0; 86 | t2 = x; 87 | 88 | if (t2 < t0) 89 | return t0; 90 | if (t2 > t1) 91 | return t1; 92 | 93 | while (t0 < t1) { 94 | x2 = sampleCurveX(t2); 95 | if (fabs(x2 - x) < epsilon) 96 | return t2; 97 | if (x > x2) 98 | t0 = t2; 99 | else 100 | t1 = t2; 101 | t2 = (t1 - t0) * .5 + t0; 102 | } 103 | 104 | // Failure. 105 | return t2; 106 | } 107 | 108 | double solve(double x, double epsilon) 109 | { 110 | return sampleCurveY(solveCurveX(x, epsilon)); 111 | } 112 | 113 | private: 114 | double ax; 115 | double bx; 116 | double cx; 117 | 118 | double ay; 119 | double by; 120 | double cy; 121 | }; 122 | } 123 | #endif 124 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every test case source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | 9 | #import 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // JOTextFieldTests.m 3 | // JOTextFieldTests 4 | // 5 | // Created by Jorge Ovalle on 04/25/2015. 6 | // Copyright (c) 2014 Jorge Ovalle. All rights reserved. 7 | // 8 | 9 | ${TEST_EXAMPLE} 10 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /JOTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // JOTextField.h 3 | // 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 04/25/15. 6 | // Copyright (c) 2015 All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Vars.h" 11 | 12 | @interface JOTextField : UITextField { 13 | NSString *err; 14 | BOOL active; 15 | } 16 | 17 | //Properties 18 | @property int type; 19 | @property BOOL required; 20 | 21 | @property (strong,nonatomic) UIView *view; 22 | @property (strong,nonatomic) UIButton *tooltip; 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame :(int)type; 25 | 26 | -(void)config; 27 | -(NSString*)validate; 28 | -(void)setError; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /JOTextField.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint JOTextField.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "JOTextField" 12 | s.version = "0.1.0" 13 | s.summary = "A short description of JOTextField." 14 | s.description = "JOTextField is a custom version of UITextField that Includes Validations and more" 15 | s.homepage = "https://github.com/lojals/JOTextField" 16 | # s.screenshots = "www.example.com/screenshots_1", "www.example.com/screenshots_2" 17 | s.license = 'MIT' 18 | s.author = { "Jorge Ovalle" => "jroz9105@gmail.com" } 19 | s.source = { :git => "https://github.com/lojals/JOTextField.git", :tag => s.version.to_s } 20 | # s.social_media_url = 'https://twitter.com/' 21 | 22 | s.platform = :ios, '7.0' 23 | s.requires_arc = true 24 | 25 | s.source_files = 'Pod/Classes/**/*' 26 | s.resource_bundles = { 27 | 'JOTextField' => ['Pod/Assets/*.png'] 28 | } 29 | 30 | # s.public_header_files = 'Pod/Classes/**/*.h' 31 | s.frameworks = 'UIKit' 32 | s.dependency 'pop', '~> 1.0' 33 | end 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Jorge Ovalle 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pod/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lojals/JOTextField/cceffdd3af19afac89b2b47c62b45a06e69afa2a/Pod/Assets/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lojals/JOTextField/cceffdd3af19afac89b2b47c62b45a06e69afa2a/Pod/Classes/.gitkeep -------------------------------------------------------------------------------- /Pod/Classes/JOTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // JOTextField.h 3 | // 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 04/25/15. 6 | // Copyright (c) 2015 All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Vars.h" 11 | 12 | @interface JOTextField : UITextField { 13 | NSString *err; 14 | BOOL active; 15 | } 16 | 17 | //Properties 18 | @property int type; 19 | @property BOOL required; 20 | 21 | @property (strong,nonatomic) UIView *view; 22 | @property (strong,nonatomic) UIButton *tooltip; 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame :(int)type; 25 | 26 | -(void)config; 27 | -(NSString*)validate; 28 | -(void)setError; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pod/Classes/Vars.h: -------------------------------------------------------------------------------- 1 | // 2 | // Vars.h 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Vars : NSObject 12 | 13 | typedef enum JOTypes 14 | { 15 | TYPE_EMAIL = 100, 16 | TYPE_NUMBER = 101, 17 | TYPE_TEXT = 102, 18 | TYPE_NAME = 103, 19 | TYPE_PASSWORD = 104 20 | } JOTypes; 21 | 22 | 23 | typedef enum JOFontSizes 24 | { 25 | FONT_XSMALL = 13, 26 | FONT_SMALL = 15, 27 | FONT_XMEDIUM = 18, 28 | FONT_MEDIUM = 21, 29 | FONT_LARGE = 25, 30 | FONT_XLARGE = 30 31 | } JOFontSizes; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Pod/Classes/Vars.m: -------------------------------------------------------------------------------- 1 | // 2 | // Vars.m 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import "Vars.h" 10 | 11 | @implementation Vars 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JOTextField 2 | Just Copy these 4 files into your project and that's it. 3 | 4 | - JOTextField.h 5 | - JOTextField.m 6 | - Vars.h 7 | - Vars.m 8 | 9 | 10 | ![picture alt](http://i.imgur.com/OctSyOS.gif "Validation functionality") 11 | 12 | ### Validation of: 13 | - Email 14 | - Numbers 15 | - Strings 16 | - Required 17 | - Password length 18 | 19 | ![picture alt](http://i.imgur.com/qfTFkUe.png?2 "Example included") 20 | 21 | ## Installation/Requirements 22 | To Use JOTextField you'll need CocoaPods and pop facebook framework in your dependencies. 23 | 24 | ## Author 25 | Jorge Ovalle @lojals 26 | 27 | ## License 28 | JOTextField is available under the MIT license. See the LICENSE file for more info. 29 | -------------------------------------------------------------------------------- /Vars.h: -------------------------------------------------------------------------------- 1 | // 2 | // Vars.h 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Vars : NSObject 12 | 13 | typedef enum JOTypes 14 | { 15 | TYPE_EMAIL = 100, 16 | TYPE_NUMBER = 101, 17 | TYPE_TEXT = 102, 18 | TYPE_NAME = 103, 19 | TYPE_PASSWORD = 104 20 | } JOTypes; 21 | 22 | 23 | typedef enum JOFontSizes 24 | { 25 | FONT_XSMALL = 13, 26 | FONT_SMALL = 15, 27 | FONT_XMEDIUM = 18, 28 | FONT_MEDIUM = 21, 29 | FONT_LARGE = 25, 30 | FONT_XLARGE = 30 31 | } JOFontSizes; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Vars.m: -------------------------------------------------------------------------------- 1 | // 2 | // Vars.m 3 | // eldorado 4 | // 5 | // Created by Jorge Raul Ovalle Zuleta on 12/15/14. 6 | // Copyright (c) 2014 jomobile.co. All rights reserved. 7 | // 8 | 9 | #import "Vars.h" 10 | 11 | @implementation Vars 12 | 13 | @end 14 | --------------------------------------------------------------------------------