├── .gitignore ├── .travis.yml ├── Example ├── LSTTimer.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── LSTTimer-Example.xcscheme ├── LSTTimer.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── LSTTimer │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── lstiPhoneApp_60pt@2x.png │ │ │ ├── lstiPhoneApp_60pt@3x.png │ │ │ ├── lstiPhoneNotification_20pt@2x.png │ │ │ ├── lstiPhoneNotification_20pt@3x.png │ │ │ ├── lstiPhoneSpootlight5_29pt@2x.png │ │ │ ├── lstiPhoneSpootlight5_29pt@3x.png │ │ │ ├── lstiPhoneSpootlight7_40pt@2x.png │ │ │ └── lstiPhoneSpootlight7_40pt@3x.png │ ├── LSTAppDelegate.h │ ├── LSTAppDelegate.m │ ├── LSTTimer-Info.plist │ ├── LSTTimer-Prefix.pch │ ├── LSTTimerDemoVC.h │ ├── LSTTimerDemoVC.m │ ├── LSTTimerDemoVC.xib │ ├── LSTTimerDiskVC.h │ ├── LSTTimerDiskVC.m │ ├── LSTTimerDiskVC.xib │ ├── LSTTimerListCell.h │ ├── LSTTimerListCell.m │ ├── LSTTimerListCell.xib │ ├── LSTTimerListVC.h │ ├── LSTTimerListVC.m │ ├── LSTTimerRAMVC.h │ ├── LSTTimerRAMVC.m │ ├── LSTTimerRAMVC.xib │ ├── LSTViewController.h │ ├── LSTViewController.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock ├── Pods │ ├── Headers │ │ ├── Private │ │ │ ├── LSTCategory │ │ │ │ ├── LSTControlEvents.h │ │ │ │ ├── LSTGestureEvents.h │ │ │ │ ├── NSString+LSTString.h │ │ │ │ ├── UIColor+LSTColor.h │ │ │ │ └── UIView+LSTView.h │ │ │ ├── LSTTimer │ │ │ │ └── LSTTimer.h │ │ │ └── Masonry │ │ │ │ ├── MASCompositeConstraint.h │ │ │ │ ├── MASConstraint+Private.h │ │ │ │ ├── MASConstraint.h │ │ │ │ ├── MASConstraintMaker.h │ │ │ │ ├── MASLayoutConstraint.h │ │ │ │ ├── MASUtilities.h │ │ │ │ ├── MASViewAttribute.h │ │ │ │ ├── MASViewConstraint.h │ │ │ │ ├── Masonry.h │ │ │ │ ├── NSArray+MASAdditions.h │ │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ │ ├── View+MASAdditions.h │ │ │ │ ├── View+MASShorthandAdditions.h │ │ │ │ └── ViewController+MASAdditions.h │ │ └── Public │ │ │ ├── LSTCategory │ │ │ ├── LSTControlEvents.h │ │ │ ├── LSTGestureEvents.h │ │ │ ├── NSString+LSTString.h │ │ │ ├── UIColor+LSTColor.h │ │ │ └── UIView+LSTView.h │ │ │ ├── LSTTimer │ │ │ └── LSTTimer.h │ │ │ └── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewConstraint.h │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASShorthandAdditions.h │ │ │ └── ViewController+MASAdditions.h │ ├── LSTCategory │ │ ├── LICENSE │ │ ├── LSTCategory │ │ │ └── Classes │ │ │ │ └── Code │ │ │ │ ├── LSTControlEvents │ │ │ │ ├── LSTControlEvents.h │ │ │ │ └── LSTControlEvents.m │ │ │ │ ├── LSTGestureEvents │ │ │ │ ├── LSTGestureEvents.h │ │ │ │ └── LSTGestureEvents.m │ │ │ │ ├── NSString+LSTString │ │ │ │ ├── NSString+LSTString.h │ │ │ │ └── NSString+LSTString.m │ │ │ │ ├── UIColor+LSTColor │ │ │ │ ├── UIColor+LSTColor.h │ │ │ │ └── UIColor+LSTColor.m │ │ │ │ └── UIView+LSTView │ │ │ │ ├── UIView+LSTView.h │ │ │ │ └── UIView+LSTView.m │ │ └── README.md │ ├── Local Podspecs │ │ └── LSTTimer.podspec.json │ ├── Manifest.lock │ ├── Masonry │ │ ├── LICENSE │ │ ├── Masonry │ │ │ ├── MASCompositeConstraint.h │ │ │ ├── MASCompositeConstraint.m │ │ │ ├── MASConstraint+Private.h │ │ │ ├── MASConstraint.h │ │ │ ├── MASConstraint.m │ │ │ ├── MASConstraintMaker.h │ │ │ ├── MASConstraintMaker.m │ │ │ ├── MASLayoutConstraint.h │ │ │ ├── MASLayoutConstraint.m │ │ │ ├── MASUtilities.h │ │ │ ├── MASViewAttribute.h │ │ │ ├── MASViewAttribute.m │ │ │ ├── MASViewConstraint.h │ │ │ ├── MASViewConstraint.m │ │ │ ├── Masonry.h │ │ │ ├── NSArray+MASAdditions.h │ │ │ ├── NSArray+MASAdditions.m │ │ │ ├── NSArray+MASShorthandAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ │ ├── View+MASAdditions.h │ │ │ ├── View+MASAdditions.m │ │ │ ├── View+MASShorthandAdditions.h │ │ │ ├── ViewController+MASAdditions.h │ │ │ └── ViewController+MASAdditions.m │ │ └── README.md │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ └── Target Support Files │ │ ├── LSTCategory │ │ ├── LSTCategory-Info.plist │ │ ├── LSTCategory-dummy.m │ │ ├── LSTCategory-prefix.pch │ │ ├── LSTCategory-umbrella.h │ │ ├── LSTCategory.debug.xcconfig │ │ ├── LSTCategory.modulemap │ │ └── LSTCategory.release.xcconfig │ │ ├── LSTTimer │ │ ├── LSTTimer-Info.plist │ │ ├── LSTTimer-dummy.m │ │ ├── LSTTimer-prefix.pch │ │ ├── LSTTimer-umbrella.h │ │ ├── LSTTimer.debug.xcconfig │ │ ├── LSTTimer.modulemap │ │ └── LSTTimer.release.xcconfig │ │ ├── Masonry │ │ ├── Masonry-Info.plist │ │ ├── Masonry-dummy.m │ │ ├── Masonry-prefix.pch │ │ ├── Masonry-umbrella.h │ │ ├── Masonry.debug.xcconfig │ │ ├── Masonry.modulemap │ │ └── Masonry.release.xcconfig │ │ ├── Pods-LSTTimer_Example │ │ ├── Pods-LSTTimer_Example-Info.plist │ │ ├── Pods-LSTTimer_Example-acknowledgements.markdown │ │ ├── Pods-LSTTimer_Example-acknowledgements.plist │ │ ├── Pods-LSTTimer_Example-dummy.m │ │ ├── Pods-LSTTimer_Example-frameworks.sh │ │ ├── Pods-LSTTimer_Example-umbrella.h │ │ ├── Pods-LSTTimer_Example.debug.xcconfig │ │ ├── Pods-LSTTimer_Example.modulemap │ │ └── Pods-LSTTimer_Example.release.xcconfig │ │ └── Pods-LSTTimer_Tests │ │ ├── Pods-LSTTimer_Tests-Info.plist │ │ ├── Pods-LSTTimer_Tests-acknowledgements.markdown │ │ ├── Pods-LSTTimer_Tests-acknowledgements.plist │ │ ├── Pods-LSTTimer_Tests-dummy.m │ │ ├── Pods-LSTTimer_Tests-umbrella.h │ │ ├── Pods-LSTTimer_Tests.debug.xcconfig │ │ ├── Pods-LSTTimer_Tests.modulemap │ │ └── Pods-LSTTimer_Tests.release.xcconfig ├── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ │ └── InfoPlist.strings └── UPDATE_HISTORY.md ├── LICENSE ├── LSTTimer.podspec ├── LSTTimer ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── LSTTimer.h │ └── LSTTimer.m ├── README.md └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/LSTTimer.xcworkspace -scheme LSTTimer-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/LSTTimer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/LSTTimer.xcodeproj/xcshareddata/xcschemes/LSTTimer-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 42 | 48 | 49 | 50 | 51 | 52 | 62 | 64 | 70 | 71 | 72 | 73 | 79 | 81 | 87 | 88 | 89 | 90 | 92 | 93 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Example/LSTTimer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/LSTTimer.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/LSTTimer/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 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/LSTTimer/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "lstiPhoneNotification_20pt@2x.png", 5 | "idiom" : "iphone", 6 | "scale" : "2x", 7 | "size" : "20x20" 8 | }, 9 | { 10 | "filename" : "lstiPhoneNotification_20pt@3x.png", 11 | "idiom" : "iphone", 12 | "scale" : "3x", 13 | "size" : "20x20" 14 | }, 15 | { 16 | "filename" : "lstiPhoneSpootlight5_29pt@2x.png", 17 | "idiom" : "iphone", 18 | "scale" : "2x", 19 | "size" : "29x29" 20 | }, 21 | { 22 | "filename" : "lstiPhoneSpootlight5_29pt@3x.png", 23 | "idiom" : "iphone", 24 | "scale" : "3x", 25 | "size" : "29x29" 26 | }, 27 | { 28 | "filename" : "lstiPhoneSpootlight7_40pt@2x.png", 29 | "idiom" : "iphone", 30 | "scale" : "2x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "lstiPhoneSpootlight7_40pt@3x.png", 35 | "idiom" : "iphone", 36 | "scale" : "3x", 37 | "size" : "40x40" 38 | }, 39 | { 40 | "filename" : "lstiPhoneApp_60pt@2x.png", 41 | "idiom" : "iphone", 42 | "scale" : "2x", 43 | "size" : "60x60" 44 | }, 45 | { 46 | "filename" : "lstiPhoneApp_60pt@3x.png", 47 | "idiom" : "iphone", 48 | "scale" : "3x", 49 | "size" : "60x60" 50 | }, 51 | { 52 | "idiom" : "ios-marketing", 53 | "scale" : "1x", 54 | "size" : "1024x1024" 55 | } 56 | ], 57 | "info" : { 58 | "author" : "xcode", 59 | "version" : 1 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneApp_60pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneApp_60pt@2x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneApp_60pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneApp_60pt@3x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneNotification_20pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneNotification_20pt@2x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneNotification_20pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneNotification_20pt@3x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight5_29pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight5_29pt@2x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight5_29pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight5_29pt@3x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight7_40pt@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight7_40pt@2x.png -------------------------------------------------------------------------------- /Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight7_40pt@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/Example/LSTTimer/Images.xcassets/AppIcon.appiconset/lstiPhoneSpootlight7_40pt@3x.png -------------------------------------------------------------------------------- /Example/LSTTimer/LSTAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTAppDelegate.h 3 | // LSTTimer 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LSTAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTAppDelegate.m 3 | // LSTTimer 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTAppDelegate.h" 10 | 11 | @implementation LSTAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | 17 | NSString *homePath = NSHomeDirectory(); 18 | NSLog(@"home根目录:%@", homePath); 19 | return YES; 20 | } 21 | 22 | - (void)applicationWillResignActive:(UIApplication *)application 23 | { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application 35 | { 36 | // 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. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application 45 | { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimer-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | $(PRODUCT_NAME) 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(MARKETING_VERSION) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | UIBackgroundModes 28 | 29 | audio 30 | fetch 31 | processing 32 | 33 | UILaunchStoryboardName 34 | LaunchScreen 35 | UIMainStoryboardFile 36 | Main 37 | UIRequiredDeviceCapabilities 38 | 39 | armv7 40 | 41 | UISupportedInterfaceOrientations 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationLandscapeLeft 45 | UIInterfaceOrientationLandscapeRight 46 | 47 | UISupportedInterfaceOrientations~ipad 48 | 49 | UIInterfaceOrientationPortrait 50 | UIInterfaceOrientationPortraitUpsideDown 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimer-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerDemoVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerDemoVC.h 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/15. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LSTTimerDemoVC : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerDiskVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerDiskVC.h 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/18. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LSTTimerDiskVC : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerDiskVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerDiskVC.m 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/18. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTTimerDiskVC.h" 10 | #import 11 | 12 | @interface LSTTimerDiskVC () 13 | @property (weak, nonatomic) IBOutlet UIButton *sendBtn; 14 | 15 | @end 16 | 17 | @implementation LSTTimerDiskVC 18 | 19 | #pragma mark - ***** Controller Life Cycle 控制器生命周期 ***** 20 | 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | 24 | 25 | [self layoutSubViewUI]; 26 | 27 | } 28 | 29 | 30 | 31 | #pragma mark - ***** setupUI 界面布局 ***** 32 | 33 | - (void)layoutSubViewUI { 34 | self.title = @"硬盘倒计时"; 35 | NSInteger timeMS = [LSTTimer getTimeIntervalForIdentifier:@"DISK"]; 36 | if (timeMS>0) { 37 | [self open]; 38 | } 39 | } 40 | 41 | 42 | #pragma mark - ***** Data Request 数据请求 ***** 43 | 44 | 45 | #pragma mark - ***** Other 其他 ***** 46 | 47 | - (IBAction)sendSMSAction:(UIButton *)sender { 48 | if (self.sendBtn.enabled) { 49 | self.sendBtn.enabled = NO; 50 | [self open]; 51 | } 52 | 53 | } 54 | 55 | - (void)open { 56 | 57 | 58 | [LSTTimer addDiskMinuteTimerForTime:20 identifier:@"DISK" handle:^(NSString * _Nonnull day, NSString * _Nonnull hour, NSString * _Nonnull minute, NSString * _Nonnull second, NSString * _Nonnull ms) { 59 | NSString *str = [NSString stringWithFormat:@"(%1d)s",second.intValue]; 60 | [self.sendBtn setTitle:str forState:UIControlStateNormal]; 61 | } finish:^(NSString * _Nonnull identifier) { 62 | self.sendBtn.enabled = YES; 63 | [self.sendBtn setTitle:@"发送验证码" forState:UIControlStateNormal]; 64 | } pause:^(NSString * _Nonnull identifier) { 65 | 66 | }]; 67 | } 68 | 69 | #pragma mark - ***** Lazy Loading 懒加载 ***** 70 | 71 | 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerDiskVC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerListCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerListCell.h 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/17. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface LSTTimerListCell : UITableViewCell 15 | 16 | 17 | /** <#...#> */ 18 | @property (nonatomic, copy) NSString *timeStr; 19 | @property (weak, nonatomic) IBOutlet UILabel *timeLab; 20 | 21 | @end 22 | 23 | NS_ASSUME_NONNULL_END 24 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerListCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerListCell.m 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/17. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTTimerListCell.h" 10 | 11 | @implementation LSTTimerListCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | [self initSubViews]; 16 | } 17 | 18 | #pragma mark - ***** 初始化 ***** 19 | 20 | 21 | #pragma mark - ***** setter 设置器/数据处理 ***** 22 | 23 | - (void)setTimeStr:(NSString *)timeStr { 24 | _timeStr = timeStr; 25 | 26 | 27 | } 28 | 29 | 30 | #pragma mark - ***** setupUI 界面布局 ***** 31 | 32 | - (void)initSubViews { 33 | 34 | // 监听通知 35 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(timerChange) name:@"ListChangeNF" object:nil]; 36 | 37 | } 38 | 39 | - (void)layoutSubviews { 40 | [super layoutSubviews]; 41 | 42 | 43 | } 44 | 45 | #pragma mark - ***** other 其他 ***** 46 | 47 | - (void)timerChange { 48 | 49 | 50 | NSInteger timeMS = [LSTTimer getTimeIntervalForIdentifier:@"listTimer"]; 51 | NSInteger resTimeMS = self.timeStr.integerValue*1000 -timeMS; 52 | NSLog(@"%zd",timeMS); 53 | [LSTTimer formatDateForTime:resTimeMS handle:^(NSString * _Nonnull day, NSString * _Nonnull hour, NSString * _Nonnull minute, NSString * _Nonnull second, NSString * _Nonnull ms) { 54 | self.timeLab.text = [NSString stringWithFormat:@"%@天%@:%@:%@.%@",day,hour,minute,second,ms]; 55 | }]; 56 | 57 | } 58 | 59 | #pragma mark - ***** Lazy Loading 懒加载 ***** 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerListCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerListVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerListVC.h 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/15. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LSTTimerListVC : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerListVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerListVC.m 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/15. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTTimerListVC.h" 10 | #import 11 | #import 12 | #import "LSTTimerListCell.h" 13 | 14 | 15 | @interface LSTTimerListVC () 16 | < 17 | UITableViewDelegate, 18 | UITableViewDataSource 19 | > 20 | /** 表 */ 21 | @property (nonatomic,strong) UITableView *tableView; 22 | 23 | /** 数据源 */ 24 | @property (nonatomic,strong) NSMutableArray *dataMarr; 25 | 26 | 27 | @end 28 | 29 | @implementation LSTTimerListVC 30 | 31 | #pragma mark - ***** Controller Life Cycle 控制器生命周期 ***** 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | 36 | 37 | [self layoutSubViewUI]; 38 | self.title = @"列表倒计时"; 39 | 40 | UIBarButtonItem *rightBarItem = [[UIBarButtonItem alloc] initWithTitle:@"添加数据" style:UIBarButtonItemStylePlain target:self action:@selector(test)]; 41 | self.navigationItem.rightBarButtonItem = rightBarItem; 42 | } 43 | 44 | - (void)test { 45 | [_dataMarr addObject:@"86400"]; 46 | [_dataMarr addObject:@"20002121"]; 47 | [_dataMarr addObject:@"86400"]; 48 | [_dataMarr addObject:@"262121"]; 49 | [_dataMarr addObject:@"96400"]; 50 | [_dataMarr addObject:@"2602121"]; 51 | [self.tableView reloadData]; 52 | } 53 | 54 | - (void)dealloc { 55 | [LSTTimer removeAllTimer]; 56 | } 57 | 58 | 59 | 60 | #pragma mark - ***** setupUI 界面布局 ***** 61 | 62 | - (void)layoutSubViewUI { 63 | 64 | self.view.backgroundColor = UIColor.whiteColor; 65 | 66 | [self.view addSubview:self.tableView]; 67 | 68 | [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { 69 | make.top.equalTo(self.view).offset(LSTNavBarHeight()); 70 | make.left.right.equalTo(self.view); 71 | make.bottom.equalTo(self.view); 72 | }]; 73 | 74 | 75 | 76 | 77 | 78 | 79 | [LSTTimer addTimerForTime:3600 identifier:@"listTimer" handle:nil];//对应LSTTimerSecondChangeNFTypeMS(毫秒api) 80 | // [LSTTimer addMinuteTimerForTime:3600 identifier:@"listTimer" handle:nil];//对应LSTTimerSecondChangeNFTypeSecond(秒api) 81 | //配置通知发送和计时任务绑定 没有配置 就不会有通知发送 82 | [LSTTimer setNotificationForName:@"ListChangeNF" identifier:@"listTimer" changeNFType:LSTTimerSecondChangeNFTypeMS]; 83 | } 84 | 85 | 86 | 87 | #pragma mark - ***** Data Request 数据请求 ***** 88 | 89 | 90 | #pragma mark - ***** Other 其他 ***** 91 | 92 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 93 | return self.dataMarr.count; 94 | } 95 | 96 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 97 | LSTTimerListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 98 | if (!cell) { 99 | cell = [[LSTTimerListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 100 | } 101 | cell.timeStr = self.dataMarr[indexPath.row]; 102 | return cell; 103 | } 104 | 105 | #pragma mark - ***** Lazy Loading 懒加载 ***** 106 | 107 | - (UITableView *)tableView { 108 | if(_tableView) return _tableView; 109 | _tableView = [[UITableView alloc] init]; 110 | _tableView.delegate = self; 111 | _tableView.dataSource = self; 112 | _tableView.rowHeight = 50; 113 | [_tableView registerNib:[UINib nibWithNibName:@"LSTTimerListCell" bundle:nil] forCellReuseIdentifier:@"cell"]; 114 | return _tableView; 115 | } 116 | 117 | - (NSMutableArray *)dataMarr { 118 | if(_dataMarr) return _dataMarr; 119 | _dataMarr = [NSMutableArray array]; 120 | [_dataMarr addObject:@"106400"]; 121 | [_dataMarr addObject:@"4000"]; 122 | return _dataMarr; 123 | } 124 | 125 | 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerRAMVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerRAMVC.h 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/18. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface LSTTimerRAMVC : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerRAMVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerRAMVC.m 3 | // LSTTimer_Example 4 | // 5 | // Created by LoSenTrad on 2020/7/18. 6 | // Copyright © 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTTimerRAMVC.h" 10 | #import 11 | 12 | @interface LSTTimerRAMVC () 13 | @property (weak, nonatomic) IBOutlet UISwitch *removeSW; 14 | @property (weak, nonatomic) IBOutlet UIButton *sendBtn; 15 | 16 | @end 17 | 18 | @implementation LSTTimerRAMVC 19 | 20 | #pragma mark - ***** Controller Life Cycle 控制器生命周期 ***** 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | 25 | 26 | [self layoutSubViewUI]; 27 | 28 | } 29 | 30 | - (void)dealloc { 31 | if (!self.removeSW.on) { 32 | [LSTTimer removeTimerForIdentifier:@"SMS"]; 33 | } 34 | } 35 | 36 | 37 | 38 | #pragma mark - ***** setupUI 界面布局 ***** 39 | 40 | - (void)layoutSubViewUI { 41 | self.title = @"全局内存倒计时"; 42 | 43 | NSInteger timeMS = [LSTTimer getTimeIntervalForIdentifier:@"SMS"]; 44 | if (timeMS>0) { 45 | [self open]; 46 | } 47 | } 48 | 49 | 50 | #pragma mark - ***** Data Request 数据请求 ***** 51 | 52 | 53 | #pragma mark - ***** Other 其他 ***** 54 | 55 | - (IBAction)sendSMSAction:(UIButton *)sender { 56 | 57 | if (self.sendBtn.enabled) { 58 | self.sendBtn.enabled = NO; 59 | [self open]; 60 | } 61 | } 62 | 63 | - (void)open { 64 | [LSTTimer addMinuteTimerForTime:15 identifier:@"SMS" handle:^(NSString * _Nonnull day, NSString * _Nonnull hour, NSString * _Nonnull minute, NSString * _Nonnull second, NSString * _Nonnull ms) { 65 | 66 | NSString *str = [NSString stringWithFormat:@"(%1d)s",second.intValue]; 67 | [self.sendBtn setTitle:str forState:UIControlStateNormal]; 68 | } finish:^(NSString * _Nonnull identifier) { 69 | self.sendBtn.enabled = YES; 70 | [self.sendBtn setTitle:@"发送验证码" forState:UIControlStateNormal]; 71 | } pause:^(NSString * _Nonnull identifier) { 72 | 73 | }]; 74 | } 75 | 76 | 77 | #pragma mark - ***** Lazy Loading 懒加载 ***** 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTTimerRAMVC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTViewController.h 3 | // LSTTimer 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface LSTViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/LSTTimer/LSTViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTViewController.m 3 | // LSTTimer 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | #import "LSTViewController.h" 10 | #import 11 | #import 12 | #import 13 | #import "LSTTimerDemoVC.h" 14 | #import "LSTTimerListVC.h" 15 | #import "LSTTimerRAMVC.h" 16 | #import "LSTTimerDiskVC.h" 17 | 18 | @interface LSTViewController () 19 | < 20 | UITableViewDelegate, 21 | UITableViewDataSource 22 | > 23 | 24 | /** 表 */ 25 | @property (nonatomic,strong) UITableView *tableView; 26 | 27 | @end 28 | 29 | @implementation LSTViewController 30 | 31 | #pragma mark - ***** Controller Life Cycle 控制器生命周期 ***** 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | 36 | 37 | [self layoutSubViewUI]; 38 | 39 | self.title = @"LSTTimer"; 40 | //10000 41 | //1000 --- 55% 42 | //100 --- 47% 43 | //10 --- 8% 44 | for (int i = 0; i<100; i++) { 45 | //一天10秒 = 86410秒 46 | [LSTTimer addTimerForTime:86410 handle:^(NSString * _Nonnull day, NSString * _Nonnull hour, NSString * _Nonnull minute, NSString * _Nonnull second, NSString * _Nonnull ms) { 47 | 48 | }]; 49 | 50 | } 51 | 52 | } 53 | 54 | #pragma mark - ***** setupUI 界面布局 ***** 55 | 56 | - (void)layoutSubViewUI { 57 | 58 | [self.view addSubview:self.tableView]; 59 | 60 | [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { 61 | make.top.mas_equalTo(self.view).offset(LSTNavBarHeight()); 62 | make.right.left.equalTo(self.view); 63 | make.bottom.equalTo(self.view); 64 | }]; 65 | 66 | } 67 | 68 | 69 | 70 | 71 | #pragma mark - ***** Data Request 数据请求 ***** 72 | 73 | 74 | #pragma mark - ***** Other 其他 ***** 75 | 76 | 77 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 78 | return 4; 79 | } 80 | 81 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 82 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 83 | if (!cell) { 84 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 85 | } 86 | switch (indexPath.row) { 87 | case 0: 88 | { 89 | cell.textLabel.text = @"倒计时示例"; 90 | } 91 | break; 92 | case 1: 93 | { 94 | cell.textLabel.text = @"列表倒计时"; 95 | } 96 | break; 97 | case 2: 98 | { 99 | cell.textLabel.text = @"全局内存倒计时"; 100 | } 101 | break; 102 | case 3: 103 | { 104 | cell.textLabel.text = @"持久化倒计时(硬盘计时)"; 105 | } 106 | break; 107 | default: 108 | break; 109 | } 110 | return cell; 111 | } 112 | 113 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 114 | 115 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 116 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 117 | }); 118 | 119 | if (indexPath.row == 0) { 120 | LSTTimerDemoVC *xibVC = [[LSTTimerDemoVC alloc] initWithNibName:@"LSTTimerDemoVC" bundle:nil]; 121 | [self.navigationController pushViewController:xibVC animated:YES]; 122 | } 123 | 124 | if (indexPath.row == 1) { 125 | LSTTimerListVC *xibVC = [[LSTTimerListVC alloc] init]; 126 | [self.navigationController pushViewController:xibVC animated:YES]; 127 | } 128 | 129 | if (indexPath.row == 2) { 130 | LSTTimerRAMVC *xibVC = [[LSTTimerRAMVC alloc] initWithNibName:@"LSTTimerRAMVC" bundle:nil]; 131 | [self.navigationController pushViewController:xibVC animated:YES]; 132 | } 133 | 134 | if (indexPath.row == 3) { 135 | LSTTimerDiskVC *xibVC = [[LSTTimerDiskVC alloc] initWithNibName:@"LSTTimerDiskVC" bundle:nil]; 136 | [self.navigationController pushViewController:xibVC animated:YES]; 137 | } 138 | } 139 | 140 | #pragma mark - ***** Lazy Loading 懒加载 ***** 141 | 142 | - (UITableView *)tableView { 143 | if(_tableView) return _tableView; 144 | _tableView = [[UITableView alloc] init]; 145 | _tableView.delegate = self; 146 | _tableView.dataSource = self; 147 | _tableView.rowHeight = 44; 148 | [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; 149 | return _tableView; 150 | } 151 | 152 | 153 | @end 154 | -------------------------------------------------------------------------------- /Example/LSTTimer/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/LSTTimer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LSTTimer 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "LSTAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LSTAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | 2 | platform :ios, '8.0' 3 | 4 | target 'LSTTimer_Example' do 5 | pod 'LSTTimer', :path => '../' 6 | pod 'Masonry' 7 | pod 'LSTCategory/UIView+LSTView' 8 | pod 'LSTCategory/NSString+LSTString' 9 | pod 'LSTCategory/UIColor+LSTColor' 10 | pod 'LSTCategory/UIView+LSTView' 11 | pod 'LSTCategory/LSTGestureEvents' 12 | pod 'LSTCategory/LSTControlEvents' 13 | 14 | target 'LSTTimer_Tests' do 15 | inherit! :search_paths 16 | 17 | 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - LSTCategory/LSTControlEvents (0.2.04281546) 3 | - LSTCategory/LSTGestureEvents (0.2.04281546) 4 | - "LSTCategory/NSString+LSTString (0.2.04281546)" 5 | - "LSTCategory/UIColor+LSTColor (0.2.04281546)" 6 | - "LSTCategory/UIView+LSTView (0.2.04281546)" 7 | - LSTTimer (0.1.0) 8 | - Masonry (1.1.0) 9 | 10 | DEPENDENCIES: 11 | - LSTCategory/LSTControlEvents 12 | - LSTCategory/LSTGestureEvents 13 | - "LSTCategory/NSString+LSTString" 14 | - "LSTCategory/UIColor+LSTColor" 15 | - "LSTCategory/UIView+LSTView" 16 | - LSTTimer (from `../`) 17 | - Masonry 18 | 19 | SPEC REPOS: 20 | trunk: 21 | - LSTCategory 22 | - Masonry 23 | 24 | EXTERNAL SOURCES: 25 | LSTTimer: 26 | :path: "../" 27 | 28 | SPEC CHECKSUMS: 29 | LSTCategory: f70d240021080d1c4ab555b6129e74f5b0aa4ccb 30 | LSTTimer: cb673c594302e967f517d05e0d6b50ab6a2f2dd7 31 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 32 | 33 | PODFILE CHECKSUM: 935b1c300a60b6e748fce654190494650cd4f919 34 | 35 | COCOAPODS: 1.9.1 36 | -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTCategory/LSTControlEvents.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/LSTControlEvents/LSTControlEvents.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTCategory/LSTGestureEvents.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/LSTGestureEvents/LSTGestureEvents.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTCategory/NSString+LSTString.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/NSString+LSTString/NSString+LSTString.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTCategory/UIColor+LSTColor.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/UIColor+LSTColor/UIColor+LSTColor.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTCategory/UIView+LSTView.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/UIView+LSTView/UIView+LSTView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/LSTTimer/LSTTimer.h: -------------------------------------------------------------------------------- 1 | ../../../../../LSTTimer/Classes/LSTTimer.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Private/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTCategory/LSTControlEvents.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/LSTControlEvents/LSTControlEvents.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTCategory/LSTGestureEvents.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/LSTGestureEvents/LSTGestureEvents.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTCategory/NSString+LSTString.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/NSString+LSTString/NSString+LSTString.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTCategory/UIColor+LSTColor.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/UIColor+LSTColor/UIColor+LSTColor.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTCategory/UIView+LSTView.h: -------------------------------------------------------------------------------- 1 | ../../../LSTCategory/LSTCategory/Classes/Code/UIView+LSTView/UIView+LSTView.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/LSTTimer/LSTTimer.h: -------------------------------------------------------------------------------- 1 | ../../../../../LSTTimer/Classes/LSTTimer.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASCompositeConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint+Private.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASConstraintMaker.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASLayoutConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASUtilities.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewAttribute.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/MASViewConstraint.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/Masonry.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSArray+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/View+MASShorthandAdditions.h -------------------------------------------------------------------------------- /Example/Pods/Headers/Public/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | ../../../Masonry/Masonry/ViewController+MASAdditions.h -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019 LoSenTrad 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 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/LSTControlEvents/LSTControlEvents.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTControlEvents.h 3 | // LSTButton 4 | // 5 | // Created by LoSenTrad on 2019/12/31. 6 | // 7 | 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIControl (LSTControlEvents) 14 | 15 | /** 添加事件 */ 16 | - (void)addControlEvents:(UIControlEvents)controlEvents withAction:(void(^)(id sender))action; 17 | 18 | /** 移除事件 */ 19 | - (void)removeControlEvents:(UIControlEvents)controlEvents; 20 | 21 | /** 添加事件 for key */ 22 | - (void)addControlEvents:(UIControlEvents)controlEvents withAction:(void(^)(id sender))action forKey:(NSString *)key; 23 | 24 | /** 移除事件 for key */ 25 | - (void)removeControlEvents:(UIControlEvents)controlEvents forKey:(NSString *)key; 26 | 27 | /** 添加点击事件 UIControlEventTouchUpInside */ 28 | - (void)addEventTouchUpInsideAction:(void(^)(id sender))action; 29 | 30 | /** 移除点击事件 UIControlEventTouchUpInside*/ 31 | - (void)removeEventTouchUpInsideAction; 32 | 33 | /** 移除全部事件 */ 34 | - (void)removeAllActions; 35 | 36 | 37 | @end 38 | 39 | NS_ASSUME_NONNULL_END 40 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/LSTControlEvents/LSTControlEvents.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTControlEvents.m 3 | // LSTButton 4 | // 5 | // Created by LoSenTrad on 2019/12/31. 6 | // 7 | 8 | #import "LSTControlEvents.h" 9 | 10 | #import 11 | 12 | @implementation UIControl (LSTControlEvents) 13 | 14 | - (NSMutableDictionary *)actions { 15 | return objc_getAssociatedObject(self, @"chance_UIControl_Events_actions"); 16 | } 17 | - (void)setActions:(NSMutableDictionary *)actions { 18 | objc_setAssociatedObject(self, @"chance_UIControl_Events_actions", actions, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 19 | } 20 | 21 | - (void)addControlEvents:(UIControlEvents)controlEvents withAction:(void(^)(id sender))action { 22 | [self addControlEvents:controlEvents withAction:action forKey:nil]; 23 | } 24 | - (void)removeControlEvents:(UIControlEvents)controlEvents { 25 | [self.actions removeObjectForKey:@(controlEvents)]; 26 | } 27 | 28 | - (void)addControlEvents:(UIControlEvents)controlEvents withAction:(void(^)(id sender))action forKey:(NSString *)key { 29 | if (!self.actions) { 30 | self.actions = [NSMutableDictionary dictionary]; 31 | } 32 | 33 | NSMutableDictionary *dict = [self.actions objectForKey:@(controlEvents)] ?: [NSMutableDictionary dictionary]; 34 | 35 | if (!key || [key isEqualToString:@""]) { 36 | key = [NSString stringWithFormat:@"%ld", (long)dict.count]; 37 | } 38 | [dict setObject:action forKey:key]; 39 | [self.actions setObject:dict forKey:@(controlEvents)]; 40 | 41 | SEL selector = [self functionName:controlEvents]; 42 | [self addTarget:self action:selector forControlEvents:controlEvents]; 43 | } 44 | - (void)removeControlEvents:(UIControlEvents)controlEvents forKey:(NSString *)key { 45 | NSMutableDictionary *dict = [self.actions objectForKey:@(controlEvents)]; 46 | if (key && ![key isEqualToString:@""]) { 47 | [dict removeObjectForKey:key]; 48 | } 49 | } 50 | 51 | - (void)addEventTouchUpInsideAction:(void (^)(id sender))action { 52 | [self addControlEvents:UIControlEventTouchUpInside withAction:action forKey:@"__addAction:"]; 53 | } 54 | - (void)removeEventTouchUpInsideAction { 55 | [self removeControlEvents:UIControlEventTouchUpInside forKey:@"__addAction:"]; 56 | } 57 | 58 | - (void)removeAllActions { 59 | [self.actions removeAllObjects]; 60 | } 61 | 62 | #pragma mark - GET SEL 63 | - (SEL)functionName:(UIControlEvents)controlEvents { 64 | switch (controlEvents) { 65 | case UIControlEventTouchDown: return @selector(controlEventTouchDownAction); 66 | case UIControlEventTouchDownRepeat: return @selector(controlEventTouchDownRepeatAction); 67 | case UIControlEventTouchDragInside: return @selector(controlEventTouchDragInsideAction); 68 | case UIControlEventTouchDragOutside: return @selector(controlEventTouchDragOutsideAction); 69 | case UIControlEventTouchDragEnter: return @selector(controlEventTouchDragEnterAction); 70 | case UIControlEventTouchDragExit: return @selector(controlEventTouchDragExitAction); 71 | case UIControlEventTouchUpInside: return @selector(controlEventTouchUpInsideAction); 72 | case UIControlEventTouchUpOutside: return @selector(controlEventTouchUpOutsideAction); 73 | case UIControlEventTouchCancel: return @selector(controlEventTouchCancelAction); 74 | case UIControlEventValueChanged: return @selector(controlEventValueChangedAction); 75 | case UIControlEventEditingDidBegin: return @selector(controlEventEditingDidBeginAction); 76 | case UIControlEventEditingChanged: return @selector(controlEventEditingChangedAction); 77 | case UIControlEventEditingDidEnd: return @selector(controlEventEditingDidEndAction); 78 | case UIControlEventEditingDidEndOnExit: return @selector(controlEventEditingDidEndOnExitAction); 79 | case UIControlEventAllTouchEvents: return @selector(controlEventAllTouchEventsAction); 80 | case UIControlEventAllEditingEvents: return @selector(controlEventAllEditingEventsAction); 81 | case UIControlEventApplicationReserved: return @selector(controlEventApplicationReservedAction); 82 | case UIControlEventSystemReserved: return @selector(controlEventSystemReservedAction); 83 | case UIControlEventAllEvents: return @selector(controlEventAllEventsAction); 84 | default: return NULL; 85 | } 86 | } 87 | 88 | #pragma mark - Events 89 | - (void)controlEventTouchDownAction {[self execFunctionWithControlEvents:UIControlEventTouchDown];} 90 | - (void)controlEventTouchDownRepeatAction {[self execFunctionWithControlEvents:UIControlEventTouchDownRepeat];} 91 | - (void)controlEventTouchDragInsideAction {[self execFunctionWithControlEvents:UIControlEventTouchDragInside];} 92 | - (void)controlEventTouchDragOutsideAction {[self execFunctionWithControlEvents:UIControlEventTouchDragOutside];} 93 | - (void)controlEventTouchDragEnterAction {[self execFunctionWithControlEvents:UIControlEventTouchDragEnter];} 94 | - (void)controlEventTouchDragExitAction {[self execFunctionWithControlEvents:UIControlEventTouchDragExit];} 95 | - (void)controlEventTouchUpInsideAction {[self execFunctionWithControlEvents:UIControlEventTouchUpInside];} 96 | - (void)controlEventTouchUpOutsideAction {[self execFunctionWithControlEvents:UIControlEventTouchUpOutside];} 97 | - (void)controlEventTouchCancelAction {[self execFunctionWithControlEvents:UIControlEventTouchCancel];} 98 | - (void)controlEventValueChangedAction {[self execFunctionWithControlEvents:UIControlEventValueChanged];} 99 | - (void)controlEventEditingDidBeginAction {[self execFunctionWithControlEvents:UIControlEventEditingDidBegin];} 100 | - (void)controlEventEditingChangedAction {[self execFunctionWithControlEvents:UIControlEventEditingChanged];} 101 | - (void)controlEventEditingDidEndAction {[self execFunctionWithControlEvents:UIControlEventEditingDidEnd];} 102 | - (void)controlEventEditingDidEndOnExitAction {[self execFunctionWithControlEvents:UIControlEventEditingDidEndOnExit];} 103 | - (void)controlEventAllTouchEventsAction {[self execFunctionWithControlEvents:UIControlEventAllTouchEvents];} 104 | - (void)controlEventAllEditingEventsAction {[self execFunctionWithControlEvents:UIControlEventAllEditingEvents];} 105 | - (void)controlEventApplicationReservedAction {[self execFunctionWithControlEvents:UIControlEventApplicationReserved];} 106 | - (void)controlEventSystemReservedAction {[self execFunctionWithControlEvents:UIControlEventSystemReserved];} 107 | - (void)controlEventAllEventsAction {[self execFunctionWithControlEvents:UIControlEventAllEvents];} 108 | 109 | #pragma mark - Execute 110 | - (void)execFunctionWithControlEvents:(UIControlEvents)controlEvents { 111 | NSMutableDictionary *dict = [self.actions objectForKey:@(controlEvents)]; 112 | for (void(^block)(id sender) in [dict allValues]) { 113 | if (block) { 114 | block(self); 115 | } 116 | } 117 | } 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/LSTGestureEvents/LSTGestureEvents.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTGestureEvents.h 3 | // LSTButton 4 | // 5 | // Created by LoSenTrad on 2019/12/31. 6 | // 7 | 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface UIView (LSTGestureEvents) 14 | 15 | 16 | #pragma mark - ***** SEL事件绑定模式 ***** 17 | 18 | /** 添加tap手势 target:事件目标 action:事件 return:返回tap事件 */ 19 | - (UITapGestureRecognizer *)addTapGestureTarget:(id)target action:(SEL)action; 20 | 21 | /** 添加Pan手势事件 target: 事件目标 action: 事件 return: 返回pan手势 */ 22 | - (UIPanGestureRecognizer *)addPanGestureTarget:(id)target action:(SEL)action; 23 | 24 | /** 添加Pinch手势事件 target: 事件目标 action: 事件 return 返回Pinch手势 */ 25 | - (UIPinchGestureRecognizer *)addPinchGestureTarget:(id)target action:(SEL)action; 26 | 27 | /** 添加LongPress手势事件 target: 事件目标 action: 事件 return: 返回LongPress手势 */ 28 | - (UILongPressGestureRecognizer *)addLongPressGestureTarget:(id)target action:(SEL)action; 29 | 30 | /** 添加Swipe手势事件 target: 事件目标 action: 事件 return: 返回Swipe手势*/ 31 | - (UISwipeGestureRecognizer *)addSwipeGestureTarget:(id)target action:(SEL)action; 32 | 33 | /** 添加Rotation手势事件 target: 事件目标 action: 事件 return: 返回Rotation手势*/ 34 | - (UIRotationGestureRecognizer *)addRotationGestureTarget:(id)target action:(SEL)action; 35 | 36 | /** 添加ScreenEdgePan手势事件 target: 事件目标 action: 事件 return: 返回ScreenEdgePan手势 */ 37 | - (UIScreenEdgePanGestureRecognizer *)addScreenEdgePanGestureTarget:(id)target action:(SEL)action; 38 | 39 | 40 | 41 | #pragma mark - ***** Block绑定模式 ***** 42 | 43 | /** 添加Tap手势block事件 event: block事件 return: 返回Tap手势 */ 44 | - (UITapGestureRecognizer *)addTapGestureEventHandle:(void (^)(id sender, UITapGestureRecognizer *gestureRecognizer))event; 45 | 46 | /** 添加Pan手势block事件 event: block事件 return: 返回Pan手势 */ 47 | - (UIPanGestureRecognizer *)addPanGestureEventHandle:(void (^)(id sender, UIPanGestureRecognizer *gestureRecognizer))event; 48 | 49 | /**添加Pinch手势block事件 event: block事件 return: 返回Pinch手势 */ 50 | - (UIPinchGestureRecognizer *)addPinchGestureEventHandle:(void (^)(id sender, UIPinchGestureRecognizer *gestureRecognizer))event; 51 | 52 | /** 添加LongPress手势block事件 event: block事件 return: 返回LongPress手势 */ 53 | - (UILongPressGestureRecognizer *)addLongPressGestureEventHandle:(void (^)(id sender, UILongPressGestureRecognizer *gestureRecognizer))event; 54 | 55 | /** 添加Swipe手势block事件 event: block事件 return: 返回Swipe手势*/ 56 | - (UISwipeGestureRecognizer *)addSwipeGestureEventHandle:(void (^)(id sender, UISwipeGestureRecognizer *gestureRecognizer))event; 57 | 58 | /**添加Rotation手势block事件 event: block事件 return: 返回Rotation手势*/ 59 | - (UIRotationGestureRecognizer *)addRotationGestureEventHandle:(void (^)(id sender, UIRotationGestureRecognizer *gestureRecognizer))event; 60 | 61 | /**添加ScreenEdgePan手势block事件 event: block事件 return: 返回ScreenEdgePan手势*/ 62 | - (UIScreenEdgePanGestureRecognizer *)addScreenEdgePanGestureEventHandle:(void (^)(id sender, UIScreenEdgePanGestureRecognizer *gestureRecognizer))event; 63 | 64 | 65 | 66 | 67 | @end 68 | 69 | NS_ASSUME_NONNULL_END 70 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/LSTGestureEvents/LSTGestureEvents.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTGestureEvents.m 3 | // LSTButton 4 | // 5 | // Created by LoSenTrad on 2019/12/31. 6 | // 7 | 8 | #import "LSTGestureEvents.h" 9 | #import 10 | 11 | @implementation UIView (LSTGestureEvents) 12 | 13 | - (NSMutableDictionary *)gestureBlocks { 14 | id obj = objc_getAssociatedObject(self, _cmd); 15 | if (!obj) { 16 | obj = [NSMutableDictionary dictionary]; 17 | objc_setAssociatedObject(self, @selector(gestureBlocks), obj, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 18 | } 19 | return obj; 20 | } 21 | 22 | 23 | 24 | #pragma mark - ***** Block绑定模式 ***** 25 | 26 | - (id)addGestureTarget:(id)target action:(SEL)action gestureClass:(Class)class { 27 | UIGestureRecognizer *gesture = [[class alloc] initWithTarget:target action:action]; 28 | [self addGestureRecognizer:gesture]; 29 | return gesture; 30 | } 31 | 32 | - (UITapGestureRecognizer *)addTapGestureTarget:(id)target action:(SEL)action { 33 | return [self addGestureTarget:target action:action gestureClass:[UITapGestureRecognizer class]]; 34 | } 35 | 36 | - (UIPanGestureRecognizer *)addPanGestureTarget:(id)target action:(SEL)action { 37 | return [self addGestureTarget:target action:action gestureClass:[UIPanGestureRecognizer class]]; 38 | } 39 | 40 | - (UIPinchGestureRecognizer *)addPinchGestureTarget:(id)target action:(SEL)action { 41 | return [self addGestureTarget:target action:action gestureClass:[UIPinchGestureRecognizer class]]; 42 | } 43 | 44 | - (UILongPressGestureRecognizer *)addLongPressGestureTarget:(id)target action:(SEL)action { 45 | return [self addGestureTarget:target action:action gestureClass:[UILongPressGestureRecognizer class]]; 46 | } 47 | 48 | - (UISwipeGestureRecognizer *)addSwipeGestureTarget:(id)target action:(SEL)action { 49 | return [self addGestureTarget:target action:action gestureClass:[UISwipeGestureRecognizer class]]; 50 | } 51 | 52 | - (UIRotationGestureRecognizer *)addRotationGestureTarget:(id)target action:(SEL)action { 53 | return [self addGestureTarget:target action:action gestureClass:[UIRotationGestureRecognizer class]]; 54 | } 55 | 56 | - (UIScreenEdgePanGestureRecognizer *)addScreenEdgePanGestureTarget:(id)target action:(SEL)action { 57 | return [self addGestureTarget:target action:action gestureClass:[UIScreenEdgePanGestureRecognizer class]]; 58 | } 59 | 60 | 61 | 62 | #pragma mark - ***** Block绑定模式 ***** 63 | 64 | - (id)addGestureEventHandle:(void (^)(id, id))event gestureClass:(Class)class { 65 | UIGestureRecognizer *gesture = [[class alloc] initWithTarget:self action:@selector(handleGestureRecognizer:)]; 66 | [self addGestureRecognizer:gesture]; 67 | if (event) { 68 | [[self gestureBlocks] setObject:event forKey:NSStringFromClass(class)]; 69 | } 70 | return gesture; 71 | } 72 | 73 | - (UITapGestureRecognizer *)addTapGestureEventHandle:(void (^)(id sender, UITapGestureRecognizer *recognizer))event { 74 | return [self addGestureEventHandle:event gestureClass:[UITapGestureRecognizer class]]; 75 | } 76 | 77 | - (UIPanGestureRecognizer *)addPanGestureEventHandle:(void (^)(id sender, UIPanGestureRecognizer *recognizer))event { 78 | return [self addGestureEventHandle:event gestureClass:[UIPanGestureRecognizer class]]; 79 | } 80 | 81 | - (UIPinchGestureRecognizer *)addPinchGestureEventHandle:(void (^)(id sender, UIPinchGestureRecognizer *recognizer))event { 82 | return [self addGestureEventHandle:event gestureClass:[UIPinchGestureRecognizer class]]; 83 | } 84 | 85 | - (UILongPressGestureRecognizer *)addLongPressGestureEventHandle:(void (^)(id sender, UILongPressGestureRecognizer *recognizer))event { 86 | return [self addGestureEventHandle:event gestureClass:[UILongPressGestureRecognizer class]]; 87 | } 88 | 89 | - (UISwipeGestureRecognizer *)addSwipeGestureEventHandle:(void (^)(id sender, UISwipeGestureRecognizer *recognizer))event { 90 | return [self addGestureEventHandle:event gestureClass:[UISwipeGestureRecognizer class]]; 91 | } 92 | 93 | - (UIRotationGestureRecognizer *)addRotationGestureEventHandle:(void (^)(id sender, UIRotationGestureRecognizer *recognizer))event { 94 | return [self addGestureEventHandle:event gestureClass:[UIRotationGestureRecognizer class]]; 95 | } 96 | 97 | - (UIScreenEdgePanGestureRecognizer *)addScreenEdgePanGestureEventHandle:(void (^)(id sender, UIScreenEdgePanGestureRecognizer *recognizer))event { 98 | return [self addGestureEventHandle:event gestureClass:[UIScreenEdgePanGestureRecognizer class]]; 99 | } 100 | 101 | 102 | - (void)handleGestureRecognizer:(UIGestureRecognizer *)gesture { 103 | NSString *key = NSStringFromClass(gesture.class); 104 | void (^block)(id sender, UIGestureRecognizer *tap) = [self gestureBlocks][key]; 105 | block ? block(self, gesture) : nil; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/NSString+LSTString/NSString+LSTString.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+LSTString.h 3 | // DYwttai 4 | // 5 | // Created by LoSenTrad on 2017/7/11. 6 | // Copyright © 2017年 dongyu. All rights reserved. 7 | // 0.1.12231756 8 | 9 | #import 10 | #import 11 | 12 | 13 | @interface NSString (LSTString) 14 | 15 | NS_ASSUME_NONNULL_BEGIN 16 | 17 | /** base64编码 */ 18 | - (NSString *)base64Encode; 19 | /** base64解码 */ 20 | - (NSString *)base64DecodeString; 21 | 22 | //判断是不是符合的手机号码 23 | + (NSString *)valiMobile:(NSString *)mobile; 24 | //检测是否是邮箱 25 | - (BOOL)validateEmail; 26 | /** 验证是否是手机号码 */ 27 | - (BOOL)validatePhoneNumber; 28 | 29 | //判断字符串是不是全部是空格 30 | + (BOOL)isEmpty:(NSString *)str; 31 | //获取url的key对应的值 32 | + (NSString *)paramValueOfUrl:(NSString *)url withParam:(NSString *) param; 33 | //比较app版本号 34 | + (BOOL)compareAppVersion:(NSString *)NewVersion withOldVersion:(NSString *)oldVersion; 35 | /** md5 一般加密 */ 36 | - (NSString *)md5String; 37 | /** 字符串转大写 */ 38 | + (NSString *)uppercaseString:(NSString *)str; 39 | /** 字符串转小写 */ 40 | + (NSString *)lowercaseString:(NSString *)str; 41 | /** 判断字符串是否为空 */ 42 | - (BOOL)isBlankString; 43 | /** 判断字符串中是否包含某字符串 */ 44 | - (BOOL)lst_containsString:(NSString *)subString; 45 | /** 判断字符串是包含数字和字母 */ 46 | - (BOOL)containsOnlyNumbersAndLetters; 47 | /** 字符串转数组 @param separator 分隔符 */ 48 | - (NSArray *)stringToArrayWithSeparator:(NSString *)separator; 49 | /** 50 | * 截取字符串 51 | * @param location 从第几位开始 52 | * @param length 截取多少位 53 | */ 54 | - (NSString *)cutString:(NSUInteger)location cutLength:(NSUInteger)length; 55 | /** 获取当前时间戳 */ 56 | + (nonnull NSString *)getTimeStamp; 57 | /** string类型转URL类型 */ 58 | 59 | - (nonnull NSURL *)stringToURL; 60 | /** 根据字符串获取宽度 (不适合富文本)(修改标记) */ 61 | - (CGFloat)getWidthWithFont:(UIFont *)font; 62 | /** 根据字符串获取高度(不适合富文本) */ 63 | - (CGFloat)getHeightWithFont:(UIFont *)font andWidth:(CGFloat)width; 64 | 65 | #pragma mark - ***** 获取系统信息 ***** 66 | /** 获取app版本号 */ 67 | + (NSString *_Nullable)lst_loadAppVersion; 68 | /** 获取系统版本 */ 69 | + (float)lst_loadSystemVersion; 70 | /** 获取手机型号 */ 71 | + (NSString *)lst_loadDeviceModel; 72 | /** 获取app唯一标识 */ 73 | + (NSString*)lst_loadBundleID; 74 | 75 | - (CGSize)heightWithFont:(UIFont *)font MaxWidth:(float)width; 76 | /** 通过名字读取uiimage */ 77 | - (UIImage *)getImage; 78 | 79 | @end 80 | 81 | @interface NSString (AttributedString) 82 | 83 | -(CGFloat)HeightParagraphSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font AndWidth:(CGFloat)width; 84 | 85 | 86 | @end 87 | 88 | NS_ASSUME_NONNULL_END 89 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/UIColor+LSTColor/UIColor+LSTColor.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+LSTColors.h 3 | // DYwttai 4 | // 5 | // Created by LoSenTrad on 2017/3/21. 6 | // Copyright © 2017年 dongyu. All rights reserved. 7 | // 8 | 9 | #import "TargetConditionals.h" 10 | 11 | #if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR 12 | #import 13 | #define LSTColor UIColor 14 | #else 15 | #import 16 | #define LSTColor NSColor 17 | #endif 18 | 19 | @interface LSTColor (LSTColor) 20 | 21 | #pragma mark - ***** 十六进制和RGB颜色获取 ***** 22 | 23 | /** 24 | Creates a UIColor or NSColor from a HexString like #fff, #ffff, #ff00aa or #ff00aaee. 25 | With complete support for short hand hex values, short hand with short alpha value, full 26 | hex values and full hex values with alpha. To include alpha with the hex string append the values 27 | at the end of the string. 28 | 29 | @param hexString NSString hex string for color generation 30 | @return UIColor / NSColor or nil 31 | */ 32 | + (nullable LSTColor *)lst_ColorWithString:(nonnull NSString *)hexString; 33 | 34 | /** 35 | Same implementation as hx_colorWithHexRGBAString but you can hand in a normal alpha value from 0 to 1 36 | 37 | @param hexString NSString hex string for color generation 38 | @param alpha CGFloat from 0 to 1 39 | @return UIColor / NSColor or nil 40 | */ 41 | + (nullable LSTColor *)lst_ColorWithString:(nonnull NSString *)hexString alpha:(CGFloat)alpha; 42 | 43 | /** 44 | Don't like to devide by 255 to get a value between 0 to 1 for creating a color? This helps you create 45 | a UIColor without the hassle, which leads to cleaner code 46 | 47 | @param red NSInteger hand in a value for red between 0 and 255 48 | @param green NSInteger hand in a value for green between 0 and 255 49 | @param blue NSInteger hand in a value for blue between 0 and 255 50 | @return UIColor / NSColor 51 | */ 52 | + (nonnull LSTColor *)lst_ColorWith8BitRed:(NSInteger)red 53 | green:(NSInteger)green 54 | blue:(NSInteger)blue; 55 | 56 | /** 57 | Same implementation as hx_colorWith8BitRed:green:blue but you can hand in a normal alpha value from 0 to 1 58 | 59 | @param red NSInteger hand in a value for red between 0 and 255 60 | @param green NSInteger hand in a value for green between 0 and 255 61 | @param blue NSInteger hand in a value for blue between 0 and 255 62 | @param alpha CGFloat from 0 to 1 63 | @return UIColor / NSColor 64 | */ 65 | + (nonnull LSTColor *)lst_ColorWith8BitRed:(NSInteger)red 66 | green:(NSInteger)green 67 | blue:(NSInteger)blue 68 | alpha:(CGFloat)alpha; 69 | 70 | #pragma mark - ***** 常用颜色 ***** 71 | 72 | /** 73 | 返回系统cell的分割线的颜色 74 | */ 75 | + (nonnull LSTColor *)lst_CellSeparatorColor; 76 | 77 | /** 以下为C语言 语法快捷调用颜色设置 **/ 78 | 79 | /** rbg颜色 */ 80 | UIColor * _Nullable LSTRGBColor(NSInteger r,NSInteger g,NSInteger b); 81 | /** rbg颜色 带alpha */ 82 | UIColor * _Nullable LSTRGBColorWithAlpha(NSInteger r,NSInteger g,NSInteger b,CGFloat alpha); 83 | /** 十六进制颜色 */ 84 | UIColor * _Nullable LSTHexColor(NSString * _Nullable hexString); 85 | /** 十六进制颜色 带alpha */ 86 | UIColor * _Nullable LSTHexColorWithAlpha(NSString * _Nullable hexString,CGFloat alpha); 87 | 88 | 89 | @end 90 | 91 | 92 | @interface NSString (lst_StringTansformer) 93 | 94 | /** 95 | 检查十六进制字符串比如#fff,并给转化成十六进制字符串,比如#ffffff 96 | 97 | @return 返回标准的7位十六进制字符串或者初始化一个字符串为十六进制字符串 98 | */ 99 | - (nonnull NSString *)lst_HexStringTransformFromThreeCharacters; 100 | 101 | @end 102 | 103 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/UIColor+LSTColor/UIColor+LSTColor.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+LSTColors.m 3 | // DYwttai 4 | // 5 | // Created by LoSenTrad on 2017/3/21. 6 | // Copyright © 2017年 dongyu. All rights reserved. 7 | // 8 | 9 | #import "UIColor+LSTColor.h" 10 | 11 | 12 | 13 | @implementation LSTColor (LSTColor) 14 | 15 | 16 | + (LSTColor *)lst_ColorWithString:(NSString *)hexString 17 | { 18 | return [[self class] lst_ColorWithString:hexString alpha:1.0]; 19 | } 20 | 21 | + (LSTColor *)lst_ColorWithString:(NSString *)hexString alpha:(CGFloat)alpha 22 | { 23 | // We found an empty string, we are returning nothing 24 | if (hexString.length == 0) { 25 | return nil; 26 | } 27 | 28 | // Check for hash and add the missing hash 29 | if('#' != [hexString characterAtIndex:0]) { 30 | hexString = [NSString stringWithFormat:@"#%@", hexString]; 31 | } 32 | 33 | // returning no object on wrong alpha values 34 | NSArray *validHexStringLengths = @[@4, @5, @7, @9]; 35 | NSNumber *hexStringLengthNumber = [NSNumber numberWithUnsignedInteger:hexString.length]; 36 | if ([validHexStringLengths indexOfObject:hexStringLengthNumber] == NSNotFound) { 37 | return nil; 38 | } 39 | 40 | // if the hex string is 5 or 9 we are ignoring the alpha value and we are using the value from the hex string instead 41 | CGFloat handedInAlpha = alpha; 42 | if (5 == hexString.length || 9 == hexString.length) { 43 | NSString *alphaHex; 44 | if (5 == hexString.length) { 45 | alphaHex = [hexString substringWithRange:NSMakeRange(4, 1)]; 46 | } else { 47 | alphaHex = [hexString substringWithRange:NSMakeRange(7, 2)]; 48 | } 49 | if (1 == alphaHex.length) alphaHex = [NSString stringWithFormat:@"%@%@", alphaHex, alphaHex]; 50 | //hexString = [NSString stringWithFormat:@"#%@", [hexString substringFromIndex:9 == hexString.length ? 7 : 3]]; 51 | hexString = [NSString stringWithFormat:@"#%@", [hexString substringWithRange:NSMakeRange(1, 9 == hexString.length ? 6 : 3)]]; 52 | unsigned alpha_u = [[self class] lst_HexValueToUnsigned:alphaHex]; 53 | handedInAlpha = ((CGFloat) alpha_u) / 255.0; 54 | } 55 | 56 | // check for 3 character HexStrings 57 | hexString = [hexString lst_HexStringTransformFromThreeCharacters]; 58 | 59 | NSString *redHex = [NSString stringWithFormat:@"0x%@", [hexString substringWithRange:NSMakeRange(1, 2)]]; 60 | unsigned redInt = [[self class] lst_HexValueToUnsigned:redHex]; 61 | 62 | NSString *greenHex = [NSString stringWithFormat:@"0x%@", [hexString substringWithRange:NSMakeRange(3, 2)]]; 63 | unsigned greenInt = [[self class] lst_HexValueToUnsigned:greenHex]; 64 | 65 | NSString *blueHex = [NSString stringWithFormat:@"0x%@", [hexString substringWithRange:NSMakeRange(5, 2)]]; 66 | unsigned blueInt = [[self class] lst_HexValueToUnsigned:blueHex]; 67 | 68 | LSTColor *color = [LSTColor lst_ColorWith8BitRed:redInt green:greenInt blue:blueInt alpha:handedInAlpha]; 69 | 70 | return color; 71 | } 72 | 73 | + (LSTColor *)lst_ColorWith8BitRed:(NSInteger)red 74 | green:(NSInteger)green 75 | blue:(NSInteger)blue { 76 | return [[self class] lst_ColorWith8BitRed:red green:green blue:blue alpha:1.0]; 77 | } 78 | 79 | + (LSTColor *)lst_ColorWith8BitRed:(NSInteger)red 80 | green:(NSInteger)green 81 | blue:(NSInteger)blue 82 | alpha:(CGFloat)alpha { 83 | LSTColor *color = nil; 84 | #if (TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE) 85 | color = [LSTColor colorWithRed:(float)red/255 green:(float)green/255 blue:(float)blue/255 alpha:alpha]; 86 | #else 87 | color = [LSTColor colorWithCalibratedRed:(float)red/255 green:(float)green/255 blue:(float)blue/255 alpha:alpha]; 88 | #endif 89 | 90 | return color; 91 | } 92 | 93 | + (unsigned)lst_HexValueToUnsigned:(NSString *)hexValue 94 | { 95 | unsigned value = 0; 96 | 97 | NSScanner *hexValueScanner = [NSScanner scannerWithString:hexValue]; 98 | [hexValueScanner scanHexInt:&value]; 99 | 100 | return value; 101 | } 102 | 103 | #pragma mark - ***** 常用颜色 ***** 104 | 105 | /** 106 | 返回系统cell的分割线的颜色 107 | */ 108 | + (nonnull LSTColor *)lst_CellSeparatorColor { 109 | return [self lst_ColorWithString:@"cccccc" alpha:1]; 110 | } 111 | 112 | UIColor * LSTRGBColor(NSInteger r,NSInteger g,NSInteger b) { 113 | return [LSTColor colorWithRed:r green:g blue:b alpha:1]; 114 | } 115 | UIColor * LSTRGBColorWithAlpha(NSInteger r,NSInteger g,NSInteger b,CGFloat alpha) { 116 | return [LSTColor colorWithRed:r green:g blue:b alpha:alpha]; 117 | } 118 | UIColor * LSTHexColor(NSString *hexString) { 119 | return [LSTColor lst_ColorWithString:hexString]; 120 | } 121 | 122 | UIColor * LSTHexColorWithAlpha(NSString *hexString,CGFloat alpha) { 123 | return [LSTColor lst_ColorWithString:hexString alpha:alpha]; 124 | } 125 | 126 | 127 | 128 | @end 129 | 130 | @implementation NSString (lst_StringTansformer) 131 | 132 | - (NSString *)lst_HexStringTransformFromThreeCharacters; 133 | { 134 | if(self.length == 4) 135 | { 136 | NSString * hexString = [NSString stringWithFormat:@"#%1$c%1$c%2$c%2$c%3$c%3$c", 137 | [self characterAtIndex:1], 138 | [self characterAtIndex:2], 139 | [self characterAtIndex:3]]; 140 | return hexString; 141 | } 142 | 143 | return self; 144 | } 145 | 146 | @end 147 | 148 | 149 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/LSTCategory/Classes/Code/UIView+LSTView/UIView+LSTView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+LSTView.h 3 | // KitNote 4 | // 5 | // Created by LoSenTrad on 2018/5/30. 6 | // Copyright © 2018年 LoSenTrad. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef enum : NSUInteger { 12 | LSTBorderTypeTop, 13 | LSTBorderTypeLeft, 14 | LSTBorderTypeRight, 15 | LSTBorderTypeBottom 16 | } LSTBorderType; 17 | 18 | 19 | 20 | @interface UIView (QTFrame) 21 | 22 | /** 获取/设置view的x坐标 */ 23 | @property (nonatomic, assign) CGFloat x; 24 | /** 获取/设置view的x坐标 */ 25 | @property (nonatomic, assign) CGFloat y; 26 | /** 获取/设置view的x坐标 */ 27 | @property (nonatomic, assign) CGFloat width; 28 | /** 获取/设置view的x坐标 */ 29 | @property (nonatomic, assign) CGFloat height; 30 | /** 获取/设置view的x坐标 */ 31 | @property (nonatomic, assign) CGFloat centerX; 32 | /** 获取/设置view的x坐标 */ 33 | @property (nonatomic, assign) CGFloat centerY; 34 | /** 获取/设置view的x坐标 */ 35 | @property (nonatomic, assign) CGFloat top; 36 | /** 获取/设置view的左边坐标 */ 37 | @property (nonatomic, assign) CGFloat left; 38 | /** 获取/设置view的底部坐标Y */ 39 | @property (nonatomic, assign) CGFloat bottom; 40 | /** 获取/设置view的右边坐标 */ 41 | @property (nonatomic, assign) CGFloat right; 42 | /** 获取/设置view的size */ 43 | @property (nonatomic, assign) CGSize size; 44 | 45 | 46 | /** 屏幕大小 */ 47 | CGSize LSTScreenSize(); 48 | /** 屏幕宽度 */ 49 | CGFloat LSTScreenWidth(); 50 | /** 屏幕高度 */ 51 | CGFloat LSTScreenHeight(); 52 | /** 屏幕bounds */ 53 | CGRect LSTScreenBounds(); 54 | /** 获取相对屏幕的宽度 */ 55 | CGFloat LSTAutoWidth(CGFloat width); 56 | /** 获取相对屏幕的高度 */ 57 | CGFloat LSTAutoHeight(CGFloat height); 58 | /** 获取相对指定view的宽度 */ 59 | CGFloat LSTAutoWidthForView(CGFloat width,UIView *tagView); 60 | /** 获取相对指定view的高度 */ 61 | CGFloat LSTAutoHeightForView(CGFloat height,UIView *tagView); 62 | 63 | static inline CGSize QTSizeMake(CGFloat width, CGFloat height); 64 | static inline CGPoint QTPointMake(CGFloat x, CGFloat y); 65 | static inline CGRect QTRectMake(CGFloat x, CGFloat y, CGFloat width, CGFloat height); 66 | 67 | /** 是否是苹果X */ 68 | BOOL lst_IsIphoneX(); 69 | /** 是否是苹果XR */ 70 | BOOL lst_IsIphoneXR(); 71 | /** 是否是苹果XS */ 72 | BOOL lst_IsIphoneXS(); 73 | /** 是否是苹果XS_Max */ 74 | BOOL lst_IsIphoneXS_Max(); 75 | /** 是否是苹果X系列(刘海屏系列) */ 76 | BOOL lst_IsIphoneX_ALL(); 77 | /** 状态栏高度 X:44 非X:20 */ 78 | CGFloat LSTStatusBarHeight(); 79 | /** 导航栏高度 X:88 非X:64 */ 80 | CGFloat LSTNavBarHeight(); 81 | /** 底部导航栏高度 X:83 非X:49 */ 82 | CGFloat LSTTabBarHeight(); 83 | /** 状态栏高度 X:34 非X:0 */ 84 | CGFloat LSTTabBarBottomMargin(); 85 | /** 底部贴边控件高度 */ 86 | CGFloat LSTBottomHemViewHeight(CGFloat height); 87 | /** 底部控件下间距 (间距小于20使用) */ 88 | CGFloat LSTBottomHemViewMargin(CGFloat margin); 89 | 90 | 91 | 92 | 93 | 94 | /** 根据nib文件转UIView对象 */ 95 | + (instancetype)getNibView:(NSString *)nibName; 96 | /** 设置圆角 */ 97 | - (void)lst_RoundCorners:(UIRectCorner)corners radius:(CGFloat)radius; 98 | /** 截屏生成图片 */ 99 | - (nullable UIImage *)lst_SnapshotImage; 100 | /** 获取当前控制器 */ 101 | - (UIViewController *)getCurrVc; 102 | /** 103 | Create a snapshot PDF of the complete view hierarchy. 104 | This method should be called in main thread. 105 | */ 106 | - (nullable NSData *)snapshotPDF; 107 | /** 108 | Remove all subviews. 109 | 110 | @warning Never call this method inside your view's drawRect: method. 111 | */ 112 | - (void)removeAllSubviews; 113 | /** 设置阴影 可以指定位置 方向 */ 114 | - (void) makeInsetShadow; 115 | - (void) makeInsetShadowWithRadius:(float)radius Alpha:(float)alpha; 116 | - (void) makeInsetShadowWithRadius:(float)radius Color:(nullable UIColor *)color Directions:(nullable NSArray *)directions; 117 | 118 | 119 | /** 添加多边框 可设置颜色 大小 方向 */ 120 | - (void)addBorderWithColor:(UIColor *)color 121 | size:(CGFloat)size 122 | borderTypes:(NSArray *)types; 123 | /** 添加单边框 可设置颜色 大小 方向 */ 124 | - (void)addBorderLayerWithColor:(UIColor *)color 125 | size:(CGFloat)size 126 | borderType:(LSTBorderType)boderType; 127 | 128 | 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /Example/Pods/LSTCategory/README.md: -------------------------------------------------------------------------------- 1 | # LSTCategory 2 | 3 | [![CI Status](https://img.shields.io/travis/LoSenTrad/LSTCategory.svg?style=flat)](https://travis-ci.org/LoSenTrad/LSTCategory) 4 | [![Version](https://img.shields.io/cocoapods/v/LSTCategory.svg?style=flat)](https://cocoapods.org/pods/LSTCategory) 5 | [![License](https://img.shields.io/cocoapods/l/LSTCategory.svg?style=flat)](https://cocoapods.org/pods/LSTCategory) 6 | [![Platform](https://img.shields.io/cocoapods/p/LSTCategory.svg?style=flat)](https://cocoapods.org/pods/LSTCategory) 7 | 8 | ## Example 9 | 10 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 11 | 12 | ## Requirements 13 | 14 | ## Installation 15 | 16 | LSTCategory is available through [CocoaPods](https://cocoapods.org). To install 17 | it, simply add the following line to your Podfile: 18 | 19 | ```ruby 20 | pod 'LSTCategory' 21 | ``` 22 | 23 | ## Author 24 | 25 | LoSenTrad, LoSenTrad@163.com 26 | 27 | ## License 28 | 29 | LSTCategory is available under the MIT license. See the LICENSE file for more info. 30 | -------------------------------------------------------------------------------- /Example/Pods/Local Podspecs/LSTTimer.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "LSTTimer", 3 | "version": "0.1.0", 4 | "summary": "A short description of LSTTimer.", 5 | "description": "TODO: Add long description of the pod here.", 6 | "homepage": "https://github.com/490790096@qq.com/LSTTimer", 7 | "license": { 8 | "type": "MIT", 9 | "file": "LICENSE" 10 | }, 11 | "authors": { 12 | "490790096@qq.com": "LoSenTrad@163.com" 13 | }, 14 | "source": { 15 | "git": "https://github.com/490790096@qq.com/LSTTimer.git", 16 | "tag": "0.1.0" 17 | }, 18 | "platforms": { 19 | "ios": "8.0" 20 | }, 21 | "source_files": "LSTTimer/Classes/**/*" 22 | } 23 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - LSTCategory/LSTControlEvents (0.2.04281546) 3 | - LSTCategory/LSTGestureEvents (0.2.04281546) 4 | - "LSTCategory/NSString+LSTString (0.2.04281546)" 5 | - "LSTCategory/UIColor+LSTColor (0.2.04281546)" 6 | - "LSTCategory/UIView+LSTView (0.2.04281546)" 7 | - LSTTimer (0.1.0) 8 | - Masonry (1.1.0) 9 | 10 | DEPENDENCIES: 11 | - LSTCategory/LSTControlEvents 12 | - LSTCategory/LSTGestureEvents 13 | - "LSTCategory/NSString+LSTString" 14 | - "LSTCategory/UIColor+LSTColor" 15 | - "LSTCategory/UIView+LSTView" 16 | - LSTTimer (from `../`) 17 | - Masonry 18 | 19 | SPEC REPOS: 20 | trunk: 21 | - LSTCategory 22 | - Masonry 23 | 24 | EXTERNAL SOURCES: 25 | LSTTimer: 26 | :path: "../" 27 | 28 | SPEC CHECKSUMS: 29 | LSTCategory: f70d240021080d1c4ab555b6129e74f5b0aa4ccb 30 | LSTTimer: cb673c594302e967f517d05e0d6b50ab6a2f2dd7 31 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 32 | 33 | PODFILE CHECKSUM: 935b1c300a60b6e748fce654190494650cd4f919 34 | 35 | COCOAPODS: 1.9.1 36 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 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. -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASCompositeConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASCompositeConstraint.h" 10 | #import "MASConstraint+Private.h" 11 | 12 | @interface MASCompositeConstraint () 13 | 14 | @property (nonatomic, strong) id mas_key; 15 | @property (nonatomic, strong) NSMutableArray *childConstraints; 16 | 17 | @end 18 | 19 | @implementation MASCompositeConstraint 20 | 21 | - (id)initWithChildren:(NSArray *)children { 22 | self = [super init]; 23 | if (!self) return nil; 24 | 25 | _childConstraints = [children mutableCopy]; 26 | for (MASConstraint *constraint in _childConstraints) { 27 | constraint.delegate = self; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - MASConstraintDelegate 34 | 35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { 36 | NSUInteger index = [self.childConstraints indexOfObject:constraint]; 37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); 38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; 39 | } 40 | 41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 42 | id strongDelegate = self.delegate; 43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 44 | newConstraint.delegate = self; 45 | [self.childConstraints addObject:newConstraint]; 46 | return newConstraint; 47 | } 48 | 49 | #pragma mark - NSLayoutConstraint multiplier proxies 50 | 51 | - (MASConstraint * (^)(CGFloat))multipliedBy { 52 | return ^id(CGFloat multiplier) { 53 | for (MASConstraint *constraint in self.childConstraints) { 54 | constraint.multipliedBy(multiplier); 55 | } 56 | return self; 57 | }; 58 | } 59 | 60 | - (MASConstraint * (^)(CGFloat))dividedBy { 61 | return ^id(CGFloat divider) { 62 | for (MASConstraint *constraint in self.childConstraints) { 63 | constraint.dividedBy(divider); 64 | } 65 | return self; 66 | }; 67 | } 68 | 69 | #pragma mark - MASLayoutPriority proxy 70 | 71 | - (MASConstraint * (^)(MASLayoutPriority))priority { 72 | return ^id(MASLayoutPriority priority) { 73 | for (MASConstraint *constraint in self.childConstraints) { 74 | constraint.priority(priority); 75 | } 76 | return self; 77 | }; 78 | } 79 | 80 | #pragma mark - NSLayoutRelation proxy 81 | 82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { 83 | return ^id(id attr, NSLayoutRelation relation) { 84 | for (MASConstraint *constraint in self.childConstraints.copy) { 85 | constraint.equalToWithRelation(attr, relation); 86 | } 87 | return self; 88 | }; 89 | } 90 | 91 | #pragma mark - attribute chaining 92 | 93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 95 | return self; 96 | } 97 | 98 | #pragma mark - Animator proxy 99 | 100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 101 | 102 | - (MASConstraint *)animator { 103 | for (MASConstraint *constraint in self.childConstraints) { 104 | [constraint animator]; 105 | } 106 | return self; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark - debug helpers 112 | 113 | - (MASConstraint * (^)(id))key { 114 | return ^id(id key) { 115 | self.mas_key = key; 116 | int i = 0; 117 | for (MASConstraint *constraint in self.childConstraints) { 118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); 119 | } 120 | return self; 121 | }; 122 | } 123 | 124 | #pragma mark - NSLayoutConstraint constant setters 125 | 126 | - (void)setInsets:(MASEdgeInsets)insets { 127 | for (MASConstraint *constraint in self.childConstraints) { 128 | constraint.insets = insets; 129 | } 130 | } 131 | 132 | - (void)setInset:(CGFloat)inset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.inset = inset; 135 | } 136 | } 137 | 138 | - (void)setOffset:(CGFloat)offset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.offset = offset; 141 | } 142 | } 143 | 144 | - (void)setSizeOffset:(CGSize)sizeOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.sizeOffset = sizeOffset; 147 | } 148 | } 149 | 150 | - (void)setCenterOffset:(CGPoint)centerOffset { 151 | for (MASConstraint *constraint in self.childConstraints) { 152 | constraint.centerOffset = centerOffset; 153 | } 154 | } 155 | 156 | #pragma mark - MASConstraint 157 | 158 | - (void)activate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint activate]; 161 | } 162 | } 163 | 164 | - (void)deactivate { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | [constraint deactivate]; 167 | } 168 | } 169 | 170 | - (void)install { 171 | for (MASConstraint *constraint in self.childConstraints) { 172 | constraint.updateExisting = self.updateExisting; 173 | [constraint install]; 174 | } 175 | } 176 | 177 | - (void)uninstall { 178 | for (MASConstraint *constraint in self.childConstraints) { 179 | [constraint uninstall]; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraintMaker.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | typedef NS_OPTIONS(NSInteger, MASAttribute) { 13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft, 14 | MASAttributeRight = 1 << NSLayoutAttributeRight, 15 | MASAttributeTop = 1 << NSLayoutAttributeTop, 16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom, 17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading, 18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, 19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth, 20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight, 21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, 22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, 23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, 24 | 25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 26 | 27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, 28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, 29 | 30 | #endif 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 33 | 34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, 35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, 36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, 37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, 38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, 39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, 40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, 41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, 42 | 43 | #endif 44 | 45 | }; 46 | 47 | /** 48 | * Provides factory methods for creating MASConstraints. 49 | * Constraints are collected until they are ready to be installed 50 | * 51 | */ 52 | @interface MASConstraintMaker : NSObject 53 | 54 | /** 55 | * The following properties return a new MASViewConstraint 56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute 57 | */ 58 | @property (nonatomic, strong, readonly) MASConstraint *left; 59 | @property (nonatomic, strong, readonly) MASConstraint *top; 60 | @property (nonatomic, strong, readonly) MASConstraint *right; 61 | @property (nonatomic, strong, readonly) MASConstraint *bottom; 62 | @property (nonatomic, strong, readonly) MASConstraint *leading; 63 | @property (nonatomic, strong, readonly) MASConstraint *trailing; 64 | @property (nonatomic, strong, readonly) MASConstraint *width; 65 | @property (nonatomic, strong, readonly) MASConstraint *height; 66 | @property (nonatomic, strong, readonly) MASConstraint *centerX; 67 | @property (nonatomic, strong, readonly) MASConstraint *centerY; 68 | @property (nonatomic, strong, readonly) MASConstraint *baseline; 69 | 70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 71 | 72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline; 73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline; 74 | 75 | #endif 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 78 | 79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin; 80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin; 81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin; 82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin; 83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin; 84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin; 85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; 86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; 87 | 88 | #endif 89 | 90 | /** 91 | * Returns a block which creates a new MASCompositeConstraint with the first item set 92 | * to the makers associated view and children corresponding to the set bits in the 93 | * MASAttribute parameter. Combine multiple attributes via binary-or. 94 | */ 95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); 96 | 97 | /** 98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges 99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right) 100 | * with the first item set to the makers associated view 101 | */ 102 | @property (nonatomic, strong, readonly) MASConstraint *edges; 103 | 104 | /** 105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize 106 | * which generates the appropriate MASViewConstraint children (width, height) 107 | * with the first item set to the makers associated view 108 | */ 109 | @property (nonatomic, strong, readonly) MASConstraint *size; 110 | 111 | /** 112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter 113 | * which generates the appropriate MASViewConstraint children (centerX, centerY) 114 | * with the first item set to the makers associated view 115 | */ 116 | @property (nonatomic, strong, readonly) MASConstraint *center; 117 | 118 | /** 119 | * Whether or not to check for an existing constraint instead of adding constraint 120 | */ 121 | @property (nonatomic, assign) BOOL updateExisting; 122 | 123 | /** 124 | * Whether or not to remove existing constraints prior to installing 125 | */ 126 | @property (nonatomic, assign) BOOL removeExisting; 127 | 128 | /** 129 | * initialises the maker with a default view 130 | * 131 | * @param view any MASConstraint are created with this view as the first item 132 | * 133 | * @return a new MASConstraintMaker 134 | */ 135 | - (id)initWithView:(MAS_VIEW *)view; 136 | 137 | /** 138 | * Calls install method on any MASConstraints which have been created by this maker 139 | * 140 | * @return an array of all the installed MASConstraints 141 | */ 142 | - (NSArray *)install; 143 | 144 | - (MASConstraint * (^)(dispatch_block_t))group; 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASUtilities.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 19/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | #if TARGET_OS_IPHONE || TARGET_OS_TV 14 | 15 | #import 16 | #define MAS_VIEW UIView 17 | #define MAS_VIEW_CONTROLLER UIViewController 18 | #define MASEdgeInsets UIEdgeInsets 19 | 20 | typedef UILayoutPriority MASLayoutPriority; 21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; 22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; 23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; 24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; 25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; 26 | 27 | #elif TARGET_OS_MAC 28 | 29 | #import 30 | #define MAS_VIEW NSView 31 | #define MASEdgeInsets NSEdgeInsets 32 | 33 | typedef NSLayoutPriority MASLayoutPriority; 34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; 35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; 36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; 37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; 38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; 39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; 40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; 41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; 42 | 43 | #endif 44 | 45 | /** 46 | * Allows you to attach keys to objects matching the variable names passed. 47 | * 48 | * view1.mas_key = @"view1", view2.mas_key = @"view2"; 49 | * 50 | * is equivalent to: 51 | * 52 | * MASAttachKeys(view1, view2); 53 | */ 54 | #define MASAttachKeys(...) \ 55 | { \ 56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ 57 | for (id key in keyPairs.allKeys) { \ 58 | id obj = keyPairs[key]; \ 59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ 60 | @"Cannot attach mas_key to %@", obj); \ 61 | [obj setMas_key:key]; \ 62 | } \ 63 | } 64 | 65 | /** 66 | * Used to create object hashes 67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html 68 | */ 69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) 70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) 71 | 72 | /** 73 | * Given a scalar or struct value, wraps it in NSValue 74 | * Based on EXPObjectify: https://github.com/specta/expecta 75 | */ 76 | static inline id _MASBoxValue(const char *type, ...) { 77 | va_list v; 78 | va_start(v, type); 79 | id obj = nil; 80 | if (strcmp(type, @encode(id)) == 0) { 81 | id actual = va_arg(v, id); 82 | obj = actual; 83 | } else if (strcmp(type, @encode(CGPoint)) == 0) { 84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint); 85 | obj = [NSValue value:&actual withObjCType:type]; 86 | } else if (strcmp(type, @encode(CGSize)) == 0) { 87 | CGSize actual = (CGSize)va_arg(v, CGSize); 88 | obj = [NSValue value:&actual withObjCType:type]; 89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { 90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); 91 | obj = [NSValue value:&actual withObjCType:type]; 92 | } else if (strcmp(type, @encode(double)) == 0) { 93 | double actual = (double)va_arg(v, double); 94 | obj = [NSNumber numberWithDouble:actual]; 95 | } else if (strcmp(type, @encode(float)) == 0) { 96 | float actual = (float)va_arg(v, double); 97 | obj = [NSNumber numberWithFloat:actual]; 98 | } else if (strcmp(type, @encode(int)) == 0) { 99 | int actual = (int)va_arg(v, int); 100 | obj = [NSNumber numberWithInt:actual]; 101 | } else if (strcmp(type, @encode(long)) == 0) { 102 | long actual = (long)va_arg(v, long); 103 | obj = [NSNumber numberWithLong:actual]; 104 | } else if (strcmp(type, @encode(long long)) == 0) { 105 | long long actual = (long long)va_arg(v, long long); 106 | obj = [NSNumber numberWithLongLong:actual]; 107 | } else if (strcmp(type, @encode(short)) == 0) { 108 | short actual = (short)va_arg(v, int); 109 | obj = [NSNumber numberWithShort:actual]; 110 | } else if (strcmp(type, @encode(char)) == 0) { 111 | char actual = (char)va_arg(v, int); 112 | obj = [NSNumber numberWithChar:actual]; 113 | } else if (strcmp(type, @encode(bool)) == 0) { 114 | bool actual = (bool)va_arg(v, int); 115 | obj = [NSNumber numberWithBool:actual]; 116 | } else if (strcmp(type, @encode(unsigned char)) == 0) { 117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int); 118 | obj = [NSNumber numberWithUnsignedChar:actual]; 119 | } else if (strcmp(type, @encode(unsigned int)) == 0) { 120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int); 121 | obj = [NSNumber numberWithUnsignedInt:actual]; 122 | } else if (strcmp(type, @encode(unsigned long)) == 0) { 123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long); 124 | obj = [NSNumber numberWithUnsignedLong:actual]; 125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) { 126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); 127 | obj = [NSNumber numberWithUnsignedLongLong:actual]; 128 | } else if (strcmp(type, @encode(unsigned short)) == 0) { 129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int); 130 | obj = [NSNumber numberWithUnsignedShort:actual]; 131 | } 132 | va_end(v); 133 | return obj; 134 | } 135 | 136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) 137 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.m 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | #import "View+MASAdditions.h" 11 | 12 | @implementation NSArray (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { 15 | NSMutableArray *constraints = [NSMutableArray array]; 16 | for (MAS_VIEW *view in self) { 17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; 19 | } 20 | return constraints; 21 | } 22 | 23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { 24 | NSMutableArray *constraints = [NSMutableArray array]; 25 | for (MAS_VIEW *view in self) { 26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; 28 | } 29 | return constraints; 30 | } 31 | 32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 33 | NSMutableArray *constraints = [NSMutableArray array]; 34 | for (MAS_VIEW *view in self) { 35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; 37 | } 38 | return constraints; 39 | } 40 | 41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 42 | if (self.count < 2) { 43 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 44 | return; 45 | } 46 | 47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 48 | if (axisType == MASAxisTypeHorizontal) { 49 | MAS_VIEW *prev; 50 | for (int i = 0; i < self.count; i++) { 51 | MAS_VIEW *v = self[i]; 52 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 53 | if (prev) { 54 | make.width.equalTo(prev); 55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing); 56 | if (i == self.count - 1) {//last one 57 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 58 | } 59 | } 60 | else {//first one 61 | make.left.equalTo(tempSuperView).offset(leadSpacing); 62 | } 63 | 64 | }]; 65 | prev = v; 66 | } 67 | } 68 | else { 69 | MAS_VIEW *prev; 70 | for (int i = 0; i < self.count; i++) { 71 | MAS_VIEW *v = self[i]; 72 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 73 | if (prev) { 74 | make.height.equalTo(prev); 75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); 76 | if (i == self.count - 1) {//last one 77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 78 | } 79 | } 80 | else {//first one 81 | make.top.equalTo(tempSuperView).offset(leadSpacing); 82 | } 83 | 84 | }]; 85 | prev = v; 86 | } 87 | } 88 | } 89 | 90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 91 | if (self.count < 2) { 92 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 93 | return; 94 | } 95 | 96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 97 | if (axisType == MASAxisTypeHorizontal) { 98 | MAS_VIEW *prev; 99 | for (int i = 0; i < self.count; i++) { 100 | MAS_VIEW *v = self[i]; 101 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 102 | make.width.equalTo(@(fixedItemLength)); 103 | if (prev) { 104 | if (i == self.count - 1) {//last one 105 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 106 | } 107 | else { 108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 110 | } 111 | } 112 | else {//first one 113 | make.left.equalTo(tempSuperView).offset(leadSpacing); 114 | } 115 | }]; 116 | prev = v; 117 | } 118 | } 119 | else { 120 | MAS_VIEW *prev; 121 | for (int i = 0; i < self.count; i++) { 122 | MAS_VIEW *v = self[i]; 123 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 124 | make.height.equalTo(@(fixedItemLength)); 125 | if (prev) { 126 | if (i == self.count - 1) {//last one 127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 128 | } 129 | else { 130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 132 | } 133 | } 134 | else {//first one 135 | make.top.equalTo(tempSuperView).offset(leadSpacing); 136 | } 137 | }]; 138 | prev = v; 139 | } 140 | } 141 | } 142 | 143 | - (MAS_VIEW *)mas_commonSuperviewOfViews 144 | { 145 | MAS_VIEW *commonSuperview = nil; 146 | MAS_VIEW *previousView = nil; 147 | for (id object in self) { 148 | if ([object isKindOfClass:[MAS_VIEW class]]) { 149 | MAS_VIEW *view = (MAS_VIEW *)object; 150 | if (previousView) { 151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; 152 | } else { 153 | commonSuperview = view; 154 | } 155 | previousView = view; 156 | } 157 | } 158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); 159 | return commonSuperview; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSLayoutConstraint+MASDebugAdditions.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | 13 | @implementation NSLayoutConstraint (MASDebugAdditions) 14 | 15 | #pragma mark - description maps 16 | 17 | + (NSDictionary *)layoutRelationDescriptionsByValue { 18 | static dispatch_once_t once; 19 | static NSDictionary *descriptionMap; 20 | dispatch_once(&once, ^{ 21 | descriptionMap = @{ 22 | @(NSLayoutRelationEqual) : @"==", 23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=", 24 | @(NSLayoutRelationLessThanOrEqual) : @"<=", 25 | }; 26 | }); 27 | return descriptionMap; 28 | } 29 | 30 | + (NSDictionary *)layoutAttributeDescriptionsByValue { 31 | static dispatch_once_t once; 32 | static NSDictionary *descriptionMap; 33 | dispatch_once(&once, ^{ 34 | descriptionMap = @{ 35 | @(NSLayoutAttributeTop) : @"top", 36 | @(NSLayoutAttributeLeft) : @"left", 37 | @(NSLayoutAttributeBottom) : @"bottom", 38 | @(NSLayoutAttributeRight) : @"right", 39 | @(NSLayoutAttributeLeading) : @"leading", 40 | @(NSLayoutAttributeTrailing) : @"trailing", 41 | @(NSLayoutAttributeWidth) : @"width", 42 | @(NSLayoutAttributeHeight) : @"height", 43 | @(NSLayoutAttributeCenterX) : @"centerX", 44 | @(NSLayoutAttributeCenterY) : @"centerY", 45 | @(NSLayoutAttributeBaseline) : @"baseline", 46 | 47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", 49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline", 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin", 54 | @(NSLayoutAttributeRightMargin) : @"rightMargin", 55 | @(NSLayoutAttributeTopMargin) : @"topMargin", 56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin", 57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", 58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", 59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", 60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", 61 | #endif 62 | 63 | }; 64 | 65 | }); 66 | return descriptionMap; 67 | } 68 | 69 | 70 | + (NSDictionary *)layoutPriorityDescriptionsByValue { 71 | static dispatch_once_t once; 72 | static NSDictionary *descriptionMap; 73 | dispatch_once(&once, ^{ 74 | #if TARGET_OS_IPHONE || TARGET_OS_TV 75 | descriptionMap = @{ 76 | @(MASLayoutPriorityDefaultHigh) : @"high", 77 | @(MASLayoutPriorityDefaultLow) : @"low", 78 | @(MASLayoutPriorityDefaultMedium) : @"medium", 79 | @(MASLayoutPriorityRequired) : @"required", 80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", 81 | }; 82 | #elif TARGET_OS_MAC 83 | descriptionMap = @{ 84 | @(MASLayoutPriorityDefaultHigh) : @"high", 85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", 86 | @(MASLayoutPriorityDefaultMedium) : @"medium", 87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", 88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", 89 | @(MASLayoutPriorityDefaultLow) : @"low", 90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", 91 | @(MASLayoutPriorityRequired) : @"required", 92 | }; 93 | #endif 94 | }); 95 | return descriptionMap; 96 | } 97 | 98 | #pragma mark - description override 99 | 100 | + (NSString *)descriptionForObject:(id)obj { 101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { 102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; 103 | } 104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; 105 | } 106 | 107 | - (NSString *)description { 108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; 109 | 110 | [description appendString:[self.class descriptionForObject:self]]; 111 | 112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; 113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { 114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; 115 | } 116 | 117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; 118 | 119 | if (self.secondItem) { 120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; 121 | } 122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { 123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; 124 | } 125 | 126 | if (self.multiplier != 1) { 127 | [description appendFormat:@" * %g", self.multiplier]; 128 | } 129 | 130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { 131 | [description appendFormat:@" %g", self.constant]; 132 | } else { 133 | if (self.constant) { 134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; 135 | } 136 | } 137 | 138 | if (self.priority != MASLayoutPriorityRequired) { 139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; 140 | } 141 | 142 | [description appendString:@">"]; 143 | return description; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 56 | 57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 62 | 63 | #endif 64 | 65 | /** 66 | * a key to associate with this view 67 | */ 68 | @property (nonatomic, strong) id mas_key; 69 | 70 | /** 71 | * Finds the closest common superview between this view and another view 72 | * 73 | * @param view other view 74 | * 75 | * @return returns nil if common superview could not be found 76 | */ 77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 82 | * 83 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 84 | * 85 | * @return Array of created MASConstraints 86 | */ 87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 88 | 89 | /** 90 | * Creates a MASConstraintMaker with the callee view. 91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 92 | * If an existing constraint exists then it will be updated instead. 93 | * 94 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 95 | * 96 | * @return Array of created/updated MASConstraints 97 | */ 98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 99 | 100 | /** 101 | * Creates a MASConstraintMaker with the callee view. 102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 103 | * All constraints previously installed for the view will be removed. 104 | * 105 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 106 | * 107 | * @return Array of created/updated MASConstraints 108 | */ 109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/View+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | #import 11 | 12 | @implementation MAS_VIEW (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block { 15 | self.translatesAutoresizingMaskIntoConstraints = NO; 16 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 17 | block(constraintMaker); 18 | return [constraintMaker install]; 19 | } 20 | 21 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block { 22 | self.translatesAutoresizingMaskIntoConstraints = NO; 23 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 24 | constraintMaker.updateExisting = YES; 25 | block(constraintMaker); 26 | return [constraintMaker install]; 27 | } 28 | 29 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 30 | self.translatesAutoresizingMaskIntoConstraints = NO; 31 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 32 | constraintMaker.removeExisting = YES; 33 | block(constraintMaker); 34 | return [constraintMaker install]; 35 | } 36 | 37 | #pragma mark - NSLayoutAttribute properties 38 | 39 | - (MASViewAttribute *)mas_left { 40 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft]; 41 | } 42 | 43 | - (MASViewAttribute *)mas_top { 44 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop]; 45 | } 46 | 47 | - (MASViewAttribute *)mas_right { 48 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight]; 49 | } 50 | 51 | - (MASViewAttribute *)mas_bottom { 52 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom]; 53 | } 54 | 55 | - (MASViewAttribute *)mas_leading { 56 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading]; 57 | } 58 | 59 | - (MASViewAttribute *)mas_trailing { 60 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing]; 61 | } 62 | 63 | - (MASViewAttribute *)mas_width { 64 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth]; 65 | } 66 | 67 | - (MASViewAttribute *)mas_height { 68 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight]; 69 | } 70 | 71 | - (MASViewAttribute *)mas_centerX { 72 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX]; 73 | } 74 | 75 | - (MASViewAttribute *)mas_centerY { 76 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY]; 77 | } 78 | 79 | - (MASViewAttribute *)mas_baseline { 80 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline]; 81 | } 82 | 83 | - (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute 84 | { 85 | return ^(NSLayoutAttribute attr) { 86 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr]; 87 | }; 88 | } 89 | 90 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 91 | 92 | - (MASViewAttribute *)mas_firstBaseline { 93 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline]; 94 | } 95 | - (MASViewAttribute *)mas_lastBaseline { 96 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline]; 97 | } 98 | 99 | #endif 100 | 101 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 102 | 103 | - (MASViewAttribute *)mas_leftMargin { 104 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin]; 105 | } 106 | 107 | - (MASViewAttribute *)mas_rightMargin { 108 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin]; 109 | } 110 | 111 | - (MASViewAttribute *)mas_topMargin { 112 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin]; 113 | } 114 | 115 | - (MASViewAttribute *)mas_bottomMargin { 116 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin]; 117 | } 118 | 119 | - (MASViewAttribute *)mas_leadingMargin { 120 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin]; 121 | } 122 | 123 | - (MASViewAttribute *)mas_trailingMargin { 124 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin]; 125 | } 126 | 127 | - (MASViewAttribute *)mas_centerXWithinMargins { 128 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins]; 129 | } 130 | 131 | - (MASViewAttribute *)mas_centerYWithinMargins { 132 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins]; 133 | } 134 | 135 | #endif 136 | 137 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 138 | 139 | - (MASViewAttribute *)mas_safeAreaLayoutGuide { 140 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 141 | } 142 | - (MASViewAttribute *)mas_safeAreaLayoutGuideTop { 143 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 144 | } 145 | - (MASViewAttribute *)mas_safeAreaLayoutGuideBottom { 146 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 147 | } 148 | - (MASViewAttribute *)mas_safeAreaLayoutGuideLeft { 149 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft]; 150 | } 151 | - (MASViewAttribute *)mas_safeAreaLayoutGuideRight { 152 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight]; 153 | } 154 | 155 | #endif 156 | 157 | #pragma mark - associated properties 158 | 159 | - (id)mas_key { 160 | return objc_getAssociatedObject(self, @selector(mas_key)); 161 | } 162 | 163 | - (void)setMas_key:(id)key { 164 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 165 | } 166 | 167 | #pragma mark - heirachy 168 | 169 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view { 170 | MAS_VIEW *closestCommonSuperview = nil; 171 | 172 | MAS_VIEW *secondViewSuperview = view; 173 | while (!closestCommonSuperview && secondViewSuperview) { 174 | MAS_VIEW *firstViewSuperview = self; 175 | while (!closestCommonSuperview && firstViewSuperview) { 176 | if (secondViewSuperview == firstViewSuperview) { 177 | closestCommonSuperview = secondViewSuperview; 178 | } 179 | firstViewSuperview = firstViewSuperview.superview; 180 | } 181 | secondViewSuperview = secondViewSuperview.superview; 182 | } 183 | return closestCommonSuperview; 184 | } 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 53 | 54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | 59 | #endif 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 64 | 65 | @end 66 | 67 | #define MAS_ATTR_FORWARD(attr) \ 68 | - (MASViewAttribute *)attr { \ 69 | return [self mas_##attr]; \ 70 | } 71 | 72 | @implementation MAS_VIEW (MASShorthandAdditions) 73 | 74 | MAS_ATTR_FORWARD(top); 75 | MAS_ATTR_FORWARD(left); 76 | MAS_ATTR_FORWARD(bottom); 77 | MAS_ATTR_FORWARD(right); 78 | MAS_ATTR_FORWARD(leading); 79 | MAS_ATTR_FORWARD(trailing); 80 | MAS_ATTR_FORWARD(width); 81 | MAS_ATTR_FORWARD(height); 82 | MAS_ATTR_FORWARD(centerX); 83 | MAS_ATTR_FORWARD(centerY); 84 | MAS_ATTR_FORWARD(baseline); 85 | 86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 87 | 88 | MAS_ATTR_FORWARD(firstBaseline); 89 | MAS_ATTR_FORWARD(lastBaseline); 90 | 91 | #endif 92 | 93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 94 | 95 | MAS_ATTR_FORWARD(leftMargin); 96 | MAS_ATTR_FORWARD(rightMargin); 97 | MAS_ATTR_FORWARD(topMargin); 98 | MAS_ATTR_FORWARD(bottomMargin); 99 | MAS_ATTR_FORWARD(leadingMargin); 100 | MAS_ATTR_FORWARD(trailingMargin); 101 | MAS_ATTR_FORWARD(centerXWithinMargins); 102 | MAS_ATTR_FORWARD(centerYWithinMargins); 103 | 104 | #endif 105 | 106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 107 | 108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); 109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); 110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); 111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); 112 | 113 | #endif 114 | 115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 116 | return [self mas_attribute]; 117 | } 118 | 119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 120 | return [self mas_makeConstraints:block]; 121 | } 122 | 123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 124 | return [self mas_updateConstraints:block]; 125 | } 126 | 127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 128 | return [self mas_remakeConstraints:block]; 129 | } 130 | 131 | @end 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory-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.2.4281546 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_LSTCategory : NSObject 3 | @end 4 | @implementation PodsDummy_LSTCategory 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "LSTControlEvents.h" 14 | #import "LSTGestureEvents.h" 15 | #import "NSString+LSTString.h" 16 | #import "UIColor+LSTColor.h" 17 | #import "UIView+LSTView.h" 18 | 19 | FOUNDATION_EXPORT double LSTCategoryVersionNumber; 20 | FOUNDATION_EXPORT const unsigned char LSTCategoryVersionString[]; 21 | 22 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LSTCategory 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LSTCategory" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LSTCategory 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory.modulemap: -------------------------------------------------------------------------------- 1 | framework module LSTCategory { 2 | umbrella header "LSTCategory-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTCategory/LSTCategory.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LSTCategory 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LSTCategory" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/LSTCategory 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer-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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_LSTTimer : NSObject 3 | @end 4 | @implementation PodsDummy_LSTTimer 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "LSTTimer.h" 14 | 15 | FOUNDATION_EXPORT double LSTTimerVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char LSTTimerVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LSTTimer 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LSTTimer" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTTimer" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer.modulemap: -------------------------------------------------------------------------------- 1 | framework module LSTTimer { 2 | umbrella header "LSTTimer-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/LSTTimer/LSTTimer.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LSTTimer 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/LSTTimer" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTTimer" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry-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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "MASCompositeConstraint.h" 14 | #import "MASConstraint+Private.h" 15 | #import "MASConstraint.h" 16 | #import "MASConstraintMaker.h" 17 | #import "MASLayoutConstraint.h" 18 | #import "Masonry.h" 19 | #import "MASUtilities.h" 20 | #import "MASViewAttribute.h" 21 | #import "MASViewConstraint.h" 22 | #import "NSArray+MASAdditions.h" 23 | #import "NSArray+MASShorthandAdditions.h" 24 | #import "NSLayoutConstraint+MASDebugAdditions.h" 25 | #import "View+MASAdditions.h" 26 | #import "View+MASShorthandAdditions.h" 27 | #import "ViewController+MASAdditions.h" 28 | 29 | FOUNDATION_EXPORT double MasonryVersionNumber; 30 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 31 | 32 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Masonry" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry.modulemap: -------------------------------------------------------------------------------- 1 | framework module Masonry { 2 | umbrella header "Masonry-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Masonry/Masonry.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/Masonry" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Masonry" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## LSTCategory 5 | 6 | Copyright (c) 2019 LoSenTrad 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | 27 | ## LSTTimer 28 | 29 | Copyright (c) 2020 490790096@qq.com 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in 39 | all copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 47 | THE SOFTWARE. 48 | 49 | 50 | ## Masonry 51 | 52 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 53 | 54 | Permission is hereby granted, free of charge, to any person obtaining a copy 55 | of this software and associated documentation files (the "Software"), to deal 56 | in the Software without restriction, including without limitation the rights 57 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 58 | copies of the Software, and to permit persons to whom the Software is 59 | furnished to do so, subject to the following conditions: 60 | 61 | The above copyright notice and this permission notice shall be included in 62 | all copies or substantial portions of the Software. 63 | 64 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 65 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 66 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 67 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 68 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 69 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 70 | THE SOFTWARE. 71 | Generated by CocoaPods - https://cocoapods.org 72 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2019 LoSenTrad <LoSenTrad@163.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | License 38 | MIT 39 | Title 40 | LSTCategory 41 | Type 42 | PSGroupSpecifier 43 | 44 | 45 | FooterText 46 | Copyright (c) 2020 490790096@qq.com <LoSenTrad@163.com> 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 | License 67 | MIT 68 | Title 69 | LSTTimer 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | FooterText 75 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 76 | 77 | Permission is hereby granted, free of charge, to any person obtaining a copy 78 | of this software and associated documentation files (the "Software"), to deal 79 | in the Software without restriction, including without limitation the rights 80 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 81 | copies of the Software, and to permit persons to whom the Software is 82 | furnished to do so, subject to the following conditions: 83 | 84 | The above copyright notice and this permission notice shall be included in 85 | all copies or substantial portions of the Software. 86 | 87 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 88 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 89 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 90 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 91 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 92 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 93 | THE SOFTWARE. 94 | License 95 | MIT 96 | Title 97 | Masonry 98 | Type 99 | PSGroupSpecifier 100 | 101 | 102 | FooterText 103 | Generated by CocoaPods - https://cocoapods.org 104 | Title 105 | 106 | Type 107 | PSGroupSpecifier 108 | 109 | 110 | StringsTable 111 | Acknowledgements 112 | Title 113 | Acknowledgements 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LSTTimer_Example : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LSTTimer_Example 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LSTTimer_ExampleVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LSTTimer_ExampleVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" "${PODS_ROOT}/Headers/Public/LSTTimer" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSTCategory" "${PODS_CONFIGURATION_BUILD_DIR}/LSTTimer" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"LSTCategory" -l"LSTTimer" -l"Masonry" -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LSTTimer_Example { 2 | umbrella header "Pods-LSTTimer_Example-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Example/Pods-LSTTimer_Example.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" "${PODS_ROOT}/Headers/Public/LSTTimer" "${PODS_ROOT}/Headers/Public/Masonry" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LSTCategory" "${PODS_CONFIGURATION_BUILD_DIR}/LSTTimer" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"LSTCategory" -l"LSTTimer" -l"Masonry" -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | 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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_LSTTimer_Tests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_LSTTimer_Tests 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_LSTTimer_TestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_LSTTimer_TestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" "${PODS_ROOT}/Headers/Public/LSTTimer" "${PODS_ROOT}/Headers/Public/Masonry" 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_LSTTimer_Tests { 2 | umbrella header "Pods-LSTTimer_Tests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-LSTTimer_Tests/Pods-LSTTimer_Tests.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/LSTCategory" "${PODS_ROOT}/Headers/Public/LSTTimer" "${PODS_ROOT}/Headers/Public/Masonry" 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 7 | PODS_ROOT = ${SRCROOT}/Pods 8 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 9 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimerTests.m 3 | // LSTTimerTests 4 | // 5 | // Created by 490790096@qq.com on 07/13/2020. 6 | // Copyright (c) 2020 490790096@qq.com. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | - (void)testLST { 35 | 36 | 37 | } 38 | 39 | @end 40 | 41 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/UPDATE_HISTORY.md: -------------------------------------------------------------------------------- 1 | ##LSTTimer 版本更新历史 2 | 3 | 2020.08.25 v0.1.08251125 4 | --- 5 | - 新增reset(重置)相关api 6 | - other 7 | 8 | 2020.07.24 v0.1.07241811 9 | --- 10 | - 完善demo 11 | - 完善说明书 12 | - other 13 | 14 | 2020.07.23 v0.1.07231652 15 | --- 16 | - 发布0.1.07231652版本 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 490790096@qq.com 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 | -------------------------------------------------------------------------------- /LSTTimer.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint LSTTimer.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'LSTTimer' 11 | s.version = '0.2.10' 12 | s.summary = '一个计时器组件' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = 'LSTTimer是一个计时器组件, 拥有100ms精确度,支持多任务计时,列表计时,硬盘计时任务等.' 21 | 22 | s.homepage = 'https://github.com/LoSenTrad/LSTTimer' 23 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 24 | s.license = { :type => 'MIT', :file => 'LICENSE' } 25 | s.author = { '490790096@qq.com' => 'LoSenTrad@163.com' } 26 | s.source = { :git => 'https://github.com/LoSenTrad/LSTTimer', :tag => s.version.to_s } 27 | # s.social_media_url = 'https://twitter.com/' 28 | 29 | s.ios.deployment_target = '8.0' 30 | 31 | s.source_files = 'LSTTimer/Classes/**/*' 32 | 33 | # s.resource_bundles = { 34 | # 'LSTTimer' => ['LSTTimer/Assets/*.png'] 35 | # } 36 | 37 | # s.public_header_files = 'Pod/Classes/**/*.h' 38 | # s.frameworks = 'UIKit', 'MapKit' 39 | # s.dependency 'AFNetworking', '~> 2.3' 40 | end 41 | -------------------------------------------------------------------------------- /LSTTimer/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/LSTTimer/Assets/.gitkeep -------------------------------------------------------------------------------- /LSTTimer/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LoSenTrad/LSTTimer/6f5743353a2bdf7afa25234b3709c52b67b704ed/LSTTimer/Classes/.gitkeep -------------------------------------------------------------------------------- /LSTTimer/Classes/LSTTimer.h: -------------------------------------------------------------------------------- 1 | // 2 | // LSTTimer.h 3 | // LSTTimer 4 | // 5 | // Created by LoSenTrad on 2020/7/13. 6 | // 7 | 8 | #import 9 | 10 | 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef void(^LSTTimerChangeBlock)(NSString *day, NSString *hour, NSString *minute, NSString *second, NSString *ms); 15 | typedef void(^LSTTimerFinishBlock)(NSString *identifier); 16 | typedef void(^LSTTimerPauseBlock)(NSString *identifier); 17 | 18 | 19 | 20 | /** 倒计时变化通知类型 */ 21 | typedef NS_ENUM(NSInteger, LSTTimerSecondChangeNFType) { 22 | LSTTimerSecondChangeNFTypeNone = 0, 23 | LSTTimerSecondChangeNFTypeMS, //每100ms(毫秒) 发出一次 24 | LSTTimerSecondChangeNFTypeSecond, //每1s(秒) 发出一次 25 | 26 | }; 27 | 28 | @interface LSTTimer : NSObject 29 | 30 | 31 | /** 单例 */ 32 | LSTTimer *LSTTimerM(void); 33 | 34 | #pragma mark - ***** 配置计时任务通知回调 ***** 35 | /// 设置倒计时任务的通知回调 36 | /// @param name 通知名 37 | /// @param identifier 倒计时任务的标识 38 | /// @param type 倒计时变化通知类型 39 | + (void)setNotificationForName:(NSString *)name identifier:(NSString *)identifier changeNFType:(LSTTimerSecondChangeNFType)type; 40 | 41 | #pragma mark - ***** 添加计时任务(100ms回调一次) ***** 42 | /// 添加计时任务 43 | /// @param time 时间长度 44 | /// @param handle 每100ms回调一次 45 | + (void)addTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle; 46 | /// 添加计时任务 47 | /// @param time 时间长度 48 | /// @param identifier 计时任务标识 49 | /// @param handle 每100ms回调一次 50 | + (void)addTimerForTime:(NSTimeInterval)time 51 | identifier:(NSString *)identifier 52 | handle:(LSTTimerChangeBlock)handle; 53 | /// 添加计时任务 54 | /// @param time 时间长度 55 | /// @param identifier 计时任务标识 56 | /// @param handle 每100ms回调一次 57 | /// @param finishBlock 计时完成回调 58 | /// @param pauseBlock 计时暂停回调 59 | + (void)addTimerForTime:(NSTimeInterval)time 60 | identifier:(NSString *)identifier 61 | handle:(LSTTimerChangeBlock)handle 62 | finish:(LSTTimerFinishBlock)finishBlock 63 | pause:(LSTTimerPauseBlock)pauseBlock; 64 | /// 添加计时任务,持久化到硬盘 65 | /// @param time 时间长度 66 | /// @param identifier 计时任务标识 67 | /// @param handle 每100ms回调一次 68 | + (void)addDiskTimerForTime:(NSTimeInterval)time 69 | identifier:(NSString *)identifier 70 | handle:(LSTTimerChangeBlock)handle; 71 | /// 添加计时任务,持久化到硬盘 72 | /// @param time 添加计时任务,持久化到硬盘 73 | /// @param identifier 计时任务标识 74 | /// @param handle 每100ms回调一次 75 | /// @param finishBlock 计时完成回调 76 | /// @param pauseBlock 计时暂停回调 77 | + (void)addDiskTimerForTime:(NSTimeInterval)time 78 | identifier:(NSString *)identifier 79 | handle:(LSTTimerChangeBlock)handle 80 | finish:(LSTTimerFinishBlock)finishBlock 81 | pause:(LSTTimerPauseBlock)pauseBlock; 82 | 83 | 84 | 85 | #pragma mark - ***** 添加计时任务(1s回调一次) ***** 86 | /// 添加计时任务 87 | /// @param time 时间长度 88 | /// @param handle 计时任务标识 89 | + (void)addMinuteTimerForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle; 90 | /// 添加计时任务 91 | /// @param time 时间长度 92 | /// @param identifier 计时任务标识 93 | /// @param handle 每100ms回调一次 94 | + (void)addMinuteTimerForTime:(NSTimeInterval)time 95 | identifier:(NSString *)identifier 96 | handle:(LSTTimerChangeBlock)handle; 97 | 98 | /// 添加计时任务 99 | /// @param time 时间长度 100 | /// @param identifier 计时任务标识 101 | /// @param handle 每100ms回调一次 102 | /// @param finishBlock 计时完成回调 103 | /// @param pauseBlock 计时暂停回调 104 | + (void)addMinuteTimerForTime:(NSTimeInterval)time 105 | identifier:(NSString *)identifier 106 | handle:(LSTTimerChangeBlock)handle 107 | finish:(LSTTimerFinishBlock)finishBlock 108 | pause:(LSTTimerPauseBlock)pauseBlock; 109 | 110 | /// 添加计时任务 111 | /// @param time 时间长度 112 | /// @param identifier 计时任务标识 113 | /// @param handle 每100ms回调一次 114 | /// @param finishBlock 计时完成回调 115 | /// @param pauseBlock 计时暂停回调 116 | + (void)addDiskMinuteTimerForTime:(NSTimeInterval)time 117 | identifier:(NSString *)identifier 118 | handle:(LSTTimerChangeBlock)handle 119 | finish:(LSTTimerFinishBlock)finishBlock 120 | pause:(LSTTimerPauseBlock)pauseBlock; 121 | 122 | 123 | #pragma mark - ***** 获取计时任务时间间隔 ***** 124 | /// 通过任务标识获取 计时任务 间隔(毫秒) 125 | /// @param identifier 计时任务标识 126 | + (NSTimeInterval)getTimeIntervalForIdentifier:(NSString *)identifier; 127 | 128 | 129 | #pragma mark - ***** 暂停计时任务 ***** 130 | /// 通过标识暂停计时任务 131 | /// @param identifier 计时任务标识 132 | + (BOOL)pauseTimerForIdentifier:(NSString *)identifier; 133 | /// 暂停所有计时任务 134 | + (void)pauseAllTimer; 135 | 136 | #pragma mark - ***** 重启计时任务 ***** 137 | /// 通过标识重启 计时任务 138 | /// @param identifier 计时任务标识 139 | + (BOOL)restartTimerForIdentifier:(NSString *)identifier; 140 | /// 重启所有计时任务 141 | + (void)restartAllTimer; 142 | 143 | #pragma mark - ***** 重置计时任务(恢复初始状态) ***** 144 | /// 通过标识重置 计时任务 145 | /// @param identifier 计时任务标识 146 | + (BOOL)resetTimerForIdentifier:(NSString *)identifier; 147 | /// 重置所有计时任务 148 | + (void)resetAllTimer; 149 | 150 | #pragma mark - ***** 移除计时任务 ***** 151 | /// 通过标识移除计时任务 152 | /// @param identifier 计时任务标识 153 | + (BOOL)removeTimerForIdentifier:(NSString *)identifier; 154 | /// 移除所有计时任务 155 | + (void)removeAllTimer; 156 | 157 | #pragma mark - ***** 格式化时间 ***** 158 | /// 将毫秒数 格式化成 时:分:秒:毫秒 159 | /// @param time 时间长度(毫秒单位) 160 | /// @param handle 格式化完成回调 161 | + (void)formatDateForTime:(NSTimeInterval)time handle:(LSTTimerChangeBlock)handle; 162 | 163 | @end 164 | 165 | NS_ASSUME_NONNULL_END 166 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LSTTimer 性能和精度兼得的iOS计时器组件 2 | 3 | [![Platform](https://img.shields.io/badge/platform-iOS-red.svg)](https://developer.apple.com/iphone/index.action) [![Language](http://img.shields.io/badge/language-OC-yellow.svg?style=flat )](https://en.wikipedia.org/wiki/Objective-C) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://mit-license.org) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/LSTPopView.svg)](https://img.shields.io/cocoapods/v/LSTTimer.svg) 4 | 5 | ## 前言 6 | - 在项目开发中,计时器任务的需求很多, LSTTimer的出现就是为了更好统一管理项目中的计时器任务. 7 | - 欢迎coder们发现问题或者提供更好的idea,一起努力完善 8 | 9 | ## 博客地址 10 | - github: [https://github.com/LoSenTrad/LSTTimer](https://github.com/LoSenTrad/LSTTimer) 11 | - 简书: [https://www.jianshu.com/p/4f05c7e26bb1](https://www.jianshu.com/p/4f05c7e26bb1) 12 | 13 | ## 实现思路 14 | LSTTimer单例设计, 内部持有一个NSTimer和计时任务池, 所有的计时任务都被添加到任务池里面; NSTimer每100ms(毫秒)执行一次遍历计时任务池, 每个计时任务会进行的时间差运算. 15 | 16 | ## 特性 17 | 18 | - 提供丰富的api,简单入手使用 19 | - 单例设计,安全且占用内存少,统一管理app所有计时任务 20 | - 单计时器任务池设计,一个NSTimer完成多个计时任务 21 | - 计时任务精确度:100ms(100毫秒) 22 | - 支持计时格式--> 天:时:分:秒:毫秒 23 | - 支持硬盘持久化计时任务 24 | - 支持列表计时任务和各种花里胡哨的计时任务 25 | 26 | ## 版本更新历史[点我](https://github.com/LoSenTrad/LSTTimer/blob/master/UPDATE_HISTORY.md) 27 | 28 | ## 安装 29 | 30 | - CocoaPods安装: 在podfile文件中添加以下描述,然后 `pod install` 或者 `pod update` 31 | 32 | ```ruby 33 | pod 'LSTTimer' 34 | ``` 35 | - Carthage安装:(暂时未适配) 36 | 37 | ## 效果演示(gif图比较大,请耐心等待~) 38 | 39 | - 应用市场常用的示例场景 40 | - 支持 天:时:分:秒:毫秒 41 | - 列表计时方案:只需一个计时任务 42 | 43 | |常用示例场景
图片名称|列表倒计时
图片名称| 44 | |---|---| 45 | 46 | - 内存计时任务 47 | (当前页面添加计时任务,退出当前页面,计时任务不会停止,而是存在于app的整个生命周期内.当然了,也可以手动移除) 48 | 49 | |内存计时任务
图片名称| 50 | |---| 51 | 52 | - 硬盘计时任务 53 | 54 | (当前页面添加硬盘计时任务,退出app,计时任务保存在硬盘,再次打开进入app,如果计时任务没有结束,继续该计时任务) 55 | 56 | |自动规避键盘遮挡
图片名称| 57 | |---| 58 | 59 | 60 | ## 作者 61 | 62 | 490790096@qq.com, LoSenTrad@163.com 63 | 64 | ## 版权 65 | 66 | 尊重劳动成果, 人人有责. 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------