├── CuntingLabel.gif ├── CuntingLabel.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── Bing.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── CuntingLabel.xcscheme │ └── xcschememanagement.plist ├── CuntingLabel.xcworkspace └── contents.xcworkspacedata ├── CuntingLabel ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ └── LaunchScreen.storyboard ├── CardView.swift ├── Config.swift ├── CountingLabel.swift ├── Info.plist └── Main.swift ├── CuntingLabelTests ├── CuntingLabelTests.swift └── Info.plist ├── CuntingLabelUITests ├── CuntingLabelUITests.swift └── Info.plist ├── Podfile ├── Podfile.lock ├── Pods ├── ChameleonFramework │ ├── LICENSE.md │ ├── Pod │ │ └── Classes │ │ │ ├── Objective-C │ │ │ ├── Chameleon.h │ │ │ ├── ChameleonConstants.h │ │ │ ├── ChameleonConstants.m │ │ │ ├── ChameleonEnums.h │ │ │ ├── ChameleonMacros.h │ │ │ ├── Chameleon_.h │ │ │ ├── Chameleon_.m │ │ │ ├── NSArray+Chameleon.h │ │ │ ├── NSArray+Chameleon.m │ │ │ ├── UIAppearance+Swift.h │ │ │ ├── UIAppearance+Swift.m │ │ │ ├── UIButton+Chameleon.h │ │ │ ├── UIButton+Chameleon.m │ │ │ ├── UIColor+Chameleon.h │ │ │ ├── UIColor+Chameleon.m │ │ │ ├── UIColor+ChameleonPrivate.h │ │ │ ├── UIColor+ChameleonPrivate.m │ │ │ ├── UIImage+ChameleonPrivate.h │ │ │ ├── UIImage+ChameleonPrivate.m │ │ │ ├── UILabel+Chameleon.h │ │ │ ├── UILabel+Chameleon.m │ │ │ ├── UINavigationController+Chameleon.h │ │ │ ├── UINavigationController+Chameleon.m │ │ │ ├── UIView+ChameleonPrivate.h │ │ │ ├── UIView+ChameleonPrivate.m │ │ │ ├── UIViewController+Chameleon.h │ │ │ └── UIViewController+Chameleon.m │ │ │ └── Swift │ │ │ └── ChameleonShorthand.swift │ └── README.md ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── Bing.xcuserdatad │ │ └── xcschemes │ │ ├── ChameleonFramework.xcscheme │ │ ├── Pods-CuntingLabel.xcscheme │ │ ├── Pods-CuntingLabelTests.xcscheme │ │ ├── Pods-CuntingLabelUITests.xcscheme │ │ ├── SnapKit.xcscheme │ │ └── xcschememanagement.plist ├── SnapKit │ ├── LICENSE │ ├── README.md │ └── Source │ │ ├── Constraint.swift │ │ ├── ConstraintAttributes.swift │ │ ├── ConstraintDescription.swift │ │ ├── ConstraintItem.swift │ │ ├── ConstraintMaker.swift │ │ ├── ConstraintRelation.swift │ │ ├── Debugging.swift │ │ ├── EdgeInsets.swift │ │ ├── LayoutConstraint.swift │ │ ├── SnapKit.swift │ │ ├── View+SnapKit.swift │ │ └── ViewController+SnapKit.swift └── Target Support Files │ ├── ChameleonFramework │ ├── ChameleonFramework-dummy.m │ ├── ChameleonFramework-prefix.pch │ ├── ChameleonFramework-umbrella.h │ ├── ChameleonFramework.modulemap │ ├── ChameleonFramework.xcconfig │ └── Info.plist │ ├── Pods-CuntingLabel │ ├── Info.plist │ ├── Pods-CuntingLabel-acknowledgements.markdown │ ├── Pods-CuntingLabel-acknowledgements.plist │ ├── Pods-CuntingLabel-dummy.m │ ├── Pods-CuntingLabel-frameworks.sh │ ├── Pods-CuntingLabel-resources.sh │ ├── Pods-CuntingLabel-umbrella.h │ ├── Pods-CuntingLabel.debug.xcconfig │ ├── Pods-CuntingLabel.modulemap │ └── Pods-CuntingLabel.release.xcconfig │ ├── Pods-CuntingLabelTests │ ├── Info.plist │ ├── Pods-CuntingLabelTests-acknowledgements.markdown │ ├── Pods-CuntingLabelTests-acknowledgements.plist │ ├── Pods-CuntingLabelTests-dummy.m │ ├── Pods-CuntingLabelTests-frameworks.sh │ ├── Pods-CuntingLabelTests-resources.sh │ ├── Pods-CuntingLabelTests-umbrella.h │ ├── Pods-CuntingLabelTests.debug.xcconfig │ ├── Pods-CuntingLabelTests.modulemap │ └── Pods-CuntingLabelTests.release.xcconfig │ ├── Pods-CuntingLabelUITests │ ├── Info.plist │ ├── Pods-CuntingLabelUITests-acknowledgements.markdown │ ├── Pods-CuntingLabelUITests-acknowledgements.plist │ ├── Pods-CuntingLabelUITests-dummy.m │ ├── Pods-CuntingLabelUITests-frameworks.sh │ ├── Pods-CuntingLabelUITests-resources.sh │ ├── Pods-CuntingLabelUITests-umbrella.h │ ├── Pods-CuntingLabelUITests.debug.xcconfig │ ├── Pods-CuntingLabelUITests.modulemap │ └── Pods-CuntingLabelUITests.release.xcconfig │ └── SnapKit │ ├── Info.plist │ ├── SnapKit-dummy.m │ ├── SnapKit-prefix.pch │ ├── SnapKit-umbrella.h │ ├── SnapKit.modulemap │ └── SnapKit.xcconfig └── README.md /CuntingLabel.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/geekbing/CountingLabel/95b232d0d77e66d105c662e5c24849f6420ea4f5/CuntingLabel.gif -------------------------------------------------------------------------------- /CuntingLabel.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CuntingLabel.xcodeproj/xcuserdata/Bing.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /CuntingLabel.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/CuntingLabel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /CuntingLabel.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | CuntingLabel.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 37CA3D8A1D30939C0064E89E 16 | 17 | primary 18 | 19 | 20 | 37CA3D9E1D30939C0064E89E 21 | 22 | primary 23 | 24 | 25 | 37CA3DA91D30939C0064E89E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /CuntingLabel.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /CuntingLabel/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // CuntingLabel 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 17 | { 18 | // 设置根控制器 19 | setupRootController() 20 | 21 | return true 22 | } 23 | 24 | // 设置根控制器 25 | func setupRootController() 26 | { 27 | window = UIWindow(frame: UIScreen.mainScreen().bounds) 28 | window?.backgroundColor = UIColor.whiteColor() 29 | window?.rootViewController = Main() 30 | window?.makeKeyAndVisible() 31 | } 32 | 33 | func applicationWillResignActive(application: UIApplication) { 34 | // 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. 35 | // 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. 36 | } 37 | 38 | func applicationDidEnterBackground(application: UIApplication) { 39 | // 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. 40 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 41 | } 42 | 43 | func applicationWillEnterForeground(application: UIApplication) { 44 | // 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. 45 | } 46 | 47 | func applicationDidBecomeActive(application: UIApplication) { 48 | // 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. 49 | } 50 | 51 | func applicationWillTerminate(application: UIApplication) { 52 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 53 | } 54 | 55 | 56 | } 57 | 58 | -------------------------------------------------------------------------------- /CuntingLabel/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /CuntingLabel/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /CuntingLabel/CardView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CardView.swift 3 | // CuntingLabel 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | import ChameleonFramework 12 | 13 | class CardView: UIView 14 | { 15 | // 总金额数字 16 | var totalMoney: CountingLabel? 17 | 18 | override init(frame: CGRect) 19 | { 20 | super.init(frame: frame) 21 | self.backgroundColor = UIColor(red:0.95, green:0.95, blue:0.95, alpha:1.00) 22 | self.layer.masksToBounds = true 23 | self.layer.cornerRadius = 6 24 | 25 | // 总金额文字 26 | let label = UILabel() 27 | label.textAlignment = .Center 28 | label.text = "总金额" 29 | label.font = font16 30 | label.textColor = UIColor.flatGrayColor() 31 | self.addSubview(label) 32 | 33 | // 总金额数字 34 | totalMoney = CountingLabel() 35 | totalMoney?.textAlignment = .Center 36 | totalMoney?.font = font40 37 | totalMoney?.adjustsFontSizeToFitWidth = true 38 | totalMoney?.textColor = UIColor.flatRedColor() 39 | self.addSubview(totalMoney!) 40 | 41 | // 布局 42 | label.snp_makeConstraints { (make) in 43 | make.top.equalTo(self).offset(10) 44 | make.left.equalTo(self) 45 | make.right.equalTo(self) 46 | make.height.equalTo(30) 47 | } 48 | totalMoney?.snp_makeConstraints(closure: { (make) in 49 | make.top.equalTo(label.snp_bottom) 50 | make.left.equalTo(self) 51 | make.right.equalTo(self) 52 | make.bottom.equalTo(self) 53 | }) 54 | } 55 | 56 | required init?(coder aDecoder: NSCoder) 57 | { 58 | fatalError("init(coder:) has not been implemented") 59 | } 60 | } -------------------------------------------------------------------------------- /CuntingLabel/Config.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Config.swift 3 | // CuntingLabel 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | // 屏幕长和宽 12 | let screenWidth = UIScreen.mainScreen().bounds.size.width 13 | let screenHeight = UIScreen.mainScreen().bounds.size.height 14 | 15 | // 字体 16 | let font16 = UIFont.systemFontOfSize(16, weight: UIFontWeightThin) 17 | let font40 = UIFont.systemFontOfSize(40, weight: UIFontWeightRegular) 18 | 19 | // 颜色 20 | //let flatRedColor = UIColor(red: <#T##CGFloat#>, green: <#T##CGFloat#>, blue: <#T##CGFloat#>, alpha: <#T##CGFloat#>) 21 | -------------------------------------------------------------------------------- /CuntingLabel/CountingLabel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CountingLabel.swift 3 | // CuntingLabel 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class CountingLabel: UILabel 12 | { 13 | // 开始的数字 14 | var fromNum = NSNumber(integer: 0) 15 | 16 | // 结束的数字 17 | var toNum = NSNumber(integer: 100) 18 | 19 | // 动画的持续时间 20 | private var duration: NSTimeInterval = 1.0 21 | 22 | // 动画开始时刻的时间 23 | private var startTime: CFTimeInterval = 0 24 | 25 | // 字符串格式化 26 | var format: NSString = "%d" 27 | 28 | // 格式化字符串闭包 29 | var formatBlock: ((value: Double) -> NSString)? 30 | 31 | // 定时器 32 | private var displayLink: CADisplayLink! 33 | 34 | override init(frame: CGRect) 35 | { 36 | super.init(frame: frame) 37 | } 38 | 39 | required init?(coder aDecoder: NSCoder) 40 | { 41 | fatalError("init(coder:) has not been implemented") 42 | } 43 | 44 | // 从数字fromNum经过duration长的时间变化到数字toNum 45 | func countFrom(fromNum fromNum: NSNumber, toNum: NSNumber, duration: Double) 46 | { 47 | self.text = fromNum.stringValue 48 | self.fromNum = fromNum 49 | self.toNum = toNum 50 | self.duration = duration 51 | 52 | startDisplayLink() 53 | } 54 | 55 | // 开始定时器 56 | private func startDisplayLink() 57 | { 58 | if displayLink != nil 59 | { 60 | displayLink.invalidate() 61 | } 62 | displayLink = CADisplayLink(target: self, selector: .handleDisplayLink) 63 | // 记录动画开始时刻的时间 64 | startTime = CACurrentMediaTime() 65 | displayLink.addToRunLoop(NSRunLoop.currentRunLoop(), forMode: NSRunLoopCommonModes) 66 | } 67 | 68 | // 定时器的回调 69 | @objc private func handleDisplayLink(displayLink: CADisplayLink) 70 | { 71 | if displayLink.timestamp - startTime >= duration 72 | { 73 | if formatBlock != nil 74 | { 75 | self.text = self.formatBlock!(value: toNum.doubleValue) as String 76 | } 77 | else 78 | { 79 | self.text = NSString(format: self.format, toNum.doubleValue) as String 80 | } 81 | // 结束定时器 82 | stopCounting() 83 | } 84 | else 85 | { 86 | // 计算现在时刻的数字 87 | let current = (toNum.doubleValue - fromNum.doubleValue) * (displayLink.timestamp - startTime) / duration + fromNum.doubleValue 88 | if formatBlock != nil 89 | { 90 | self.text = self.formatBlock!(value: current) as String 91 | } 92 | else 93 | { 94 | self.text = NSString(format: self.format, current) as String 95 | } 96 | } 97 | } 98 | 99 | // 结束定时器 100 | func stopCounting() 101 | { 102 | displayLink.invalidate() 103 | } 104 | } 105 | 106 | private extension Selector 107 | { 108 | static let handleDisplayLink = #selector(CountingLabel.handleDisplayLink) 109 | } -------------------------------------------------------------------------------- /CuntingLabel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /CuntingLabel/Main.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Main.swift 3 | // CuntingLabel 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SnapKit 11 | import ChameleonFramework 12 | 13 | class Main: UIViewController 14 | { 15 | var cardView1: CardView! 16 | var cardView2: CardView! 17 | var cardView3: CardView! 18 | var cardView4: CardView! 19 | 20 | override func viewDidLoad() 21 | { 22 | super.viewDidLoad() 23 | view.backgroundColor = UIColor.whiteColor() 24 | 25 | // 整数Demo 26 | cardView1 = CardView() 27 | cardView1.totalMoney?.text = "0" 28 | cardView1.totalMoney?.format = "%.0f" 29 | cardView1.totalMoney?.countFrom(fromNum: 0, toNum: 100, duration: 1.0) 30 | view.addSubview(cardView1) 31 | 32 | // 浮点型Demo 33 | cardView2 = CardView() 34 | cardView2.totalMoney?.text = "1.02" 35 | cardView2.totalMoney?.format = "%.2f" 36 | cardView2.totalMoney?.countFrom(fromNum: 1.02, toNum: 520.00, duration: 2.0) 37 | view.addSubview(cardView2) 38 | 39 | // 千分位分隔符Demo 40 | cardView3 = CardView() 41 | cardView3.totalMoney?.text = "1.02" 42 | cardView3.totalMoney?.formatBlock = { (value: Double) -> NSString in 43 | let str = NSString(format: "%.2f", value) 44 | 45 | // 按照千分位分隔符输出 46 | let formatter = NSNumberFormatter() 47 | formatter.numberStyle = .DecimalStyle 48 | formatter.positiveFormat = "###,##0.00" 49 | 50 | return formatter.stringFromNumber(NSNumber(double: str.doubleValue))! 51 | } 52 | cardView3.totalMoney?.countFrom(fromNum: 1.02, toNum: 13145.20, duration: 3.0) 53 | view.addSubview(cardView3) 54 | 55 | // 点击启动Demo 56 | cardView4 = CardView() 57 | cardView4.totalMoney?.text = "1.02" 58 | cardView4.totalMoney?.formatBlock = { (value: Double) -> NSString in 59 | let str = NSString(format: "%.2f", value) 60 | 61 | // 按照千分位分隔符输出 62 | let formatter = NSNumberFormatter() 63 | formatter.numberStyle = .DecimalStyle 64 | formatter.positiveFormat = "###,##0.00" 65 | 66 | return formatter.stringFromNumber(NSNumber(double: str.doubleValue))! 67 | } 68 | view.addSubview(cardView4) 69 | 70 | // 重启按钮 71 | let startBtn = UIButton() 72 | startBtn.setTitle("重启", forState: .Normal) 73 | startBtn.setTitleColor(.flatGrayColor(), forState: .Normal) 74 | startBtn.addTarget(self, action: .startBtnClick, forControlEvents: .TouchUpInside) 75 | view.addSubview(startBtn) 76 | 77 | // 停止按钮 78 | let stopBtn = UIButton() 79 | stopBtn.setTitle("停止", forState: .Normal) 80 | stopBtn.setTitleColor(.flatGrayColor(), forState: .Normal) 81 | stopBtn.addTarget(self, action: .stopBtnClick, forControlEvents: .TouchUpInside) 82 | view.addSubview(stopBtn) 83 | 84 | // 布局 85 | cardView1.snp_makeConstraints { (make) in 86 | make.top.equalTo(self.view).offset(40) 87 | make.left.equalTo(self.view).offset(20) 88 | make.right.equalTo(self.view).offset(-20) 89 | make.height.equalTo(100) 90 | } 91 | cardView2.snp_makeConstraints { (make) in 92 | make.top.equalTo(cardView1.snp_bottom).offset(20) 93 | make.left.equalTo(self.view).offset(20) 94 | make.right.equalTo(self.view).offset(-20) 95 | make.height.equalTo(100) 96 | } 97 | cardView3.snp_makeConstraints { (make) in 98 | make.top.equalTo(cardView2.snp_bottom).offset(20) 99 | make.left.equalTo(self.view).offset(20) 100 | make.right.equalTo(self.view).offset(-20) 101 | make.height.equalTo(100) 102 | } 103 | cardView4.snp_makeConstraints { (make) in 104 | make.top.equalTo(cardView3.snp_bottom).offset(20) 105 | make.left.equalTo(self.view).offset(20) 106 | make.right.equalTo(self.view).offset(-20) 107 | make.height.equalTo(100) 108 | } 109 | startBtn.snp_makeConstraints { (make) in 110 | make.width.equalTo(100) 111 | make.height.equalTo(30) 112 | make.top.equalTo(cardView4.snp_bottom).offset(20) 113 | make.centerX.equalTo(view).offset(-100) 114 | } 115 | stopBtn.snp_makeConstraints { (make) in 116 | make.width.equalTo(100) 117 | make.height.equalTo(30) 118 | make.top.equalTo(cardView4.snp_bottom).offset(20) 119 | make.centerX.equalTo(view).offset(100) 120 | } 121 | } 122 | 123 | // 点击重新启动按钮 124 | func startBtnClick() 125 | { 126 | cardView4.totalMoney?.countFrom(fromNum: 1.02, toNum: 10000013145.20, duration: 4.0) 127 | } 128 | 129 | // 点击停止按钮 130 | func stopBtnClick() 131 | { 132 | cardView4.totalMoney?.stopCounting() 133 | } 134 | 135 | override func didReceiveMemoryWarning() 136 | { 137 | super.didReceiveMemoryWarning() 138 | } 139 | } 140 | 141 | private extension Selector 142 | { 143 | static let startBtnClick = #selector(Main.startBtnClick) 144 | static let stopBtnClick = #selector(Main.stopBtnClick) 145 | } -------------------------------------------------------------------------------- /CuntingLabelTests/CuntingLabelTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CuntingLabelTests.swift 3 | // CuntingLabelTests 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import CuntingLabel 11 | 12 | class CuntingLabelTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measureBlock { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CuntingLabelTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /CuntingLabelUITests/CuntingLabelUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CuntingLabelUITests.swift 3 | // CuntingLabelUITests 4 | // 5 | // Created by Bing on 7/9/16. 6 | // Copyright © 2016 Bing. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class CuntingLabelUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /CuntingLabelUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'CuntingLabel' do 5 | # Comment this line if you're not using Swift and don't want to use dynamic frameworks 6 | use_frameworks! 7 | 8 | # Pods for CuntingLabel 9 | pod 'SnapKit' 10 | pod 'ChameleonFramework/Swift' 11 | target 'CuntingLabelTests' do 12 | inherit! :search_paths 13 | # Pods for testing 14 | end 15 | 16 | target 'CuntingLabelUITests' do 17 | inherit! :search_paths 18 | # Pods for testing 19 | end 20 | 21 | end 22 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ChameleonFramework/Default (2.1.0) 3 | - ChameleonFramework/Swift (2.1.0): 4 | - ChameleonFramework/Default 5 | - SnapKit (0.21.1) 6 | 7 | DEPENDENCIES: 8 | - ChameleonFramework/Swift 9 | - SnapKit 10 | 11 | SPEC CHECKSUMS: 12 | ChameleonFramework: d21a3cc247abfe5e37609a283a8238b03575cf64 13 | SnapKit: bbad04cb016c7cead63965f16b00c09318d271ee 14 | 15 | PODFILE CHECKSUM: 62cf2bc9d9fdfa903b16c2ba8142a624708f8cc9 16 | 17 | COCOAPODS: 1.0.1 18 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/LICENSE.md: -------------------------------------------------------------------------------- 1 | ##The MIT License (MIT) 2 | 3 | > Copyright (c) 2014-2015 Vicc Alexander 4 | 5 | > Permission is hereby granted, free of charge, to any person obtaining a copy 6 | > of this software and associated documentation files (the "Software"), to deal 7 | > in the Software without restriction, including without limitation the rights 8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | > copies of the Software, and to permit persons to whom the Software is 10 | > furnished to do so, subject to the following conditions: 11 | 12 | > The above copyright notice and this permission notice shall be included in all 13 | > copies or substantial portions of the Software. 14 | 15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | > SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon.h: -------------------------------------------------------------------------------- 1 | // 2 | // Chameleon.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 9/24/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Chameleon. 12 | FOUNDATION_EXPORT double ChameleonVersionNumber; 13 | 14 | //! Project version string for Chameleon. 15 | FOUNDATION_EXPORT const unsigned char ChameleonVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | #import "Chameleon_.h" 20 | 21 | #import "UIButton+Chameleon.h" 22 | #import "UILabel+Chameleon.h" 23 | #import "UIColor+ChameleonPrivate.h" 24 | #import "UIImage+ChameleonPrivate.h" 25 | #import "UIView+ChameleonPrivate.h" 26 | #import "UIAppearance+Swift.h" 27 | 28 | #import "NSArray+Chameleon.h" 29 | #import "UIColor+Chameleon.h" 30 | #import "UINavigationController+Chameleon.h" 31 | #import "UIViewController+Chameleon.h" 32 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/ChameleonConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // Constants.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | /** 13 | * A contrasting status bar, intended for use on any backgrounds. 14 | * 15 | * @since 2.0 16 | */ 17 | extern const UIStatusBarStyle UIStatusBarStyleContrast; 18 | 19 | @interface ChameleonConstants : NSObject 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/ChameleonConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // Constants.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "ChameleonConstants.h" 10 | 11 | const UIStatusBarStyle UIStatusBarStyleContrast = 100; 12 | 13 | @implementation ChameleonConstants 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/ChameleonEnums.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChameleonEnums.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/8/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #ifndef Chameleon_ChameleonEnums_h 10 | #define Chameleon_ChameleonEnums_h 11 | 12 | /** 13 | * Specifies how text-based UI elements and other content such as switch knobs, should be colored. 14 | * 15 | * @since 2.0 16 | */ 17 | 18 | typedef NS_ENUM(NSUInteger, UIContentStyle) { 19 | /** 20 | * Automatically chooses and colors text-based elements with the shade that best contrasts its @c backgroundColor. 21 | * 22 | * @since 2.0 23 | */ 24 | UIContentStyleContrast, 25 | /** 26 | * Colors text-based elements using a light shade. 27 | * 28 | * @since 2.0 29 | */ 30 | UIContentStyleLight, 31 | /** 32 | * Colors text-based elements using a light shade. 33 | * 34 | * @since 2.0 35 | */ 36 | UIContentStyleDark 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/ChameleonMacros.h: -------------------------------------------------------------------------------- 1 | 2 | // ChameleonMacros.h 3 | 4 | /* 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014-2015 Vicc Alexander. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | #import "UIColor+Chameleon.h" 31 | 32 | #pragma mark - Light Shades Shorthand 33 | 34 | #define FlatBlack [UIColor flatBlackColor] 35 | #define FlatBlue [UIColor flatBlueColor] 36 | #define FlatBrown [UIColor flatBrownColor] 37 | #define FlatCoffee [UIColor flatCoffeeColor] 38 | #define FlatForestGreen [UIColor flatForestGreenColor] 39 | #define FlatGray [UIColor flatGrayColor] 40 | #define FlatGreen [UIColor flatGreenColor] 41 | #define FlatLime [UIColor flatLimeColor] 42 | #define FlatMagenta [UIColor flatMagentaColor] 43 | #define FlatMaroon [UIColor flatMaroonColor] 44 | #define FlatMint [UIColor flatMintColor] 45 | #define FlatNavyBlue [UIColor flatNavyBlueColor] 46 | #define FlatOrange [UIColor flatOrangeColor] 47 | #define FlatPink [UIColor flatPinkColor] 48 | #define FlatPlum [UIColor flatPlumColor] 49 | #define FlatPowderBlue [UIColor flatPowderBlueColor] 50 | #define FlatPurple [UIColor flatPurpleColor] 51 | #define FlatRed [UIColor flatRedColor] 52 | #define FlatSand [UIColor flatSandColor] 53 | #define FlatSkyBlue [UIColor flatSkyBlueColor] 54 | #define FlatTeal [UIColor flatTealColor] 55 | #define FlatWatermelon [UIColor flatWatermelonColor] 56 | #define FlatWhite [UIColor flatWhiteColor] 57 | #define FlatYellow [UIColor flatYellowColor] 58 | 59 | // --------------------------------------------------- 60 | 61 | #pragma mark - Dark Shades Shorthand 62 | 63 | #define FlatBlackDark [UIColor flatBlackColorDark] 64 | #define FlatBlueDark [UIColor flatBlueColorDark] 65 | #define FlatBrownDark [UIColor flatBrownColorDark] 66 | #define FlatCoffeeDark [UIColor flatCoffeeColorDark] 67 | #define FlatForestGreenDark [UIColor flatForestGreenColorDark] 68 | #define FlatGrayDark [UIColor flatGrayColorDark] 69 | #define FlatGreenDark [UIColor flatGreenColorDark] 70 | #define FlatLimeDark [UIColor flatLimeColorDark] 71 | #define FlatMagentaDark [UIColor flatMagentaColorDark] 72 | #define FlatMaroonDark [UIColor flatMaroonColorDark] 73 | #define FlatMintDark [UIColor flatMintColorDark] 74 | #define FlatNavyBlueDark [UIColor flatNavyBlueColorDark] 75 | #define FlatOrangeDark [UIColor flatOrangeColorDark] 76 | #define FlatPinkDark [UIColor flatPinkColorDark] 77 | #define FlatPlumDark [UIColor flatPlumColorDark] 78 | #define FlatPowderBlueDark [UIColor flatPowderBlueColorDark] 79 | #define FlatPurpleDark [UIColor flatPurpleColorDark] 80 | #define FlatRedDark [UIColor flatRedColorDark] 81 | #define FlatSandDark [UIColor flatSandColorDark] 82 | #define FlatSkyBlueDark [UIColor flatSkyBlueColorDark] 83 | #define FlatTealDark [UIColor flatTealColorDark] 84 | #define FlatWatermelonDark [UIColor flatWatermelonColorDark] 85 | #define FlatWhiteDark [UIColor flatWhiteColorDark] 86 | #define FlatYellowDark [UIColor flatYellowColorDark] 87 | 88 | // --------------------------------------------------- 89 | 90 | #pragma mark - Special Colors Shorthand 91 | 92 | #define RandomFlatColor [UIColor randomFlatColor] 93 | #define ClearColor [UIColor clearColor] 94 | 95 | // --------------------------------------------------- 96 | 97 | #pragma mark - UIColor Methods Shorthand 98 | 99 | #define AverageColorFromImage(image) [UIColor colorWithAverageColorFromImage:image] 100 | #define AverageColorFromImageWithAlpha(image, alpha) [UIColor colorWithAverageColorFromImage:image withAlpha:alpha] 101 | 102 | #define ComplementaryFlatColor(color) [UIColor colorWithComplementaryFlatColorOf:color] 103 | #define ComplementaryFlatColorWithAlpha(color, alpha) [UIColor colorWithComplementaryFlatColorOf:color withAlpha:alpha] 104 | 105 | #define ContrastColor(backgroundColor, returnFlat) [UIColor colorWithContrastingBlackOrWhiteColorOn:backgroundColor isFlat:returnFlat] 106 | #define ContrastColorWithAlpha(backgroundColor, returnFlat, alpha) [UIColor colorWithContrastingBlackOrWhiteColorOn:backgroundColor isFlat:returnFlat alpha:alpha] 107 | 108 | #define GradientColor(gradientStyle, frame, colors) [UIColor colorWithGradientStyle:gradientStyle withFrame:frame andColors:colors] 109 | 110 | #define HexColor(hexString) [UIColor colorWithHexString:hexString] 111 | #define HexColorWithAlpha(hexString, alpha) [UIColor colorWithHexString:hexString withAlpha:alpha] 112 | 113 | #define RandomFlatColorInArray(colors) [UIColor colorWithRandomColorInArray:colors] 114 | #define RandomFlatColorExcluding(colors) [UIColor colorWithRandomFlatColorExcludingColorsInArray:colors]; 115 | #define RandomFlatColorWithShade(shade) [UIColor colorWithRandomFlatColorOfShadeStyle:shade] 116 | #define RandomFlatColorWithShadeAndAlpha(shade, alpha) [UIColor colorWithRandomFlatColorOfShadeStyle:shade withAlpha:alpha] 117 | 118 | // --------------------------------------------------- 119 | 120 | #pragma mark - NSArray Shorthand 121 | 122 | #define ColorsWithScheme(colorSchemeType, color, isFlatScheme) [NSArray arrayOfColorsWithColorScheme:colorSchemeType usingColor:color withFlatScheme:isFlatScheme] 123 | #define ColorsFromImage(image, isFlatScheme) [NSArray arrayOfColorsFromImage:image withFlatScheme:isFlatScheme] 124 | 125 | 126 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/Chameleon_.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChameleonInternal.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | #import "ChameleonConstants.h" 13 | #import "ChameleonEnums.h" 14 | #import "ChameleonMacros.h" 15 | 16 | #import "NSArray+Chameleon.h" 17 | #import "UIColor+Chameleon.h" 18 | #import "UINavigationController+Chameleon.h" 19 | #import "UIViewController+Chameleon.h" 20 | 21 | @interface Chameleon : NSObject 22 | 23 | #pragma mark - Global Theming 24 | 25 | /** 26 | * Set a global theme using a primary color and the specified content style. 27 | * 28 | * @param primaryColor The primary color to theme all controllers with. 29 | * @param contentStyle The contentStyle. 30 | * 31 | * @note By default the secondary color will be a darker shade of the specified primary color. 32 | * 33 | * @since 2.0 34 | */ 35 | + (void)setGlobalThemeUsingPrimaryColor:(UIColor *)primaryColor 36 | withContentStyle:(UIContentStyle)contentStyle; 37 | 38 | /** 39 | * Set a global theme using a primary color, secondary color, and the specified content style. 40 | * 41 | * @param primaryColor The primary color to theme all controllers with. 42 | * @param secondaryColor The secondary color to theme all controllers with. 43 | * @param contentStyle The contentStyle. 44 | * 45 | * @since 2.0 46 | */ 47 | + (void)setGlobalThemeUsingPrimaryColor:(UIColor *)primaryColor 48 | withSecondaryColor:(UIColor *)secondaryColor 49 | andContentStyle:(UIContentStyle)contentStyle; 50 | 51 | /** 52 | * Set a global theme using a primary color, secondary color, font name, and the specified content style. 53 | * 54 | * @param primaryColor The primary color to theme all controllers with. 55 | * @param secondaryColor The secondary color to theme all controllers with. 56 | * @param fontName The default font for all text-based UI elements. 57 | * @param contentStyle The contentStyle. 58 | * 59 | * @since 2.0 60 | */ 61 | + (void)setGlobalThemeUsingPrimaryColor:(UIColor *)primaryColor 62 | withSecondaryColor:(UIColor *)secondaryColor 63 | usingFontName:(NSString *)fontName 64 | andContentStyle:(UIContentStyle)contentStyle; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/NSArray+Chameleon.h: -------------------------------------------------------------------------------- 1 | 2 | // NSArray+Chameleon.h 3 | 4 | /* 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014-2015 Vicc Alexander. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | #import 31 | #import 32 | 33 | #pragma mark - Enums 34 | 35 | /** 36 | * Color schemes with which to select colors using a specified color. 37 | * 38 | * @since 1.0 39 | */ 40 | typedef NS_ENUM(NSInteger, ColorScheme){ 41 | /** 42 | * Analogous color schemes use colors that are next to each other on the color wheel. They usually match well and create serene and comfortable designs. Analogous color schemes are often found in nature and are harmonious and pleasing to the eye. Make sure you have enough contrast when choosing an analogous color scheme. Choose one color to dominate, a second to support. The third color is used (along with black, white or gray) as an accent. 43 | * 44 | * @since 1.0 45 | */ 46 | ColorSchemeAnalogous, 47 | /** 48 | * Colors that are opposite each other on the color wheel are considered to be complementary colors (example: red and green). The high contrast of complementary colors creates a vibrant look especially when used at full saturation. This color scheme must be managed well so it is not jarring. Complementary colors are tricky to use in large doses, but work well when you want something to stand out. Complementary colors are really bad for text. 49 | * 50 | * @since 1.0 51 | */ 52 | ColorSchemeTriadic, 53 | /** 54 | * A triadic color scheme uses colors that are evenly spaced around the color wheel. Triadic color harmonies tend to be quite vibrant, even if you use pale or unsaturated versions of your hues. To use a triadic harmony successfully, the colors should be carefully balanced - let one color dominate and use the two others for accent. 55 | * 56 | * @since 1.0 57 | */ 58 | ColorSchemeComplementary 59 | }; 60 | 61 | @interface NSArray (Chameleon) 62 | 63 | #pragma mark - Generating Color Schemes 64 | 65 | /** 66 | * Generates and creates an array of 5 color objects in the HSB colorspace from the specified color. 67 | * 68 | * @param colorScheme The color scheme with which to select colors using a specified color. 69 | * @param color The specified color which the color scheme is built around. 70 | * @param isFlatScheme Pass YES to return flat color objects. 71 | * 72 | * @return An array of 5 color objects in the HSB colorspace. 73 | * 74 | * @since 2.0 75 | */ 76 | + (NSArray *)arrayOfColorsWithColorScheme:(ColorScheme)colorScheme 77 | usingColor:(UIColor *)color 78 | withFlatScheme:(BOOL)isFlatScheme; 79 | 80 | /** 81 | * Generates and creates an array of 5 color objects in the HSB colorspace that appear most often in a specified image. 82 | * 83 | * @param image The specified image which the color scheme is built around. 84 | * @param isFlatScheme Pass YES to return flat color objects. 85 | * 86 | * @return An array of 5 color objects in the HSB colorspace. 87 | * 88 | * @since 2.0 89 | */ 90 | + (NSArray *)arrayOfColorsFromImage:(UIImage *)image 91 | withFlatScheme:(BOOL)isFlatScheme; 92 | 93 | #pragma mark - Deprecated Methods 94 | 95 | /** 96 | * Generates and creates an array of 5 color objects in the HSB colorspace from the specified color. 97 | * 98 | * @param colorScheme The color scheme with which to select colors using a specified color. 99 | * 100 | * @param color The specified color which the color scheme is built around. 101 | * 102 | * @param isFlatScheme Pass YES to return flat color objects. 103 | * 104 | * @return An array of 5 color objects in the HSB colorspace. 105 | * 106 | * @since 1.1.2 107 | */ 108 | + (NSArray *)arrayOfColorsWithColorScheme:(ColorScheme)colorScheme 109 | with:(UIColor *)color 110 | flatScheme:(BOOL)isFlatScheme __attribute((deprecated(" Use -arrayOfColorsWithColorScheme:usingColor:withFlatScheme: instead (First deprecated in Chameleon 2.0)."))); 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIAppearance+Swift.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIAppearance+Swift.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 11/26/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (UIViewAppearance_Swift) 12 | 13 | // @param containers An array of Class < UIAppearanceContainer > 14 | // http://stackoverflow.com/a/28765193 15 | + (instancetype)appearanceWhenContainedWithin:(NSArray *)containers; 16 | 17 | @end -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIAppearance+Swift.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIAppearance+Swift.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 11/26/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UIAppearance+Swift.h" 10 | 11 | @implementation UIView (UIViewAppearance_Swift) 12 | 13 | + (instancetype)appearanceWhenContainedWithin: (NSArray *)containers { 14 | 15 | NSUInteger count = containers.count; 16 | NSAssert(count <= 10, @"The count of containers greater than 10 is not supported."); 17 | 18 | return [self appearanceWhenContainedIn: 19 | count > 0 ? containers[0] : nil, 20 | count > 1 ? containers[1] : nil, 21 | count > 2 ? containers[2] : nil, 22 | count > 3 ? containers[3] : nil, 23 | count > 4 ? containers[4] : nil, 24 | count > 5 ? containers[5] : nil, 25 | count > 6 ? containers[6] : nil, 26 | count > 7 ? containers[7] : nil, 27 | count > 8 ? containers[8] : nil, 28 | count > 9 ? containers[9] : nil, 29 | nil]; 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIButton+Chameleon.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Chameleon.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 9/20/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIButton (Chameleon) 12 | 13 | - (void)setSubstituteFontName:(NSString *)name UI_APPEARANCE_SELECTOR; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIButton+Chameleon.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+Chameleon.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 9/20/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UIButton+Chameleon.h" 10 | 11 | @implementation UIButton (Chameleon) 12 | 13 | #pragma GCC diagnostic push 14 | #pragma GCC diagnostic ignored "-Wdeprecated-declarations" 15 | 16 | - (void)setSubstituteFontName:(NSString *)name UI_APPEARANCE_SELECTOR { 17 | 18 | self.font = [UIFont fontWithName:name size:self.font.pointSize]; 19 | } 20 | 21 | #pragma GCC diagnostic pop 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIColor+ChameleonPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+ChameleonPrivate.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/6/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface UIColor (ChameleonPrivate) 13 | 14 | @property (nonatomic, readwrite) NSUInteger count; 15 | 16 | #pragma mark - Class Methods 17 | 18 | + (UIColor *)colorFromImage:(UIImage *)image atPoint:(CGPoint)point; 19 | 20 | - (UIColor *)colorWithMinimumSaturation:(CGFloat)saturation; 21 | 22 | #pragma mark - Instance Methods 23 | 24 | - (BOOL)isDistinct:(UIColor *)color; 25 | 26 | - (BOOL)getValueForX:(CGFloat *)X 27 | valueForY:(CGFloat *)Y 28 | valueForZ:(CGFloat *)Z 29 | alpha:(CGFloat *)alpha; 30 | 31 | - (BOOL)getLightness:(CGFloat *)L 32 | valueForA:(CGFloat *)A 33 | valueForB:(CGFloat *)B 34 | alpha:(CGFloat *)alpha; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIColor+ChameleonPrivate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+ChameleonPrivate.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/6/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UIColor+ChameleonPrivate.h" 10 | 11 | @implementation UIColor (ChameleonPrivate) 12 | 13 | @dynamic count; 14 | 15 | #pragma mark - Associated Objects Methods 16 | 17 | - (void)setCount:(NSUInteger)count { 18 | objc_setAssociatedObject(self, @selector(count), [NSNumber numberWithUnsignedInteger:count], OBJC_ASSOCIATION_RETAIN_NONATOMIC); 19 | } 20 | 21 | - (NSUInteger)count { 22 | NSNumber *number = objc_getAssociatedObject(self, @selector(count)); 23 | return [number unsignedIntegerValue]; 24 | } 25 | 26 | #pragma mark - Class Methods 27 | 28 | // Would not have been possible without - http://stackoverflow.com/a/1262893 29 | + (UIColor *)colorFromImage:(UIImage *)image atPoint:(CGPoint)point { 30 | 31 | //Encapsulate our image 32 | CGImageRef imageRef = image.CGImage; 33 | NSUInteger width = CGImageGetWidth(imageRef); 34 | NSUInteger height = CGImageGetHeight(imageRef); 35 | 36 | //Specify the colorspace we're in 37 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 38 | 39 | //Extract the data we need 40 | unsigned char *rawData = calloc(height * width * 4, sizeof(unsigned char)); 41 | NSUInteger bytesPerPixel = 4; 42 | NSUInteger bytesPerRow = bytesPerPixel * width; 43 | NSUInteger bitsPerComponent = 8; 44 | CGContextRef context = CGBitmapContextCreate(rawData, width, height, bitsPerComponent, bytesPerRow, 45 | colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 46 | //Release colorspace 47 | CGColorSpaceRelease(colorSpace); 48 | 49 | //Draw and release image 50 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); 51 | CGContextRelease(context); 52 | 53 | //rawData now contains the image data in RGBA8888 54 | NSInteger byteIndex = (bytesPerRow * point.y) + (point.x * bytesPerPixel); 55 | 56 | //Define our RGBA values 57 | CGFloat red = (rawData[byteIndex] * 1.f) / 255.f; 58 | CGFloat green = (rawData[byteIndex + 1] * 1.f) / 255.f; 59 | CGFloat blue = (rawData[byteIndex + 2] * 1.f) / 255.f; 60 | CGFloat alpha = (rawData[byteIndex + 3] * 1.0) / 255.f; 61 | 62 | //Free our rawData 63 | free(rawData); 64 | 65 | //Return color 66 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 67 | } 68 | 69 | - (UIColor *)colorWithMinimumSaturation:(CGFloat)saturation { 70 | if (!self) 71 | return nil; 72 | 73 | CGFloat h, s, b, a; 74 | [self getHue:&h saturation:&s brightness:&b alpha:&a]; 75 | 76 | if (s < saturation) 77 | return [UIColor colorWithHue:h saturation:saturation brightness:b alpha:a]; 78 | 79 | return self; 80 | } 81 | 82 | #pragma mark - Instance Methods 83 | 84 | - (BOOL)isDistinct:(UIColor *)color { 85 | 86 | if (!self || !color) { 87 | return NO; 88 | } 89 | 90 | CGFloat r, g, b, a; 91 | CGFloat rc, gc, bc, ac; 92 | 93 | [self getRed:&r green:&g blue:&b alpha:&a]; 94 | [color getRed:&rc green:&gc blue:&bc alpha:&ac]; 95 | 96 | CGFloat threshold = 0.25f; 97 | 98 | if (fabs(r - rc) > threshold || fabs(g - gc) > threshold || 99 | 100 | fabs(b - bc) > threshold || fabs(a - ac) > threshold) { 101 | 102 | // Check for grays 103 | if (fabs(r - g) < 0.03f && fabs(r - b) < 0.03f) { 104 | 105 | if (fabs(rc - gc) < 0.03f && (fabs(rc - bc) < 0.03f)) { 106 | return NO; 107 | } 108 | 109 | } 110 | 111 | return YES; 112 | } 113 | 114 | return NO; 115 | } 116 | 117 | - (BOOL)getValueForX:(CGFloat *)X valueForY:(CGFloat *)Y valueForZ:(CGFloat *)Z alpha:(CGFloat *)alpha{ 118 | 119 | if ([self respondsToSelector:@selector(getRed:green:blue:alpha:)]) { 120 | 121 | //Get RGB values from the input color 122 | CGFloat red = 0, green = 0, blue = 0, alpha1 = 0; 123 | [self getRed:&red green:&green blue:&blue alpha:&alpha1]; 124 | 125 | //Run our input color's RGB values through the XYZ algorithm to convert them into XYZ values 126 | NSArray *XYZValues = [self arrayOfXYZValuesForR:red G:green B:blue A:alpha1]; 127 | *X = [XYZValues[0] floatValue]; 128 | *Y = [XYZValues[1] floatValue]; 129 | *Z = [XYZValues[2] floatValue]; 130 | *alpha = [XYZValues[3] floatValue]; 131 | 132 | return YES; 133 | } 134 | 135 | return NO; 136 | } 137 | 138 | - (BOOL)getLightness:(CGFloat *)L valueForA:(CGFloat *)A valueForB:(CGFloat *)B alpha:(CGFloat *)alpha { 139 | 140 | if ([self respondsToSelector:@selector(getRed:green:blue:alpha:)]) { 141 | 142 | //Get RGB values from the input color 143 | CGFloat red = 0, green = 0, blue = 0, alpha1 = 0; 144 | [self getRed:&red green:&green blue:&blue alpha:&alpha1]; 145 | 146 | //Run our input color's RGB values through the XYZ algorithm to convert them into XYZ values 147 | NSArray *XYZValues = [self arrayOfXYZValuesForR:red G:green B:blue A:alpha1]; 148 | CGFloat X = [XYZValues[0] floatValue]; 149 | CGFloat Y = [XYZValues[1] floatValue]; 150 | CGFloat Z = [XYZValues[2] floatValue]; 151 | 152 | if (L != nil && A != nil && B != nil) { 153 | //Run our new XYZ values through our LAB algorithm to convert them into LAB values 154 | NSArray *LABValues = [self arrayOfLABValuesForX:X Y:Y Z:Z alpha:alpha1]; 155 | *L = [LABValues[0] floatValue]; 156 | *A = [LABValues[1] floatValue]; 157 | *B = [LABValues[2] floatValue]; 158 | } 159 | 160 | return YES; 161 | } 162 | 163 | return NO; 164 | } 165 | 166 | #pragma mark - Internal Helper Methods 167 | 168 | - (NSArray *)arrayOfXYZValuesForR:(CGFloat)red G:(CGFloat)green B:(CGFloat)blue A:(CGFloat)alpha { 169 | 170 | /* 171 | Let's begin by converting from RGB to sRGB. 172 | We're going to use the Reverse Transformation Equation. 173 | http://en.wikipedia.org/wiki/SRGB 174 | */ 175 | 176 | void (^sRGB)(CGFloat *C); 177 | sRGB = ^(CGFloat *C) { 178 | if (*C > 0.04045) { 179 | *C = pow(((*C + 0.055)/ (1 + 0.055)), 2.40); 180 | } else { 181 | *C /= 12.92; 182 | } 183 | }; 184 | 185 | sRGB(&red); 186 | sRGB(&green); 187 | sRGB(&blue); 188 | 189 | /* 190 | Now we're going to convert to XYZ values, using a matrix multiplication of the linear values 191 | http://upload.wikimedia.org/math/4/3/3/433376fc18cccd887758beffb7e7c625.png 192 | */ 193 | 194 | CGFloat X = (red * 0.4124) + (green * 0.3576) + (blue * 0.1805); 195 | CGFloat Y = (red * 0.2126) + (green * 0.7152) + (blue * 0.0722); 196 | CGFloat Z = (red * 0.0193) + (green * 0.1192) + (blue * 0.9505); 197 | 198 | X *= 100; 199 | Y *= 100; 200 | Z *= 100; 201 | 202 | return @[@(X), @(Y), @(Z), @(alpha)]; 203 | } 204 | 205 | - (NSArray *)arrayOfLABValuesForX:(CGFloat)X Y:(CGFloat)Y Z:(CGFloat)Z alpha:(CGFloat)alpha { 206 | 207 | /* 208 | The corresponding original XYZ values are such that white is D65 with unit luminance (X,Y,Z = 0.9505, 1.0000, 1.0890). 209 | Calculations are also to assume the 2° standard colorimetric observer. 210 | D65: http://en.wikipedia.org/wiki/CIE_Standard_Illuminant_D65 211 | Standard Colorimetric Observer: http://en.wikipedia.org/wiki/Standard_colorimetric_observer#CIE_standard_observer 212 | 213 | Since we mutiplied our XYZ values by 100 to produce a percentage we should also multiply our unit luminance values by 100. 214 | */ 215 | 216 | X /= (0.9505 * 100); 217 | Y /= (1.0000 * 100); 218 | Z /= (1.0890 * 100); 219 | 220 | /* 221 | Next we need to use the forward transformation function for CIELAB-CIEXYZ conversions 222 | Function: http://upload.wikimedia.org/math/e/5/1/e513d25d50d406bfffb6ed3c854bd8a4.png 223 | */ 224 | 225 | void (^XYZtoLAB)(CGFloat *f); 226 | XYZtoLAB = ^(CGFloat *f) { 227 | if ((*f > pow((6.0/29.0), 3.0)) ) { 228 | *f = pow(*f, 1.0/3.0); 229 | } else { 230 | *f = (1/3)*pow((29.0/6.0), 2.0) * *f + 4/29.0; 231 | } 232 | }; 233 | 234 | XYZtoLAB(&X); 235 | XYZtoLAB(&Y); 236 | XYZtoLAB(&Z); 237 | 238 | /* 239 | Next we get our LAB values using the following equations and the results from the function above 240 | http://upload.wikimedia.org/math/0/0/6/006164b74314e2fdcdc34ac9d0aa6fe4.png 241 | */ 242 | 243 | CGFloat L = (116 * Y) - 16; 244 | CGFloat A = 500 * (X - Y); 245 | CGFloat B = 200 * (Y - Z); 246 | 247 | 248 | return @[@(L), @(A), @(B), @(alpha)]; 249 | } 250 | 251 | @end 252 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIImage+ChameleonPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+ChameleonPrivate.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/8/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (ChameleonPrivate) 12 | 13 | #pragma mark - Class Methods 14 | 15 | + (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize; 16 | 17 | #pragma mark - Instance Methods 18 | 19 | - (UIImage *)imageScaledToSize:(CGSize)newSize; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIImage+ChameleonPrivate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+ChameleonPrivate.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/8/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UIImage+ChameleonPrivate.h" 10 | 11 | @implementation UIImage (ChameleonPrivate) 12 | 13 | // Would not have been possible without - http://stackoverflow.com/a/1262893 14 | + (UIColor *)colorFromImage:(UIImage *)image atPoint:(CGPoint)point { 15 | 16 | //Encapsulate our image 17 | CGImageRef imageRef = image.CGImage; 18 | NSUInteger width = CGImageGetWidth(imageRef); 19 | NSUInteger height = CGImageGetHeight(imageRef); 20 | 21 | //Specify the colorspace we're in 22 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 23 | 24 | //Extract the data we need 25 | unsigned char *rawData = calloc(height * width * 4, sizeof(unsigned char)); 26 | NSUInteger bytesPerPixel = 4; 27 | NSUInteger bytesPerRow = bytesPerPixel * width; 28 | NSUInteger bitsPerComponent = 8; 29 | CGContextRef context = CGBitmapContextCreate(rawData, width, height, bitsPerComponent, bytesPerRow, 30 | colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); 31 | //Release colorspace 32 | CGColorSpaceRelease(colorSpace); 33 | 34 | //Draw and release image 35 | CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); 36 | CGContextRelease(context); 37 | 38 | //rawData now contains the image data in RGBA8888 39 | NSInteger byteIndex = (bytesPerRow * point.y) + (point.x * bytesPerPixel); 40 | 41 | //Define our RGBA values 42 | CGFloat red = (rawData[byteIndex] * 1.f) / 255.f; 43 | CGFloat green = (rawData[byteIndex + 1] * 1.f) / 255.f; 44 | CGFloat blue = (rawData[byteIndex + 2] * 1.f) / 255.f; 45 | CGFloat alpha = (rawData[byteIndex + 3] * 1.0) / 255.f; 46 | 47 | //Free our rawData 48 | free(rawData); 49 | 50 | //Return color 51 | return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 52 | } 53 | 54 | + (UIImage *)imageWithImage:(UIImage *)image scaledToSize:(CGSize)newSize { 55 | 56 | UIGraphicsBeginImageContextWithOptions(newSize, NO, 1.0); 57 | [image drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; 58 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 59 | UIGraphicsEndImageContext(); 60 | return newImage; 61 | } 62 | 63 | #pragma mark - Instance Methods 64 | 65 | - (UIImage *)imageScaledToSize:(CGSize)newSize { 66 | 67 | UIGraphicsBeginImageContextWithOptions(newSize, NO, 1.0); 68 | [self drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)]; 69 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 70 | UIGraphicsEndImageContext(); 71 | return newImage; 72 | } 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UILabel+Chameleon.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Chameleon.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 9/20/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UILabel (Chameleon) 12 | 13 | - (void)setSubstituteFontName:(NSString *)name UI_APPEARANCE_SELECTOR; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UILabel+Chameleon.m: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+Chameleon.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 9/20/15. 6 | // Copyright © 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UILabel+Chameleon.h" 10 | 11 | @implementation UILabel (Chameleon) 12 | 13 | - (void)setSubstituteFontName:(NSString *)name UI_APPEARANCE_SELECTOR { 14 | 15 | self.font = [UIFont fontWithName:name size:self.font.pointSize]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UINavigationController+Chameleon.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+Chameleon.h 3 | // ChameleonDemo 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChameleonEnums.h" 11 | 12 | @interface UINavigationController (Chameleon) 13 | 14 | /** 15 | * Sets the status bar style for the specified @c UINavigationController and all its child controllers. 16 | * 17 | * @param statusBarStyle The style of the device's status bar. 18 | * 19 | * @note Chameleon introduces a new @c statusBarStyle called @c UIStatusBarStyleContrast. 20 | * 21 | * @since 2.0 22 | */ 23 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle; 24 | 25 | /** 26 | * Hides the hairline view at the bottom of a navigation bar. The default value is @c NO. 27 | * 28 | * @since 2.0.3 29 | */ 30 | @property (nonatomic, assign) BOOL hidesNavigationBarHairline; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UINavigationController+Chameleon.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+Chameleon.m 3 | // ChameleonDemo 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UINavigationController+Chameleon.h" 10 | #import 11 | 12 | #import "ChameleonConstants.h" 13 | #import "ChameleonEnums.h" 14 | #import "ChameleonMacros.h" 15 | 16 | #import "NSArray+Chameleon.h" 17 | #import "UIColor+Chameleon.h" 18 | #import "UIViewController+Chameleon.h" 19 | 20 | @interface UINavigationController () 21 | 22 | @property (readwrite) BOOL shouldContrast; 23 | @property (readwrite) BOOL shouldUseLightContent; 24 | 25 | @end 26 | 27 | @implementation UINavigationController (Chameleon) 28 | 29 | @dynamic hidesNavigationBarHairline; 30 | 31 | #pragma mark - Swizzling 32 | 33 | + (void)load { 34 | 35 | static dispatch_once_t onceToken; 36 | dispatch_once(&onceToken, ^{ 37 | 38 | Class class = [self class]; 39 | 40 | SEL originalSelector = @selector(viewDidLoad); 41 | SEL swizzledSelector = @selector(chameleon_viewDidLoad); 42 | 43 | Method originalMethod = class_getInstanceMethod(class, originalSelector); 44 | Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); 45 | 46 | BOOL didAddMethod = 47 | class_addMethod(class, 48 | originalSelector, 49 | method_getImplementation(swizzledMethod), 50 | method_getTypeEncoding(swizzledMethod)); 51 | 52 | if (didAddMethod) { 53 | class_replaceMethod(class, 54 | swizzledSelector, 55 | method_getImplementation(originalMethod), 56 | method_getTypeEncoding(originalMethod)); 57 | 58 | } else { 59 | method_exchangeImplementations(originalMethod, swizzledMethod); 60 | } 61 | }); 62 | } 63 | 64 | - (void)chameleon_viewDidLoad { 65 | 66 | [self chameleon_viewDidLoad]; 67 | 68 | UIView *hairlineImageView = [self findHairlineImageViewUnder:self.navigationBar]; 69 | 70 | if (hairlineImageView) { 71 | 72 | if (self.hidesNavigationBarHairline) { 73 | hairlineImageView.hidden = YES; 74 | 75 | } else { 76 | hairlineImageView.hidden = NO; 77 | } 78 | } 79 | } 80 | 81 | - (UIImageView *)findHairlineImageViewUnder:(UIView *)view { 82 | 83 | if ([view isKindOfClass:UIImageView.class] && view.bounds.size.height <= 1.0) { 84 | return (UIImageView *)view; 85 | } 86 | 87 | for (UIView *subview in view.subviews) { 88 | UIImageView *imageView = [self findHairlineImageViewUnder:subview]; 89 | if (imageView) { 90 | return imageView; 91 | } 92 | } 93 | 94 | return nil; 95 | } 96 | 97 | #pragma mark - Runtime 98 | 99 | - (void)setShouldContrast:(BOOL)contrast { 100 | 101 | NSNumber *number = [NSNumber numberWithBool:contrast]; 102 | objc_setAssociatedObject(self, @selector(shouldContrast), number, OBJC_ASSOCIATION_RETAIN); 103 | } 104 | 105 | - (BOOL)shouldContrast { 106 | 107 | NSNumber *number = objc_getAssociatedObject(self, @selector(shouldContrast)); 108 | return [number boolValue]; 109 | } 110 | 111 | - (void)setShouldUseLightContent:(BOOL)shouldUseLightContent { 112 | 113 | NSNumber *number = [NSNumber numberWithBool:shouldUseLightContent]; 114 | objc_setAssociatedObject(self, @selector(shouldUseLightContent), number, OBJC_ASSOCIATION_RETAIN); 115 | } 116 | 117 | - (BOOL)shouldUseLightContent { 118 | 119 | NSNumber *number = objc_getAssociatedObject(self, @selector(shouldUseLightContent)); 120 | return [number boolValue]; 121 | } 122 | 123 | - (void)setHidesNavigationBarHairline:(BOOL)hidesNavigationBarHairline { 124 | 125 | NSNumber *number = [NSNumber numberWithBool:hidesNavigationBarHairline]; 126 | objc_setAssociatedObject(self, @selector(hidesNavigationBarHairline), number, OBJC_ASSOCIATION_RETAIN); 127 | 128 | //Find Hairline Image 129 | UIView *hairlineImageView = [self findHairlineImageViewUnder:self.navigationBar]; 130 | 131 | //Check if it exists 132 | if (hairlineImageView) { 133 | 134 | //Check if we should hide it or not 135 | if (hidesNavigationBarHairline) { 136 | hairlineImageView.hidden = YES; 137 | 138 | } else { 139 | hairlineImageView.hidden = NO; 140 | } 141 | } 142 | } 143 | 144 | - (BOOL)hidesNavigationBarHairline { 145 | 146 | NSNumber *number = objc_getAssociatedObject(self, @selector(hidesNavigationBarHairline)); 147 | return [number boolValue]; 148 | } 149 | 150 | 151 | #pragma mark - Public Methods 152 | 153 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle { 154 | 155 | if (statusBarStyle == UIStatusBarStyleContrast) { 156 | 157 | self.shouldContrast = YES; 158 | 159 | } else { 160 | 161 | if (statusBarStyle == UIStatusBarStyleLightContent) { 162 | 163 | self.shouldUseLightContent = YES; 164 | 165 | } else { 166 | 167 | self.shouldUseLightContent = NO; 168 | } 169 | 170 | } 171 | } 172 | 173 | #pragma mark - Private Methods 174 | 175 | - (UIStatusBarStyle)preferredStatusBarStyle { 176 | 177 | [super preferredStatusBarStyle]; 178 | 179 | if (self.shouldContrast) { 180 | 181 | return [self contrastingStatusBarStyleForColor:self.navigationBar.barTintColor]; 182 | 183 | } else { 184 | 185 | if (self.shouldUseLightContent) { 186 | 187 | return UIStatusBarStyleLightContent; 188 | 189 | } else { 190 | 191 | return UIStatusBarStyleDefault; 192 | } 193 | } 194 | } 195 | 196 | - (UIStatusBarStyle)contrastingStatusBarStyleForColor:(UIColor *)backgroundColor { 197 | 198 | //Calculate Luminance 199 | CGFloat luminance; 200 | CGFloat red, green, blue; 201 | 202 | //Check for clear or uncalculatable color and assume white 203 | if (![backgroundColor getRed:&red green:&green blue:&blue alpha:nil]) { 204 | return UIStatusBarStyleDefault; 205 | } 206 | 207 | //Relative luminance in colorimetric spaces - http://en.wikipedia.org/wiki/Luminance_(relative) 208 | red *= 0.2126f; green *= 0.7152f; blue *= 0.0722f; 209 | luminance = red + green + blue; 210 | 211 | return (luminance > 0.6f) ? UIStatusBarStyleDefault : UIStatusBarStyleLightContent; 212 | } 213 | 214 | @end 215 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIView+ChameleonPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ChameleonPrivate.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (ChameleonPrivate) 12 | 13 | - (BOOL)isTopViewInWindow; 14 | - (UIView *)findTopMostViewForPoint:(CGPoint)point; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIView+ChameleonPrivate.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ChameleonPrivate.m 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import "UIView+ChameleonPrivate.h" 10 | 11 | @implementation UIView (ChameleonPrivate) 12 | 13 | - (BOOL)isTopViewInWindow { 14 | 15 | if (!self.window) { 16 | return NO; 17 | } 18 | 19 | CGPoint centerPointInSelf = CGPointMake(CGRectGetMidX(self.bounds), 20 | CGRectGetMidY(self.bounds)); 21 | 22 | CGPoint centerPointOfSelfInWindow = [self convertPoint:centerPointInSelf 23 | toView:self.window]; 24 | 25 | UIView *view = [self.window findTopMostViewForPoint:centerPointOfSelfInWindow]; 26 | BOOL isTopMost = view == self || [view isDescendantOfView:self]; 27 | 28 | return isTopMost; 29 | } 30 | 31 | - (UIView *)findTopMostViewForPoint:(CGPoint)point { 32 | 33 | for (int i = (int)self.subviews.count - 1; i >= 0; i--) { 34 | 35 | UIView *subview = self.subviews[i]; 36 | 37 | if (!subview.hidden && CGRectContainsPoint(subview.frame, point) && subview.alpha > 0.01) { 38 | CGPoint pointConverted = [self convertPoint:point toView:subview]; 39 | return [subview findTopMostViewForPoint:pointConverted]; 40 | } 41 | } 42 | 43 | return self; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Objective-C/UIViewController+Chameleon.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Chameleon.h 3 | // Chameleon 4 | // 5 | // Created by Vicc Alexander on 6/4/15. 6 | // Copyright (c) 2015 Vicc Alexander. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ChameleonEnums.h" 11 | 12 | @interface UIViewController (Chameleon) 13 | 14 | /** 15 | * Sets the color theme for the specified view controller using a primary color and the specified content style. 16 | * 17 | * @param primaryColor The primary color. 18 | * @param contentStyle The contentStyle. 19 | * 20 | * @since 2.0 21 | */ 22 | - (void)setThemeUsingPrimaryColor:(UIColor *)primaryColor 23 | withContentStyle:(UIContentStyle)contentStyle; 24 | 25 | /** 26 | * Sets the color theme for the specified view controller using a primary color, secondary color, and the specified content style. 27 | * 28 | * @param primaryColor The primary color. 29 | * @param secondaryColor The secondary color. 30 | * @param contentStyle The contentStyle. 31 | * 32 | * @since 2.0 33 | */ 34 | - (void)setThemeUsingPrimaryColor:(UIColor *)primaryColor 35 | withSecondaryColor:(UIColor *)secondaryColor 36 | andContentStyle:(UIContentStyle)contentStyle; 37 | 38 | /** 39 | * Sets the color theme for the specified view controller using a primary color, secondary color, font name, and the specified content style. 40 | * 41 | * @param primaryColor The primary color. 42 | * @param secondaryColor The secondary color. 43 | * @param fontName The main font to use for all text-based elements. 44 | * @param contentStyle The contentStyle. 45 | * 46 | * @since 2.0 47 | */ 48 | - (void)setThemeUsingPrimaryColor:(UIColor *)primaryColor 49 | withSecondaryColor:(UIColor *)secondaryColor 50 | usingFontName:(NSString *)fontName 51 | andContentStyle:(UIContentStyle)contentStyle; 52 | 53 | /** 54 | * Sets the status bar style for the specified @c UIViewController and all its child controllers. 55 | * 56 | * @param statusBarStyle The style of the device's status bar. 57 | * 58 | * @note Chameleon introduces a new @c statusBarStyle called @c UIStatusBarStyleContrast. 59 | * 60 | * @since 2.0 61 | */ 62 | - (void)setStatusBarStyle:(UIStatusBarStyle)statusBarStyle; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /Pods/ChameleonFramework/Pod/Classes/Swift/ChameleonShorthand.swift: -------------------------------------------------------------------------------- 1 | 2 | // ChameleonShorthand.swift 3 | 4 | /* 5 | 6 | The MIT License (MIT) 7 | 8 | Copyright (c) 2014-2015 Vicc Alexander. 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | */ 29 | 30 | import UIKit 31 | 32 | // MARK: - UIColor Methods Shorthand 33 | 34 | /** 35 | Creates and returns a complementary flat color object 180 degrees away in the HSB colorspace from the specified color. 36 | 37 | - parameter color: The color whose complementary color is being requested. 38 | 39 | - returns: A flat UIColor object in the HSB colorspace. 40 | */ 41 | public func ComplementaryFlatColorOf(color: UIColor) -> UIColor { 42 | return UIColor(complementaryFlatColorOf: color) 43 | } 44 | 45 | /** 46 | Returns a randomly generated flat color object with an alpha value of 1.0 in either a light or dark shade. 47 | 48 | - parameter shade: Specifies whether the randomly generated flat color should be a light or dark shade. 49 | 50 | - returns: A flat UIColor object in the HSB colorspace. 51 | */ 52 | public func RandomFlatColorWithShade(shade: UIShadeStyle) -> UIColor { 53 | return UIColor(randomFlatColorOfShadeStyle: shade) 54 | } 55 | 56 | /** 57 | Creates and returns either a black or white color object depending on which contrasts more with a specified color. 58 | 59 | - parameter backgroundColor: The specified color of the contrast color that is being requested. 60 | - parameter returnFlat: Pass **true** to return flat color objects. 61 | 62 | - returns: A UIColor object in the HSB colorspace. 63 | */ 64 | public func ContrastColorOf(backgroundColor: UIColor, returnFlat: Bool) -> UIColor { 65 | return UIColor(contrastingBlackOrWhiteColorOn: backgroundColor, isFlat: returnFlat) 66 | } 67 | 68 | /** 69 | Creates and returns a gradient as a color object with an alpha value of 1.0 70 | 71 | - parameter gradientStyle: Specifies the style and direction of the gradual blend between colors. 72 | - parameter frame: The frame rectangle, which describes the view’s location and size in its superview’s coordinate system. 73 | - parameter colors: An array of color objects used to create a gradient. 74 | 75 | - returns: A UIColor object using colorWithPattern. 76 | */ 77 | public func GradientColor(gradientStyle: UIGradientStyle, frame: CGRect, colors: [UIColor]) -> UIColor { 78 | return UIColor(gradientStyle: gradientStyle, withFrame: frame, andColors: colors) 79 | } 80 | 81 | public func HexColor(hexString: String, _ alpha: CGFloat = 1.0) -> UIColor { 82 | return UIColor(hexString: hexString, withAlpha: alpha) 83 | } 84 | 85 | /** 86 | Returns the average color generated by averaging the colors of a specified image. 87 | 88 | - parameter image: A specified UIImage. 89 | 90 | - returns: A flat UIColor object in the HSB colorspace. 91 | */ 92 | public func AverageColorFromImage(image: UIImage) -> UIColor { 93 | return UIColor(averageColorFromImage: image) 94 | } 95 | 96 | // MARK: - Array Methods Shorthand 97 | 98 | // TODO Array Extension needed ;) 99 | 100 | /** 101 | Generates and creates an array of 5 color objects in the HSB colorspace from the specified color. 102 | 103 | - parameter colorSchemeType: The color scheme with which to select colors using a specified color. 104 | - parameter color: The specified color which the color scheme is built around. 105 | - parameter isFlatScheme: Pass *true* to return flat color objects. 106 | 107 | - returns: An array of 5 color objects in the HSB colorspace. 108 | */ 109 | public func ColorSchemeOf(colorSchemeType:ColorScheme, color:UIColor, isFlatScheme:Bool) -> [UIColor] { 110 | return NSArray(ofColorsWithColorScheme: colorSchemeType, usingColor: color, withFlatScheme: isFlatScheme) as! [UIColor] 111 | } 112 | 113 | /** 114 | Generates and creates an array of 5 color objects in the HSB colorspace that appear most often in a specified image. 115 | 116 | - parameter image: The specified image which the color scheme is built around. 117 | - parameter withFlatScheme: Pass **true** to return flat color objects. 118 | 119 | - returns: An array of 5 color objects in the HSB colorspace. 120 | */ 121 | public func ColorsFromImage(image: UIImage, withFlatScheme: Bool) -> [UIColor] { 122 | // TODO: Remove forced casting 123 | return NSArray(ofColorsFromImage: image, withFlatScheme: withFlatScheme) as! [UIColor] 124 | } 125 | 126 | 127 | // MARK: - Special Colors Shorthand 128 | 129 | /** 130 | Returns a randomly generated flat color object whose alpha value is 1.0. 131 | 132 | - returns: A flat UIColor object in the HSB colorspace. 133 | */ 134 | public func RandomFlatColor() -> UIColor { 135 | return UIColor.randomFlatColor() 136 | } 137 | 138 | public func ClearColor() -> UIColor { 139 | return UIColor.clearColor() 140 | } 141 | 142 | 143 | // MARK: - Light Shades Shorthand 144 | 145 | public func FlatBlack() -> UIColor { 146 | return UIColor.flatBlackColor() 147 | } 148 | 149 | public func FlatBlue() -> UIColor { 150 | return UIColor.flatBlueColor() 151 | } 152 | 153 | public func FlatBrown() -> UIColor { 154 | return UIColor.flatBrownColor() 155 | } 156 | 157 | public func FlatCoffee() -> UIColor { 158 | return UIColor.flatCoffeeColor() 159 | } 160 | 161 | public func FlatForestGreen() -> UIColor { 162 | return UIColor.flatForestGreenColor() 163 | } 164 | 165 | public func FlatGray() -> UIColor { 166 | return UIColor.flatGrayColor() 167 | } 168 | 169 | public func FlatGreen() -> UIColor { 170 | return UIColor.flatGreenColor() 171 | } 172 | 173 | public func FlatLime() -> UIColor { 174 | return UIColor.flatLimeColor() 175 | } 176 | 177 | public func FlatMagenta() -> UIColor { 178 | return UIColor.flatMagentaColor() 179 | } 180 | 181 | public func FlatMaroon() -> UIColor { 182 | return UIColor.flatMaroonColor() 183 | } 184 | 185 | public func FlatMint() -> UIColor { 186 | return UIColor.flatMintColor() 187 | } 188 | 189 | public func FlatNavyBlue() -> UIColor { 190 | return UIColor.flatNavyBlueColor() 191 | } 192 | 193 | public func FlatOrange() -> UIColor { 194 | return UIColor.flatOrangeColor() 195 | } 196 | 197 | public func FlatPink() -> UIColor { 198 | return UIColor.flatPinkColor() 199 | } 200 | 201 | public func FlatPlum() -> UIColor { 202 | return UIColor.flatPlumColor() 203 | } 204 | 205 | public func FlatPowderBlue() -> UIColor { 206 | return UIColor.flatPowderBlueColor() 207 | } 208 | 209 | public func FlatPurple() -> UIColor { 210 | return UIColor.flatPurpleColor() 211 | } 212 | 213 | public func FlatRed() -> UIColor { 214 | return UIColor.flatRedColor() 215 | } 216 | 217 | public func FlatSand() -> UIColor { 218 | return UIColor.flatSandColor() 219 | } 220 | 221 | public func FlatSkyBlue() -> UIColor { 222 | return UIColor.flatSkyBlueColor() 223 | } 224 | 225 | public func FlatTeal() -> UIColor { 226 | return UIColor.flatTealColor() 227 | } 228 | 229 | public func FlatWatermelon() -> UIColor { 230 | return UIColor.flatWatermelonColor() 231 | } 232 | 233 | public func FlatWhite() -> UIColor { 234 | return UIColor.flatWhiteColor() 235 | } 236 | 237 | public func FlatYellow() -> UIColor { 238 | return UIColor.flatYellowColor() 239 | } 240 | 241 | // MARK: - Chameleon - Dark Shades Shorthand 242 | 243 | public func FlatBlackDark() -> UIColor { 244 | return UIColor.flatBlackColorDark() 245 | } 246 | 247 | public func FlatBlueDark() -> UIColor { 248 | return UIColor.flatBlueColorDark() 249 | } 250 | 251 | public func FlatBrownDark() -> UIColor { 252 | return UIColor.flatBrownColorDark() 253 | } 254 | 255 | public func FlatCoffeeDark() -> UIColor { 256 | return UIColor.flatCoffeeColorDark() 257 | } 258 | 259 | public func FlatForestGreenDark() -> UIColor { 260 | return UIColor.flatForestGreenColorDark() 261 | } 262 | 263 | public func FlatGrayDark() -> UIColor { 264 | return UIColor.flatGrayColorDark() 265 | } 266 | 267 | public func FlatGreenDark() -> UIColor { 268 | return UIColor.flatGreenColorDark() 269 | } 270 | 271 | public func FlatLimeDark() -> UIColor { 272 | return UIColor.flatLimeColorDark() 273 | } 274 | 275 | public func FlatMagentaDark() -> UIColor { 276 | return UIColor.flatMagentaColorDark() 277 | } 278 | 279 | public func FlatMaroonDark() -> UIColor { 280 | return UIColor.flatMaroonColorDark() 281 | } 282 | 283 | public func FlatMintDark() -> UIColor { 284 | return UIColor.flatMintColorDark() 285 | } 286 | 287 | public func FlatNavyBlueDark() -> UIColor { 288 | return UIColor.flatNavyBlueColorDark() 289 | } 290 | 291 | public func FlatOrangeDark() -> UIColor { 292 | return UIColor.flatOrangeColorDark() 293 | } 294 | 295 | public func FlatPinkDark() -> UIColor { 296 | return UIColor.flatPinkColorDark() 297 | } 298 | 299 | public func FlatPlumDark() -> UIColor { 300 | return UIColor.flatPlumColorDark() 301 | } 302 | 303 | public func FlatPowderBlueDark() -> UIColor { 304 | return UIColor.flatPowderBlueColorDark() 305 | } 306 | 307 | public func FlatPurpleDark() -> UIColor { 308 | return UIColor.flatPurpleColorDark() 309 | } 310 | 311 | public func FlatRedDark() -> UIColor { 312 | return UIColor.flatRedColorDark() 313 | } 314 | 315 | public func FlatSandDark() -> UIColor { 316 | return UIColor.flatSandColorDark() 317 | } 318 | 319 | public func FlatSkyBlueDark() -> UIColor { 320 | return UIColor.flatSkyBlueColorDark() 321 | } 322 | 323 | public func FlatTealDark() -> UIColor { 324 | return UIColor.flatTealColorDark() 325 | } 326 | 327 | public func FlatWatermelonDark() -> UIColor { 328 | return UIColor.flatWatermelonColorDark() 329 | } 330 | 331 | public func FlatWhiteDark() -> UIColor { 332 | return UIColor.flatWhiteColorDark() 333 | } 334 | 335 | public func FlatYellowDark() -> UIColor { 336 | return UIColor.flatYellowColorDark() 337 | } 338 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - ChameleonFramework/Default (2.1.0) 3 | - ChameleonFramework/Swift (2.1.0): 4 | - ChameleonFramework/Default 5 | - SnapKit (0.21.1) 6 | 7 | DEPENDENCIES: 8 | - ChameleonFramework/Swift 9 | - SnapKit 10 | 11 | SPEC CHECKSUMS: 12 | ChameleonFramework: d21a3cc247abfe5e37609a283a8238b03575cf64 13 | SnapKit: bbad04cb016c7cead63965f16b00c09318d271ee 14 | 15 | PODFILE CHECKSUM: 62cf2bc9d9fdfa903b16c2ba8142a624708f8cc9 16 | 17 | COCOAPODS: 1.0.1 18 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/ChameleonFramework.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/Pods-CuntingLabel.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/Pods-CuntingLabelTests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/Pods-CuntingLabelUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 66 | 67 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/SnapKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/Bing.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ChameleonFramework.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-CuntingLabel.xcscheme 13 | 14 | isShown 15 | 16 | 17 | Pods-CuntingLabelTests.xcscheme 18 | 19 | isShown 20 | 21 | 22 | Pods-CuntingLabelUITests.xcscheme 23 | 24 | isShown 25 | 26 | 27 | SnapKit.xcscheme 28 | 29 | isShown 30 | 31 | 32 | 33 | SuppressBuildableAutocreation 34 | 35 | 15344BEA18B78AF69B9DF29DF0F73576 36 | 37 | primary 38 | 39 | 40 | 2B8DACAB384193A4A834AF70E4AAA803 41 | 42 | primary 43 | 44 | 45 | 46DAEF9FB54DB43748A2D6667301896B 46 | 47 | primary 48 | 49 | 50 | 5172ACAB7FEA22813859DC97CA0AA16F 51 | 52 | primary 53 | 54 | 55 | AC80ABF996D882EF1F1BE5AFDFE2FC43 56 | 57 | primary 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /Pods/SnapKit/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 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 | -------------------------------------------------------------------------------- /Pods/SnapKit/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | SnapKit is a DSL to make Auto Layout easy on both iOS and OS X. 4 | 5 | [![Build Status](https://travis-ci.org/SnapKit/SnapKit.svg)](https://travis-ci.org/SnapKit/SnapKit) 6 | [![Cocoapods Compatible](https://img.shields.io/cocoapods/v/SnapKit.svg)](https://img.shields.io/cocoapods/v/SnapKit.svg) 7 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 8 | 9 | ```swift 10 | import SnapKit 11 | 12 | class MyViewController: UIViewController { 13 | 14 | lazy var box = UIView() 15 | 16 | override func viewDidLoad() { 17 | super.viewDidLoad() 18 | 19 | self.view.addSubview(box) 20 | box.snp_makeConstraints { make in 21 | make.width.height.equalTo(50) 22 | make.center.equalTo(self.view) 23 | } 24 | } 25 | 26 | } 27 | ``` 28 | 29 | ## Resources 30 | 31 | * [Documentation](http://snapkit.io/docs/) 32 | * [F.A.Q.](http://snapkit.io/faq/) 33 | * [Legacy Platforms (iOS 7.0, OS X 10.9)](http://snapkit.io/legacy-platforms/) 34 | 35 | ## License 36 | 37 | MIT license. See the `LICENSE` file for details. 38 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintAttributes.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to define `NSLayoutAttributes` in a more concise and composite manner 32 | */ 33 | internal struct ConstraintAttributes: OptionSetType, BooleanType { 34 | 35 | internal init(rawValue: UInt) { 36 | self.rawValue = rawValue 37 | } 38 | internal init(_ rawValue: UInt) { 39 | self.init(rawValue: rawValue) 40 | } 41 | internal init(nilLiteral: ()) { 42 | self.rawValue = 0 43 | } 44 | 45 | internal private(set) var rawValue: UInt 46 | internal static var allZeros: ConstraintAttributes { return self.init(0) } 47 | internal static func convertFromNilLiteral() -> ConstraintAttributes { return self.init(0) } 48 | internal var boolValue: Bool { return self.rawValue != 0 } 49 | 50 | internal func toRaw() -> UInt { return self.rawValue } 51 | internal static func fromRaw(raw: UInt) -> ConstraintAttributes? { return self.init(raw) } 52 | internal static func fromMask(raw: UInt) -> ConstraintAttributes { return self.init(raw) } 53 | 54 | // normal 55 | 56 | internal static var None: ConstraintAttributes { return self.init(0) } 57 | internal static var Left: ConstraintAttributes { return self.init(1) } 58 | internal static var Top: ConstraintAttributes { return self.init(2) } 59 | internal static var Right: ConstraintAttributes { return self.init(4) } 60 | internal static var Bottom: ConstraintAttributes { return self.init(8) } 61 | internal static var Leading: ConstraintAttributes { return self.init(16) } 62 | internal static var Trailing: ConstraintAttributes { return self.init(32) } 63 | internal static var Width: ConstraintAttributes { return self.init(64) } 64 | internal static var Height: ConstraintAttributes { return self.init(128) } 65 | internal static var CenterX: ConstraintAttributes { return self.init(256) } 66 | internal static var CenterY: ConstraintAttributes { return self.init(512) } 67 | internal static var Baseline: ConstraintAttributes { return self.init(1024) } 68 | 69 | @available(iOS 8.0, *) 70 | internal static var FirstBaseline: ConstraintAttributes { return self.init(2048) } 71 | @available(iOS 8.0, *) 72 | internal static var LeftMargin: ConstraintAttributes { return self.init(4096) } 73 | @available(iOS 8.0, *) 74 | internal static var RightMargin: ConstraintAttributes { return self.init(8192) } 75 | @available(iOS 8.0, *) 76 | internal static var TopMargin: ConstraintAttributes { return self.init(16384) } 77 | @available(iOS 8.0, *) 78 | internal static var BottomMargin: ConstraintAttributes { return self.init(32768) } 79 | @available(iOS 8.0, *) 80 | internal static var LeadingMargin: ConstraintAttributes { return self.init(65536) } 81 | @available(iOS 8.0, *) 82 | internal static var TrailingMargin: ConstraintAttributes { return self.init(131072) } 83 | @available(iOS 8.0, *) 84 | internal static var CenterXWithinMargins: ConstraintAttributes { return self.init(262144) } 85 | @available(iOS 8.0, *) 86 | internal static var CenterYWithinMargins: ConstraintAttributes { return self.init(524288) } 87 | 88 | // aggregates 89 | 90 | internal static var Edges: ConstraintAttributes { return self.init(15) } 91 | internal static var Size: ConstraintAttributes { return self.init(192) } 92 | internal static var Center: ConstraintAttributes { return self.init(768) } 93 | 94 | @available(iOS 8.0, *) 95 | internal static var Margins: ConstraintAttributes { return self.init(61440) } 96 | 97 | @available(iOS 8.0, *) 98 | internal static var CenterWithinMargins: ConstraintAttributes { return self.init(786432) } 99 | 100 | internal var layoutAttributes:[NSLayoutAttribute] { 101 | var attrs = [NSLayoutAttribute]() 102 | if (self.contains(ConstraintAttributes.Left)) { 103 | attrs.append(.Left) 104 | } 105 | if (self.contains(ConstraintAttributes.Top)) { 106 | attrs.append(.Top) 107 | } 108 | if (self.contains(ConstraintAttributes.Right)) { 109 | attrs.append(.Right) 110 | } 111 | if (self.contains(ConstraintAttributes.Bottom)) { 112 | attrs.append(.Bottom) 113 | } 114 | if (self.contains(ConstraintAttributes.Leading)) { 115 | attrs.append(.Leading) 116 | } 117 | if (self.contains(ConstraintAttributes.Trailing)) { 118 | attrs.append(.Trailing) 119 | } 120 | if (self.contains(ConstraintAttributes.Width)) { 121 | attrs.append(.Width) 122 | } 123 | if (self.contains(ConstraintAttributes.Height)) { 124 | attrs.append(.Height) 125 | } 126 | if (self.contains(ConstraintAttributes.CenterX)) { 127 | attrs.append(.CenterX) 128 | } 129 | if (self.contains(ConstraintAttributes.CenterY)) { 130 | attrs.append(.CenterY) 131 | } 132 | if (self.contains(ConstraintAttributes.Baseline)) { 133 | #if swift(>=2.3) 134 | attrs.append(.LastBaseline) 135 | #else 136 | attrs.append(.Baseline) 137 | #endif 138 | } 139 | 140 | #if os(iOS) || os(tvOS) 141 | #if SNAPKIT_DEPLOYMENT_LEGACY 142 | guard #available(iOS 8.0, *) else { 143 | return attrs 144 | } 145 | #endif 146 | if (self.contains(ConstraintAttributes.FirstBaseline)) { 147 | attrs.append(.FirstBaseline) 148 | } 149 | if (self.contains(ConstraintAttributes.LeftMargin)) { 150 | attrs.append(.LeftMargin) 151 | } 152 | if (self.contains(ConstraintAttributes.RightMargin)) { 153 | attrs.append(.RightMargin) 154 | } 155 | if (self.contains(ConstraintAttributes.TopMargin)) { 156 | attrs.append(.TopMargin) 157 | } 158 | if (self.contains(ConstraintAttributes.BottomMargin)) { 159 | attrs.append(.BottomMargin) 160 | } 161 | if (self.contains(ConstraintAttributes.LeadingMargin)) { 162 | attrs.append(.LeadingMargin) 163 | } 164 | if (self.contains(ConstraintAttributes.TrailingMargin)) { 165 | attrs.append(.TrailingMargin) 166 | } 167 | if (self.contains(ConstraintAttributes.CenterXWithinMargins)) { 168 | attrs.append(.CenterXWithinMargins) 169 | } 170 | if (self.contains(ConstraintAttributes.CenterYWithinMargins)) { 171 | attrs.append(.CenterYWithinMargins) 172 | } 173 | #endif 174 | 175 | return attrs 176 | } 177 | } 178 | internal func +=(inout left: ConstraintAttributes, right: ConstraintAttributes) { 179 | left.unionInPlace(right) 180 | } 181 | internal func -=(inout left: ConstraintAttributes, right: ConstraintAttributes) { 182 | left.subtractInPlace(right) 183 | } 184 | internal func ==(left: ConstraintAttributes, right: ConstraintAttributes) -> Bool { 185 | return left.rawValue == right.rawValue 186 | } 187 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to assist in building a constraint 32 | */ 33 | public class ConstraintItem { 34 | 35 | internal init(object: AnyObject?, attributes: ConstraintAttributes) { 36 | self.object = object 37 | self.attributes = attributes 38 | } 39 | 40 | internal weak var object: AnyObject? 41 | internal var attributes: ConstraintAttributes 42 | 43 | internal var view: View? { 44 | return self.object as? View 45 | } 46 | 47 | @available(iOS 7.0, *) 48 | internal var layoutSupport: LayoutSupport? { 49 | return self.object as? LayoutSupport 50 | } 51 | } 52 | 53 | 54 | internal func ==(left: ConstraintItem, right: ConstraintItem) -> Bool { 55 | if left.object == nil { 56 | return false 57 | } 58 | if right.object == nil { 59 | return false 60 | } 61 | if left.object !== right.object { 62 | return false 63 | } 64 | if left.attributes != right.attributes { 65 | return false 66 | } 67 | return true 68 | } -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintMaker.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to make constraints 32 | */ 33 | public class ConstraintMaker { 34 | 35 | /// left edge 36 | public var left: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Left) } 37 | 38 | /// top edge 39 | public var top: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Top) } 40 | 41 | /// right edge 42 | public var right: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Right) } 43 | 44 | /// bottom edge 45 | public var bottom: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Bottom) } 46 | 47 | /// leading edge 48 | public var leading: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Leading) } 49 | 50 | /// trailing edge 51 | public var trailing: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Trailing) } 52 | 53 | /// width dimension 54 | public var width: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Width) } 55 | 56 | /// height dimension 57 | public var height: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Height) } 58 | 59 | /// centerX dimension 60 | public var centerX: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.CenterX) } 61 | 62 | /// centerY dimension 63 | public var centerY: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.CenterY) } 64 | 65 | /// baseline position 66 | public var baseline: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Baseline) } 67 | 68 | /// firse baseline position 69 | @available(iOS 8.0, *) 70 | public var firstBaseline: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.FirstBaseline) } 71 | 72 | /// left margin 73 | @available(iOS 8.0, *) 74 | public var leftMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.LeftMargin) } 75 | 76 | /// right margin 77 | @available(iOS 8.0, *) 78 | public var rightMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.RightMargin) } 79 | 80 | /// top margin 81 | @available(iOS 8.0, *) 82 | public var topMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.TopMargin) } 83 | 84 | /// bottom margin 85 | @available(iOS 8.0, *) 86 | public var bottomMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.BottomMargin) } 87 | 88 | /// leading margin 89 | @available(iOS 8.0, *) 90 | public var leadingMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.LeadingMargin) } 91 | 92 | /// trailing margin 93 | @available(iOS 8.0, *) 94 | public var trailingMargin: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.TrailingMargin) } 95 | 96 | /// centerX within margins 97 | @available(iOS 8.0, *) 98 | public var centerXWithinMargins: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.CenterXWithinMargins) } 99 | 100 | /// centerY within margins 101 | @available(iOS 8.0, *) 102 | public var centerYWithinMargins: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.CenterYWithinMargins) } 103 | 104 | /// top + left + bottom + right edges 105 | public var edges: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Edges) } 106 | 107 | /// width + height dimensions 108 | public var size: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Size) } 109 | 110 | // centerX + centerY positions 111 | public var center: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Center) } 112 | 113 | // top + left + bottom + right margins 114 | @available(iOS 8.0, *) 115 | public var margins: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.Margins) } 116 | 117 | // centerX + centerY within margins 118 | @available(iOS 8.0, *) 119 | public var centerWithinMargins: ConstraintDescriptionExtendable { return self.makeConstraintDescription(ConstraintAttributes.CenterWithinMargins) } 120 | 121 | internal init(view: View, file: String, line: UInt) { 122 | self.view = view 123 | self.file = file 124 | self.line = line 125 | } 126 | 127 | internal let file: String 128 | internal let line: UInt 129 | internal let view: View 130 | internal var constraintDescriptions = [ConstraintDescription]() 131 | 132 | internal func makeConstraintDescription(attributes: ConstraintAttributes) -> ConstraintDescription { 133 | let item = ConstraintItem(object: self.view, attributes: attributes) 134 | let constraintDescription = ConstraintDescription(fromItem: item) 135 | self.constraintDescriptions.append(constraintDescription) 136 | return constraintDescription 137 | } 138 | 139 | internal class func prepareConstraints(view view: View, file: String = "Unknown", line: UInt = 0, @noescape closure: (make: ConstraintMaker) -> Void) -> [Constraint] { 140 | let maker = ConstraintMaker(view: view, file: file, line: line) 141 | closure(make: maker) 142 | 143 | let constraints = maker.constraintDescriptions.map { $0.constraint } 144 | for constraint in constraints { 145 | constraint.makerFile = maker.file 146 | constraint.makerLine = maker.line 147 | } 148 | return constraints 149 | } 150 | 151 | internal class func makeConstraints(view view: View, file: String = "Unknown", line: UInt = 0, @noescape closure: (make: ConstraintMaker) -> Void) { 152 | view.translatesAutoresizingMaskIntoConstraints = false 153 | let maker = ConstraintMaker(view: view, file: file, line: line) 154 | closure(make: maker) 155 | 156 | let constraints = maker.constraintDescriptions.map { $0.constraint as! ConcreteConstraint } 157 | for constraint in constraints { 158 | constraint.makerFile = maker.file 159 | constraint.makerLine = maker.line 160 | constraint.installOnView(updateExisting: false) 161 | } 162 | } 163 | 164 | internal class func remakeConstraints(view view: View, file: String = "Unknown", line: UInt = 0, @noescape closure: (make: ConstraintMaker) -> Void) { 165 | view.translatesAutoresizingMaskIntoConstraints = false 166 | let maker = ConstraintMaker(view: view, file: file, line: line) 167 | closure(make: maker) 168 | 169 | self.removeConstraints(view: view) 170 | let constraints = maker.constraintDescriptions.map { $0.constraint as! ConcreteConstraint } 171 | for constraint in constraints { 172 | constraint.makerFile = maker.file 173 | constraint.makerLine = maker.line 174 | constraint.installOnView(updateExisting: false) 175 | } 176 | } 177 | 178 | internal class func updateConstraints(view view: View, file: String = "Unknown", line: UInt = 0, @noescape closure: (make: ConstraintMaker) -> Void) { 179 | view.translatesAutoresizingMaskIntoConstraints = false 180 | let maker = ConstraintMaker(view: view, file: file, line: line) 181 | closure(make: maker) 182 | 183 | let constraints = maker.constraintDescriptions.map { $0.constraint as! ConcreteConstraint} 184 | for constraint in constraints { 185 | constraint.makerFile = maker.file 186 | constraint.makerLine = maker.line 187 | constraint.installOnView(updateExisting: true) 188 | } 189 | } 190 | 191 | internal class func removeConstraints(view view: View) { 192 | for existingLayoutConstraint in view.snp_installedLayoutConstraints { 193 | existingLayoutConstraint.snp_constraint?.uninstall() 194 | } 195 | } 196 | } 197 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ConstraintRelation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to define `NSLayoutRelation` 32 | */ 33 | internal enum ConstraintRelation: Int { 34 | case Equal = 1, LessThanOrEqualTo, GreaterThanOrEqualTo 35 | 36 | internal var layoutRelation: NSLayoutRelation { 37 | get { 38 | switch(self) { 39 | case .LessThanOrEqualTo: 40 | return .LessThanOrEqual 41 | case .GreaterThanOrEqualTo: 42 | return .GreaterThanOrEqual 43 | default: 44 | return .Equal 45 | } 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Pods/SnapKit/Source/Debugging.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to allow adding a snp_label to a View for debugging purposes 32 | */ 33 | public extension View { 34 | 35 | public var snp_label: String? { 36 | get { 37 | return objc_getAssociatedObject(self, &labelKey) as? String 38 | } 39 | set { 40 | objc_setAssociatedObject(self, &labelKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_COPY_NONATOMIC) 41 | } 42 | } 43 | 44 | } 45 | 46 | /** 47 | Used to allow adding a snp_label to a LayoutConstraint for debugging purposes 48 | */ 49 | public extension LayoutConstraint { 50 | 51 | public var snp_label: String? { 52 | get { 53 | return objc_getAssociatedObject(self, &labelKey) as? String 54 | } 55 | set { 56 | objc_setAssociatedObject(self, &labelKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_COPY_NONATOMIC) 57 | } 58 | } 59 | 60 | override public var description: String { 61 | var description = "<" 62 | 63 | description += descriptionForObject(self) 64 | 65 | if let firstItem: AnyObject = self.firstItem { 66 | description += " \(descriptionForObject(firstItem))" 67 | } 68 | 69 | if self.firstAttribute != .NotAnAttribute { 70 | description += ".\(self.firstAttribute.snp_description)" 71 | } 72 | 73 | description += " \(self.relation.snp_description)" 74 | 75 | if let secondItem: AnyObject = self.secondItem { 76 | description += " \(descriptionForObject(secondItem))" 77 | } 78 | 79 | if self.secondAttribute != .NotAnAttribute { 80 | description += ".\(self.secondAttribute.snp_description)" 81 | } 82 | 83 | if self.multiplier != 1.0 { 84 | description += " * \(self.multiplier)" 85 | } 86 | 87 | if self.secondAttribute == .NotAnAttribute { 88 | description += " \(self.constant)" 89 | } else { 90 | if self.constant > 0.0 { 91 | description += " + \(self.constant)" 92 | } else if self.constant < 0.0 { 93 | description += " - \(CGFloat.abs(self.constant))" 94 | } 95 | } 96 | 97 | if self.priority != 1000.0 { 98 | description += " ^\(self.priority)" 99 | } 100 | 101 | description += ">" 102 | 103 | return description 104 | } 105 | 106 | internal var snp_makerFile: String? { 107 | return self.snp_constraint?.makerFile 108 | } 109 | 110 | internal var snp_makerLine: UInt? { 111 | return self.snp_constraint?.makerLine 112 | } 113 | 114 | } 115 | 116 | private var labelKey = "" 117 | 118 | private func descriptionForObject(object: AnyObject) -> String { 119 | let pointerDescription = NSString(format: "%p", ObjectIdentifier(object).uintValue) 120 | var desc = "" 121 | 122 | desc += object.dynamicType.description() 123 | 124 | if let object = object as? View { 125 | desc += ":\(object.snp_label ?? pointerDescription)" 126 | } else if let object = object as? LayoutConstraint { 127 | desc += ":\(object.snp_label ?? pointerDescription)" 128 | } else { 129 | desc += ":\(pointerDescription)" 130 | } 131 | 132 | if let object = object as? LayoutConstraint, let file = object.snp_makerFile, let line = object.snp_makerLine { 133 | desc += "@\(file)#\(line)" 134 | } 135 | 136 | desc += "" 137 | return desc 138 | } 139 | 140 | private extension NSLayoutRelation { 141 | 142 | private var snp_description: String { 143 | switch self { 144 | case .Equal: return "==" 145 | case .GreaterThanOrEqual: return ">=" 146 | case .LessThanOrEqual: return "<=" 147 | } 148 | } 149 | 150 | } 151 | 152 | private extension NSLayoutAttribute { 153 | 154 | private var snp_description: String { 155 | #if os(iOS) || os(tvOS) 156 | switch self { 157 | case .NotAnAttribute: return "notAnAttribute" 158 | case .Top: return "top" 159 | case .Left: return "left" 160 | case .Bottom: return "bottom" 161 | case .Right: return "right" 162 | case .Leading: return "leading" 163 | case .Trailing: return "trailing" 164 | case .Width: return "width" 165 | case .Height: return "height" 166 | case .CenterX: return "centerX" 167 | case .CenterY: return "centerY" 168 | case .LastBaseline: return "baseline" 169 | case .FirstBaseline: return "firstBaseline" 170 | case .TopMargin: return "topMargin" 171 | case .LeftMargin: return "leftMargin" 172 | case .BottomMargin: return "bottomMargin" 173 | case .RightMargin: return "rightMargin" 174 | case .LeadingMargin: return "leadingMargin" 175 | case .TrailingMargin: return "trailingMargin" 176 | case .CenterXWithinMargins: return "centerXWithinMargins" 177 | case .CenterYWithinMargins: return "centerYWithinMargins" 178 | } 179 | #else 180 | switch self { 181 | case .NotAnAttribute: return "notAnAttribute" 182 | case .Top: return "top" 183 | case .Left: return "left" 184 | case .Bottom: return "bottom" 185 | case .Right: return "right" 186 | case .Leading: return "leading" 187 | case .Trailing: return "trailing" 188 | case .Width: return "width" 189 | case .Height: return "height" 190 | case .CenterX: return "centerX" 191 | case .CenterY: return "centerY" 192 | case .LastBaseline: return "baseline" 193 | default: return "default" 194 | } 195 | #endif 196 | 197 | } 198 | 199 | } 200 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/EdgeInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias EdgeInsets = UIEdgeInsets 27 | public func EdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> EdgeInsets { 28 | return EdgeInsets(top: top, left: left, bottom: bottom, right: right) 29 | } 30 | public let EdgeInsetsZero = EdgeInsets(top: 0, left: 0, bottom: 0, right: 0) 31 | #else 32 | import AppKit 33 | public typealias EdgeInsets = NSEdgeInsets 34 | public func EdgeInsetsMake(top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat) -> EdgeInsets { 35 | return EdgeInsets(top: top, left: left, bottom: bottom, right: right) 36 | } 37 | public let EdgeInsetsZero = EdgeInsets(top: 0, left: 0, bottom: 0, right: 0) 38 | #endif 39 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/LayoutConstraint.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | #else 27 | import AppKit 28 | #endif 29 | 30 | /** 31 | Used to add extra information to the actual `NSLayoutConstraint`'s that will UIKit/AppKit will utilize 32 | */ 33 | public class LayoutConstraint: NSLayoutConstraint { 34 | 35 | internal var snp_constraint: Constraint? = nil 36 | 37 | } 38 | 39 | internal func ==(left: LayoutConstraint, right: LayoutConstraint) -> Bool { 40 | if left.firstItem !== right.firstItem { 41 | return false 42 | } 43 | if left.secondItem !== right.secondItem { 44 | return false 45 | } 46 | if left.firstAttribute != right.firstAttribute { 47 | return false 48 | } 49 | if left.secondAttribute != right.secondAttribute { 50 | return false 51 | } 52 | if left.relation != right.relation { 53 | return false 54 | } 55 | if left.priority != right.priority { 56 | return false 57 | } 58 | if left.multiplier != right.multiplier { 59 | return false 60 | } 61 | return true 62 | } 63 | 64 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/SnapKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias InterfaceLayoutDirection = UIUserInterfaceLayoutDirection 27 | public typealias LayoutSupport = UILayoutSupport 28 | #else 29 | import AppKit 30 | public typealias InterfaceLayoutDirection = NSUserInterfaceLayoutDirection 31 | public class LayoutSupport {} 32 | #endif 33 | 34 | /** 35 | Used to configure different parts of SnapKit 36 | */ 37 | public struct Config { 38 | 39 | /// The interface layout direction 40 | public static var interfaceLayoutDirection = InterfaceLayoutDirection.LeftToRight 41 | 42 | } -------------------------------------------------------------------------------- /Pods/SnapKit/Source/View+SnapKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | public typealias View = UIView 27 | #else 28 | import AppKit 29 | public typealias View = NSView 30 | #endif 31 | 32 | /** 33 | Used to expose public API on views 34 | */ 35 | public extension View { 36 | 37 | /// left edge 38 | public var snp_left: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Left) } 39 | 40 | /// top edge 41 | public var snp_top: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Top) } 42 | 43 | /// right edge 44 | public var snp_right: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Right) } 45 | 46 | /// bottom edge 47 | public var snp_bottom: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Bottom) } 48 | 49 | /// leading edge 50 | public var snp_leading: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Leading) } 51 | 52 | /// trailing edge 53 | public var snp_trailing: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Trailing) } 54 | 55 | /// width dimension 56 | public var snp_width: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Width) } 57 | 58 | /// height dimension 59 | public var snp_height: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Height) } 60 | 61 | /// centerX position 62 | public var snp_centerX: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterX) } 63 | 64 | /// centerY position 65 | public var snp_centerY: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterY) } 66 | 67 | /// baseline position 68 | public var snp_baseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Baseline) } 69 | 70 | /// first baseline position 71 | @available(iOS 8.0, *) 72 | public var snp_firstBaseline: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.FirstBaseline) } 73 | 74 | /// left margin 75 | @available(iOS 8.0, *) 76 | public var snp_leftMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeftMargin) } 77 | 78 | /// right margin 79 | @available(iOS 8.0, *) 80 | public var snp_rightMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.RightMargin) } 81 | 82 | /// top margin 83 | @available(iOS 8.0, *) 84 | public var snp_topMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TopMargin) } 85 | 86 | /// bottom margin 87 | @available(iOS 8.0, *) 88 | public var snp_bottomMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.BottomMargin) } 89 | 90 | /// leading margin 91 | @available(iOS 8.0, *) 92 | public var snp_leadingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.LeadingMargin) } 93 | 94 | /// trailing margin 95 | @available(iOS 8.0, *) 96 | public var snp_trailingMargin: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.TrailingMargin) } 97 | 98 | /// centerX within margins 99 | @available(iOS 8.0, *) 100 | public var snp_centerXWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterXWithinMargins) } 101 | 102 | /// centerY within margins 103 | @available(iOS 8.0, *) 104 | public var snp_centerYWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterYWithinMargins) } 105 | 106 | // top + left + bottom + right edges 107 | public var snp_edges: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Edges) } 108 | 109 | // width + height dimensions 110 | public var snp_size: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Size) } 111 | 112 | // centerX + centerY positions 113 | public var snp_center: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Center) } 114 | 115 | // top + left + bottom + right margins 116 | @available(iOS 8.0, *) 117 | public var snp_margins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.Margins) } 118 | 119 | // centerX + centerY within margins 120 | @available(iOS 8.0, *) 121 | public var snp_centerWithinMargins: ConstraintItem { return ConstraintItem(object: self, attributes: ConstraintAttributes.CenterWithinMargins) } 122 | 123 | /** 124 | Prepares constraints with a `ConstraintMaker` and returns the made constraints but does not install them. 125 | 126 | - parameter closure that will be passed the `ConstraintMaker` to make the constraints with 127 | 128 | - returns: the constraints made 129 | */ 130 | public func snp_prepareConstraints(file: String = #file, line: UInt = #line, @noescape closure: (make: ConstraintMaker) -> Void) -> [Constraint] { 131 | return ConstraintMaker.prepareConstraints(view: self, file: file, line: line, closure: closure) 132 | } 133 | 134 | /** 135 | Makes constraints with a `ConstraintMaker` and installs them along side any previous made constraints. 136 | 137 | - parameter closure that will be passed the `ConstraintMaker` to make the constraints with 138 | */ 139 | public func snp_makeConstraints(file: String = #file, line: UInt = #line, @noescape closure: (make: ConstraintMaker) -> Void) -> Void { 140 | ConstraintMaker.makeConstraints(view: self, file: file, line: line, closure: closure) 141 | } 142 | 143 | /** 144 | Updates constraints with a `ConstraintMaker` that will replace existing constraints that match and install new ones. 145 | 146 | For constraints to match only the constant can be updated. 147 | 148 | - parameter closure that will be passed the `ConstraintMaker` to update the constraints with 149 | */ 150 | public func snp_updateConstraints(file: String = #file, line: UInt = #line, @noescape closure: (make: ConstraintMaker) -> Void) -> Void { 151 | ConstraintMaker.updateConstraints(view: self, file: file, line: line, closure: closure) 152 | } 153 | 154 | /** 155 | Remakes constraints with a `ConstraintMaker` that will first remove all previously made constraints and make and install new ones. 156 | 157 | - parameter closure that will be passed the `ConstraintMaker` to remake the constraints with 158 | */ 159 | public func snp_remakeConstraints(file: String = #file, line: UInt = #line, @noescape closure: (make: ConstraintMaker) -> Void) -> Void { 160 | ConstraintMaker.remakeConstraints(view: self, file: file, line: line, closure: closure) 161 | } 162 | 163 | /** 164 | Removes all previously made constraints. 165 | */ 166 | public func snp_removeConstraints() { 167 | ConstraintMaker.removeConstraints(view: self) 168 | } 169 | 170 | internal var snp_installedLayoutConstraints: [LayoutConstraint] { 171 | get { 172 | if let constraints = objc_getAssociatedObject(self, &installedLayoutConstraintsKey) as? [LayoutConstraint] { 173 | return constraints 174 | } 175 | return [] 176 | } 177 | set { 178 | objc_setAssociatedObject(self, &installedLayoutConstraintsKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) 179 | } 180 | } 181 | } 182 | 183 | private var installedLayoutConstraintsKey = "" 184 | -------------------------------------------------------------------------------- /Pods/SnapKit/Source/ViewController+SnapKit.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SnapKit 3 | // 4 | // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to deal 8 | // in the Software without restriction, including without limitation the rights 9 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | // copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | #if os(iOS) || os(tvOS) 25 | import UIKit 26 | 27 | /** 28 | Used to expose public API on view controllers 29 | */ 30 | public extension UIViewController { 31 | 32 | /// top layout guide top 33 | public var snp_topLayoutGuideTop: ConstraintItem { return ConstraintItem(object: self.topLayoutGuide, attributes: ConstraintAttributes.Top) } 34 | 35 | /// top layout guide bottom 36 | public var snp_topLayoutGuideBottom: ConstraintItem { return ConstraintItem(object: self.topLayoutGuide, attributes: ConstraintAttributes.Bottom) } 37 | 38 | /// bottom layout guide top 39 | public var snp_bottomLayoutGuideTop: ConstraintItem { return ConstraintItem(object: self.bottomLayoutGuide, attributes: ConstraintAttributes.Top) } 40 | 41 | /// bottom layout guide bottom 42 | public var snp_bottomLayoutGuideBottom: ConstraintItem { return ConstraintItem(object: self.bottomLayoutGuide, attributes: ConstraintAttributes.Bottom) } 43 | 44 | } 45 | #endif 46 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/ChameleonFramework-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_ChameleonFramework : NSObject 3 | @end 4 | @implementation PodsDummy_ChameleonFramework 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/ChameleonFramework-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/ChameleonFramework-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "Chameleon.h" 4 | #import "ChameleonConstants.h" 5 | #import "ChameleonEnums.h" 6 | #import "ChameleonMacros.h" 7 | #import "Chameleon_.h" 8 | #import "NSArray+Chameleon.h" 9 | #import "UIAppearance+Swift.h" 10 | #import "UIButton+Chameleon.h" 11 | #import "UIColor+Chameleon.h" 12 | #import "UIColor+ChameleonPrivate.h" 13 | #import "UIImage+ChameleonPrivate.h" 14 | #import "UILabel+Chameleon.h" 15 | #import "UINavigationController+Chameleon.h" 16 | #import "UIView+ChameleonPrivate.h" 17 | #import "UIViewController+Chameleon.h" 18 | 19 | FOUNDATION_EXPORT double ChameleonFrameworkVersionNumber; 20 | FOUNDATION_EXPORT const unsigned char ChameleonFrameworkVersionString[]; 21 | 22 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/ChameleonFramework.modulemap: -------------------------------------------------------------------------------- 1 | framework module ChameleonFramework { 2 | umbrella header "ChameleonFramework-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/ChameleonFramework.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" -framework "UIKit" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/ChameleonFramework/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 2.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## ChameleonFramework 5 | 6 | ##The MIT License (MIT) 7 | 8 | > Copyright (c) 2014-2015 Vicc Alexander 9 | 10 | > Permission is hereby granted, free of charge, to any person obtaining a copy 11 | > of this software and associated documentation files (the "Software"), to deal 12 | > in the Software without restriction, including without limitation the rights 13 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | > copies of the Software, and to permit persons to whom the Software is 15 | > furnished to do so, subject to the following conditions: 16 | 17 | > The above copyright notice and this permission notice shall be included in all 18 | > copies or substantial portions of the Software. 19 | 20 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | > SOFTWARE. 27 | 28 | 29 | ## SnapKit 30 | 31 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in 41 | all copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 49 | THE SOFTWARE. 50 | 51 | Generated by CocoaPods - https://cocoapods.org 52 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-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 | ##The MIT License (MIT) 18 | 19 | > Copyright (c) 2014-2015 Vicc Alexander 20 | 21 | > Permission is hereby granted, free of charge, to any person obtaining a copy 22 | > of this software and associated documentation files (the "Software"), to deal 23 | > in the Software without restriction, including without limitation the rights 24 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 25 | > copies of the Software, and to permit persons to whom the Software is 26 | > furnished to do so, subject to the following conditions: 27 | 28 | > The above copyright notice and this permission notice shall be included in all 29 | > copies or substantial portions of the Software. 30 | 31 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 32 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 33 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 34 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 35 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 36 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 37 | > SOFTWARE. 38 | 39 | Title 40 | ChameleonFramework 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2011-Present SnapKit Team - https://github.com/SnapKit 47 | 48 | Permission is hereby granted, free of charge, to any person obtaining a copy 49 | of this software and associated documentation files (the "Software"), to deal 50 | in the Software without restriction, including without limitation the rights 51 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 52 | copies of the Software, and to permit persons to whom the Software is 53 | furnished to do so, subject to the following conditions: 54 | 55 | The above copyright notice and this permission notice shall be included in 56 | all copies or substantial portions of the Software. 57 | 58 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 59 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 60 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 61 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 62 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 63 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 64 | THE SOFTWARE. 65 | 66 | Title 67 | SnapKit 68 | Type 69 | PSGroupSpecifier 70 | 71 | 72 | FooterText 73 | Generated by CocoaPods - https://cocoapods.org 74 | Title 75 | 76 | Type 77 | PSGroupSpecifier 78 | 79 | 80 | StringsTable 81 | Acknowledgements 82 | Title 83 | Acknowledgements 84 | 85 | 86 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CuntingLabel : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CuntingLabel 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "$BUILT_PRODUCTS_DIR/ChameleonFramework/ChameleonFramework.framework" 88 | install_framework "$BUILT_PRODUCTS_DIR/SnapKit/SnapKit.framework" 89 | fi 90 | if [[ "$CONFIGURATION" == "Release" ]]; then 91 | install_framework "$BUILT_PRODUCTS_DIR/ChameleonFramework/ChameleonFramework.framework" 92 | install_framework "$BUILT_PRODUCTS_DIR/SnapKit/SnapKit.framework" 93 | fi 94 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_CuntingLabelVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_CuntingLabelVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "SnapKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CuntingLabel { 2 | umbrella header "Pods-CuntingLabel-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabel/Pods-CuntingLabel.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "ChameleonFramework" -framework "SnapKit" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CuntingLabelTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CuntingLabelTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_CuntingLabelTestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_CuntingLabelTestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CuntingLabelTests { 2 | umbrella header "Pods-CuntingLabelTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelTests/Pods-CuntingLabelTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_CuntingLabelUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_CuntingLabelUITests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | case "${TARGETED_DEVICE_FAMILY}" in 12 | 1,2) 13 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 14 | ;; 15 | 1) 16 | TARGET_DEVICE_ARGS="--target-device iphone" 17 | ;; 18 | 2) 19 | TARGET_DEVICE_ARGS="--target-device ipad" 20 | ;; 21 | *) 22 | TARGET_DEVICE_ARGS="--target-device mac" 23 | ;; 24 | esac 25 | 26 | realpath() { 27 | DIRECTORY="$(cd "${1%/*}" && pwd)" 28 | FILENAME="${1##*/}" 29 | echo "$DIRECTORY/$FILENAME" 30 | } 31 | 32 | install_resource() 33 | { 34 | if [[ "$1" = /* ]] ; then 35 | RESOURCE_PATH="$1" 36 | else 37 | RESOURCE_PATH="${PODS_ROOT}/$1" 38 | fi 39 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 40 | cat << EOM 41 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 42 | EOM 43 | exit 1 44 | fi 45 | case $RESOURCE_PATH in 46 | *.storyboard) 47 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 48 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 49 | ;; 50 | *.xib) 51 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" 52 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 53 | ;; 54 | *.framework) 55 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 56 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 57 | echo "rsync -av $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 58 | rsync -av "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 59 | ;; 60 | *.xcdatamodel) 61 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" 62 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 63 | ;; 64 | *.xcdatamodeld) 65 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" 66 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 67 | ;; 68 | *.xcmappingmodel) 69 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" 70 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 71 | ;; 72 | *.xcassets) 73 | ABSOLUTE_XCASSET_FILE=$(realpath "$RESOURCE_PATH") 74 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 75 | ;; 76 | *) 77 | echo "$RESOURCE_PATH" 78 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 79 | ;; 80 | esac 81 | } 82 | 83 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 84 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 85 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 86 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 87 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 88 | fi 89 | rm -f "$RESOURCES_TO_COPY" 90 | 91 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 92 | then 93 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 94 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 95 | while read line; do 96 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 97 | XCASSET_FILES+=("$line") 98 | fi 99 | done <<<"$OTHER_XCASSETS" 100 | 101 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 102 | fi 103 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_CuntingLabelUITestsVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_CuntingLabelUITestsVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_CuntingLabelUITests { 2 | umbrella header "Pods-CuntingLabelUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-CuntingLabelUITests/Pods-CuntingLabelUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework" "$PODS_CONFIGURATION_BUILD_DIR/SnapKit" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/ChameleonFramework/ChameleonFramework.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SnapKit/SnapKit.framework/Headers" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.21.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SnapKit : NSObject 3 | @end 4 | @implementation PodsDummy_SnapKit 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double SnapKitVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char SnapKitVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module SnapKit { 2 | umbrella header "SnapKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SnapKit/SnapKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SnapKit 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CountingLabel 2 | CountingLabel是一个实现数字变化的动画效果的Label控件 3 | 4 | 效果如下: 5 | 6 | ![image](https://github.com/geekbing/CountingLabel/blob/master/CuntingLabel.gif) 7 | 8 | 使用方法非常简单: 9 | 10 | 1.整数型变幻效果 11 |
label.format = "%.0f"
12 | // 从0变幻到100
13 | label.countFrom(fromNum: 0, toNum: 100, duration: 1.0)
14 | 
15 | 16 | 2.浮点型变幻效果 17 |
label.format = "%.2f"
18 | // 从1.02变幻到520.00
19 | label.countFrom(fromNum: 1.02, toNum: 520.00, duration: 2.0)
20 | 
21 | 22 | 3.千分位分隔符变幻效果 23 |
// formatBlock属性非常强大,完全可以自定义显示格式
24 | label.formatBlock = { (value: Double) -> NSString in
25 | 	let str = NSString(format: "%.2f", value)
26 |     
27 |     // 按照千分位分隔符输出
28 | 	let formatter = NSNumberFormatter()
29 | 	formatter.numberStyle = .DecimalStyle
30 | 	formatter.positiveFormat = "###,##0.00"
31 |             
32 | 	return formatter.stringFromNumber(NSNumber(double: str.doubleValue))!
33 | }
34 | // 从1.02变幻到13,145.20
35 | label.countFrom(fromNum: 1.02, toNum: 13145.20, duration: 3.0)
36 | 
37 | 38 | 4.开始和停止变幻效果 39 |
// 点击重启按钮
40 | func startBtnClick()
41 | {
42 |   // 从1.02变幻到10,000,013,145.20
43 | 	label.countFrom(fromNum: 1.02, toNum: 10000013145.20, duration: 4.0)
44 | }
45 | // 点击停止按钮
46 | func stopBtnClick()
47 | {
48 | 	label.stopCounting()
49 | }
50 | 
51 | --------------------------------------------------------------------------------