From 0f17f0257e9adfc03463180590d1a38026ee0ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=B5=AA?= Date: Tue, 13 Nov 2018 16:16:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ADD=E3=80=91=E6=9E=84=E5=BB=BALYToolsK?= =?UTF-8?q?it=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 + Example/LYToolsKit.xcodeproj/project.pbxproj | 19 +- .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Example/Podfile | 2 +- Example/Podfile.lock | 30 + .../Local Podspecs/LYToolsKit.podspec.json | 49 + Example/Pods/Manifest.lock | 30 + Example/Pods/Masonry/LICENSE | 19 + .../Masonry/Masonry/MASCompositeConstraint.h | 26 + .../Masonry/Masonry/MASCompositeConstraint.m | 183 +++ .../Masonry/Masonry/MASConstraint+Private.h | 66 + Example/Pods/Masonry/Masonry/MASConstraint.h | 272 +++ Example/Pods/Masonry/Masonry/MASConstraint.m | 301 ++++ .../Pods/Masonry/Masonry/MASConstraintMaker.h | 146 ++ .../Pods/Masonry/Masonry/MASConstraintMaker.m | 273 +++ .../Masonry/Masonry/MASLayoutConstraint.h | 22 + .../Masonry/Masonry/MASLayoutConstraint.m | 13 + Example/Pods/Masonry/Masonry/MASUtilities.h | 136 ++ .../Pods/Masonry/Masonry/MASViewAttribute.h | 49 + .../Pods/Masonry/Masonry/MASViewAttribute.m | 46 + .../Pods/Masonry/Masonry/MASViewConstraint.h | 48 + .../Pods/Masonry/Masonry/MASViewConstraint.m | 401 +++++ Example/Pods/Masonry/Masonry/Masonry.h | 29 + .../Masonry/Masonry/NSArray+MASAdditions.h | 72 + .../Masonry/Masonry/NSArray+MASAdditions.m | 162 ++ .../Masonry/NSArray+MASShorthandAdditions.h | 41 + .../NSLayoutConstraint+MASDebugAdditions.h | 16 + .../NSLayoutConstraint+MASDebugAdditions.m | 146 ++ .../Pods/Masonry/Masonry/View+MASAdditions.h | 111 ++ .../Pods/Masonry/Masonry/View+MASAdditions.m | 186 +++ .../Masonry/View+MASShorthandAdditions.h | 133 ++ .../Masonry/ViewController+MASAdditions.h | 30 + .../Masonry/ViewController+MASAdditions.m | 39 + Example/Pods/Masonry/README.md | 415 +++++ Example/Pods/Pods.xcodeproj/project.pbxproj | 1463 +++++++++++++++++ .../LYToolsKit/Info.plist | 26 + .../LYToolsKit/LYToolsKit-dummy.m | 5 + .../LYToolsKit/LYToolsKit-prefix.pch | 12 + .../LYToolsKit/LYToolsKit-umbrella.h | 47 + .../LYToolsKit/LYToolsKit.modulemap | 6 + .../LYToolsKit/LYToolsKit.xcconfig | 10 + .../Target Support Files/Masonry/Info.plist | 26 + .../Masonry/Masonry-dummy.m | 5 + .../Masonry/Masonry-prefix.pch | 12 + .../Masonry/Masonry-umbrella.h | 31 + .../Masonry/Masonry.modulemap | 6 + .../Masonry/Masonry.xcconfig | 9 + .../Pods-LYToolsKit_Example/Info.plist | 26 + ...ToolsKit_Example-acknowledgements.markdown | 48 + ...-LYToolsKit_Example-acknowledgements.plist | 86 + .../Pods-LYToolsKit_Example-dummy.m | 5 + .../Pods-LYToolsKit_Example-frameworks.sh | 155 ++ .../Pods-LYToolsKit_Example-resources.sh | 118 ++ .../Pods-LYToolsKit_Example-umbrella.h | 16 + .../Pods-LYToolsKit_Example.debug.xcconfig | 9 + .../Pods-LYToolsKit_Example.modulemap | 6 + .../Pods-LYToolsKit_Example.release.xcconfig | 9 + .../Pods-LYToolsKit_Tests/Info.plist | 26 + ...LYToolsKit_Tests-acknowledgements.markdown | 3 + ...ds-LYToolsKit_Tests-acknowledgements.plist | 29 + .../Pods-LYToolsKit_Tests-dummy.m | 5 + .../Pods-LYToolsKit_Tests-frameworks.sh | 146 ++ .../Pods-LYToolsKit_Tests-resources.sh | 118 ++ .../Pods-LYToolsKit_Tests-umbrella.h | 16 + .../Pods-LYToolsKit_Tests.debug.xcconfig | 8 + .../Pods-LYToolsKit_Tests.modulemap | 6 + .../Pods-LYToolsKit_Tests.release.xcconfig | 8 + Example/Tests/Tests.m | 1 + LYToolsKit.podspec | 47 +- LYToolsKit/Assets/.gitkeep | 0 LYToolsKit/Classes/.gitkeep | 0 LYToolsKit/Classes/ReplaceMe.m | 0 LYToolsKit/Foundation/LYFoundation.h | 41 + .../Foundation/NSDate/NSDate+LYString.h | 38 + .../Foundation/NSDate/NSDate+LYString.m | 81 + .../Foundation/NSObject/NSObject+LYHook.h | 34 + .../Foundation/NSObject/NSObject+LYHook.m | 50 + .../Foundation/NSString/NSString+LYJS.h | 40 + .../Foundation/NSString/NSString+LYJS.m | 77 + .../Foundation/NSString/NSString+LYJudge.h | 22 + .../Foundation/NSString/NSString+LYJudge.m | 26 + .../Foundation/NSString/NSString+LYURL.h | 59 + .../Foundation/NSString/NSString+LYURL.m | 92 ++ .../Foundation/NSString/NSString+LYUnits.h | 20 + .../Foundation/NSString/NSString+LYUnits.m | 31 + LYToolsKit/LYToolsKit.h | 15 + LYToolsKit/UI/LYUI.h | 47 + LYToolsKit/UI/Macro/LYUIMacro.h | 20 + .../UI/UI/Reachability/LYReachability.h | 64 + .../UI/UI/Reachability/LYReachability.m | 242 +++ LYToolsKit/UI/UI/UIAlert/LYAlertController.h | 114 ++ LYToolsKit/UI/UI/UIAlert/LYAlertController.m | 147 ++ LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.h | 19 + LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.m | 90 + LYToolsKit/UI/UI/UIColor/UIColor+LYString.h | 40 + LYToolsKit/UI/UI/UIColor/UIColor+LYString.m | 169 ++ .../UI/UI/UIDevice/UIDevice+LYHardware.h | 50 + .../UI/UI/UIDevice/UIDevice+LYHardware.m | 167 ++ LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.h | 24 + LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.m | 43 + LYToolsKit/UI/UI/UIImage/UIImage+LYImage.h | 52 + LYToolsKit/UI/UI/UIImage/UIImage+LYImage.m | 166 ++ LYToolsKit/UI/UI/UIImage/UIImage+LYResize.h | 137 ++ LYToolsKit/UI/UI/UIImage/UIImage+LYResize.m | 614 +++++++ LYToolsKit/UI/UI/UIView/UIView+LYCut.h | 28 + LYToolsKit/UI/UI/UIView/UIView+LYCut.m | 40 + .../UI/UI/UIView/UIView+LYEnlargeTouchArea.h | 19 + .../UI/UI/UIView/UIView+LYEnlargeTouchArea.m | 46 + LYToolsKit/UI/UI/UIView/UIView+LYTouch.h | 22 + LYToolsKit/UI/UI/UIView/UIView+LYTouch.m | 37 + LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.h | 58 + LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.m | 36 + .../UI/UI/UIViewExt/UIImageView+LYExt.h | 25 + .../UI/UI/UIViewExt/UIImageView+LYExt.m | 19 + LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.h | 29 + LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.m | 21 + .../UI/UI/UIViewExt/UITextField+LYExt.h | 26 + .../UI/UI/UIViewExt/UITextField+LYExt.m | 20 + LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.h | 27 + LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.m | 22 + LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.h | 39 + LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.m | 142 ++ LYToolsKit/Utility/LYUtility.h | 20 + .../Utility/UIApplication/LYTouchTrace.h | 29 + .../Utility/UIApplication/LYTouchTrace.m | 283 ++++ LYToolsKit/Utility/UILabel/UICountingLabel.h | 36 + LYToolsKit/Utility/UILabel/UICountingLabel.m | 263 +++ LYToolsKit/Utility/UIView/LYCoverView.h | 31 + LYToolsKit/Utility/UIView/LYCoverView.m | 81 + 130 files changed, 10281 insertions(+), 33 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 Example/LYToolsKit.xcworkspace/contents.xcworkspacedata create mode 100644 Example/LYToolsKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Example/Podfile.lock create mode 100644 Example/Pods/Local Podspecs/LYToolsKit.podspec.json create mode 100644 Example/Pods/Manifest.lock create mode 100644 Example/Pods/Masonry/LICENSE create mode 100644 Example/Pods/Masonry/Masonry/MASCompositeConstraint.h create mode 100644 Example/Pods/Masonry/Masonry/MASCompositeConstraint.m create mode 100644 Example/Pods/Masonry/Masonry/MASConstraint+Private.h create mode 100644 Example/Pods/Masonry/Masonry/MASConstraint.h create mode 100644 Example/Pods/Masonry/Masonry/MASConstraint.m create mode 100644 Example/Pods/Masonry/Masonry/MASConstraintMaker.h create mode 100644 Example/Pods/Masonry/Masonry/MASConstraintMaker.m create mode 100644 Example/Pods/Masonry/Masonry/MASLayoutConstraint.h create mode 100644 Example/Pods/Masonry/Masonry/MASLayoutConstraint.m create mode 100644 Example/Pods/Masonry/Masonry/MASUtilities.h create mode 100644 Example/Pods/Masonry/Masonry/MASViewAttribute.h create mode 100644 Example/Pods/Masonry/Masonry/MASViewAttribute.m create mode 100644 Example/Pods/Masonry/Masonry/MASViewConstraint.h create mode 100644 Example/Pods/Masonry/Masonry/MASViewConstraint.m create mode 100644 Example/Pods/Masonry/Masonry/Masonry.h create mode 100644 Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m create mode 100644 Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m create mode 100644 Example/Pods/Masonry/Masonry/View+MASAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/View+MASAdditions.m create mode 100644 Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h create mode 100644 Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m create mode 100644 Example/Pods/Masonry/README.md create mode 100644 Example/Pods/Pods.xcodeproj/project.pbxproj create mode 100644 Example/Pods/Target Support Files/LYToolsKit/Info.plist create mode 100644 Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-dummy.m create mode 100644 Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-prefix.pch create mode 100644 Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-umbrella.h create mode 100644 Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.modulemap create mode 100644 Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.xcconfig create mode 100644 Example/Pods/Target Support Files/Masonry/Info.plist create mode 100644 Example/Pods/Target Support Files/Masonry/Masonry-dummy.m create mode 100644 Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch create mode 100644 Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h create mode 100644 Example/Pods/Target Support Files/Masonry/Masonry.modulemap create mode 100644 Example/Pods/Target Support Files/Masonry/Masonry.xcconfig create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Info.plist create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.markdown create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.plist create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-dummy.m create mode 100755 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-frameworks.sh create mode 100755 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-resources.sh create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-umbrella.h create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.debug.xcconfig create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.release.xcconfig create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Info.plist create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.markdown create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.plist create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-dummy.m create mode 100755 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-frameworks.sh create mode 100755 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-resources.sh create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-umbrella.h create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.debug.xcconfig create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap create mode 100644 Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.release.xcconfig delete mode 100644 LYToolsKit/Assets/.gitkeep delete mode 100644 LYToolsKit/Classes/.gitkeep delete mode 100644 LYToolsKit/Classes/ReplaceMe.m create mode 100644 LYToolsKit/Foundation/LYFoundation.h create mode 100644 LYToolsKit/Foundation/NSDate/NSDate+LYString.h create mode 100644 LYToolsKit/Foundation/NSDate/NSDate+LYString.m create mode 100644 LYToolsKit/Foundation/NSObject/NSObject+LYHook.h create mode 100644 LYToolsKit/Foundation/NSObject/NSObject+LYHook.m create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYJS.h create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYJS.m create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYJudge.h create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYJudge.m create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYURL.h create mode 100644 LYToolsKit/Foundation/NSString/NSString+LYURL.m create mode 100755 LYToolsKit/Foundation/NSString/NSString+LYUnits.h create mode 100755 LYToolsKit/Foundation/NSString/NSString+LYUnits.m create mode 100644 LYToolsKit/LYToolsKit.h create mode 100644 LYToolsKit/UI/LYUI.h create mode 100644 LYToolsKit/UI/Macro/LYUIMacro.h create mode 100644 LYToolsKit/UI/UI/Reachability/LYReachability.h create mode 100644 LYToolsKit/UI/UI/Reachability/LYReachability.m create mode 100644 LYToolsKit/UI/UI/UIAlert/LYAlertController.h create mode 100644 LYToolsKit/UI/UI/UIAlert/LYAlertController.m create mode 100644 LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.h create mode 100644 LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.m create mode 100644 LYToolsKit/UI/UI/UIColor/UIColor+LYString.h create mode 100644 LYToolsKit/UI/UI/UIColor/UIColor+LYString.m create mode 100644 LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.h create mode 100644 LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.m create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.h create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.m create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYImage.h create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYImage.m create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYResize.h create mode 100644 LYToolsKit/UI/UI/UIImage/UIImage+LYResize.m create mode 100755 LYToolsKit/UI/UI/UIView/UIView+LYCut.h create mode 100755 LYToolsKit/UI/UI/UIView/UIView+LYCut.m create mode 100644 LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.h create mode 100644 LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.m create mode 100644 LYToolsKit/UI/UI/UIView/UIView+LYTouch.h create mode 100644 LYToolsKit/UI/UI/UIView/UIView+LYTouch.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.m create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.h create mode 100644 LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.m create mode 100644 LYToolsKit/Utility/LYUtility.h create mode 100755 LYToolsKit/Utility/UIApplication/LYTouchTrace.h create mode 100755 LYToolsKit/Utility/UIApplication/LYTouchTrace.m create mode 100755 LYToolsKit/Utility/UILabel/UICountingLabel.h create mode 100755 LYToolsKit/Utility/UILabel/UICountingLabel.m create mode 100644 LYToolsKit/Utility/UIView/LYCoverView.h create mode 100644 LYToolsKit/Utility/UIView/LYCoverView.m diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..fd8b9ce --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# Change Log +--- +###【0.1.0】 +-【ADD】构建LYToolsKit本地库 +-【DEL】删除部分依赖,移除几个库文件 +-【ADD】屏幕尺寸宏 diff --git a/Example/LYToolsKit.xcodeproj/project.pbxproj b/Example/LYToolsKit.xcodeproj/project.pbxproj index e15897b..a1a09e8 100644 --- a/Example/LYToolsKit.xcodeproj/project.pbxproj +++ b/Example/LYToolsKit.xcodeproj/project.pbxproj @@ -58,14 +58,15 @@ 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 64056FE0219ABEE700BAA038 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; name = CHANGELOG.md; path = ../CHANGELOG.md; sourceTree = ""; }; 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 76E7A6CDA8B2149938673FD5 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; + 76E7A6CDA8B2149938673FD5 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 79E87B4827C7BC097BE8F434 /* Pods-LYToolsKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LYToolsKit_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.debug.xcconfig"; sourceTree = ""; }; 7CB206E00401861E57D0D7AC /* Pods_LYToolsKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LYToolsKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 804D70C153F73704C47B1EFF /* Pods-LYToolsKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LYToolsKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.debug.xcconfig"; sourceTree = ""; }; 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C26F0866FF7B175C72571907 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; name = README.md; path = ../README.md; sourceTree = ""; }; - DD134B59D1192D5B7B838120 /* LYToolsKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; name = LYToolsKit.podspec; path = ../LYToolsKit.podspec; sourceTree = ""; }; + C26F0866FF7B175C72571907 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + DD134B59D1192D5B7B838120 /* LYToolsKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LYToolsKit.podspec; path = ../LYToolsKit.podspec; sourceTree = ""; }; EDAD06EECFAF5C7B2168F5A4 /* Pods-LYToolsKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LYToolsKit_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -189,6 +190,7 @@ 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { isa = PBXGroup; children = ( + 64056FE0219ABEE700BAA038 /* CHANGELOG.md */, DD134B59D1192D5B7B838120 /* LYToolsKit.podspec */, C26F0866FF7B175C72571907 /* README.md */, 76E7A6CDA8B2149938673FD5 /* LICENSE */, @@ -247,6 +249,9 @@ LastUpgradeCheck = 0720; ORGANIZATIONNAME = yyly; TargetAttributes = { + 6003F589195388D20070C39A = { + DevelopmentTeam = 2V8GEF8RXB; + }; 6003F5AD195388D20070C39A = { TestTargetID = 6003F589195388D20070C39A; }; @@ -326,12 +331,14 @@ inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-frameworks.sh", "${BUILT_PRODUCTS_DIR}/LYToolsKit/LYToolsKit.framework", + "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", ); name = "[CP] Embed Pods Frameworks"; outputFileListPaths = ( ); outputPaths = ( "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LYToolsKit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -497,11 +504,12 @@ baseConfigurationReference = 804D70C153F73704C47B1EFF /* Pods-LYToolsKit_Example.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 2V8GEF8RXB; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "LYToolsKit/LYToolsKit-Prefix.pch"; INFOPLIST_FILE = "LYToolsKit/LYToolsKit-Info.plist"; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.mingyuegucheng.Test; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; @@ -512,11 +520,12 @@ baseConfigurationReference = 33F8121BB326A3D1184833E0 /* Pods-LYToolsKit_Example.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + DEVELOPMENT_TEAM = 2V8GEF8RXB; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "LYToolsKit/LYToolsKit-Prefix.pch"; INFOPLIST_FILE = "LYToolsKit/LYToolsKit-Info.plist"; MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_BUNDLE_IDENTIFIER = com.mingyuegucheng.Test; PRODUCT_NAME = "$(TARGET_NAME)"; WRAPPER_EXTENSION = app; }; diff --git a/Example/LYToolsKit.xcworkspace/contents.xcworkspacedata b/Example/LYToolsKit.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..bd25390 --- /dev/null +++ b/Example/LYToolsKit.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Example/LYToolsKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Example/LYToolsKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Example/LYToolsKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Example/Podfile b/Example/Podfile index f444431..c45be7d 100644 --- a/Example/Podfile +++ b/Example/Podfile @@ -1,4 +1,4 @@ -use_frameworks! +!use_frameworks! target 'LYToolsKit_Example' do pod 'LYToolsKit', :path => '../' diff --git a/Example/Podfile.lock b/Example/Podfile.lock new file mode 100644 index 0000000..279fb58 --- /dev/null +++ b/Example/Podfile.lock @@ -0,0 +1,30 @@ +PODS: + - LYToolsKit (0.1.0): + - LYToolsKit/Foundation (= 0.1.0) + - LYToolsKit/UI (= 0.1.0) + - LYToolsKit/Utility (= 0.1.0) + - LYToolsKit/Foundation (0.1.0) + - LYToolsKit/UI (0.1.0) + - LYToolsKit/Utility (0.1.0): + - LYToolsKit/UI + - Masonry + - Masonry (1.1.0) + +DEPENDENCIES: + - LYToolsKit (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Masonry + +EXTERNAL SOURCES: + LYToolsKit: + :path: "../" + +SPEC CHECKSUMS: + LYToolsKit: c4b27e0e6f3239e107ec12561f6ba43db738ecb1 + Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 + +PODFILE CHECKSUM: 65c98e54016424e0cbfc45321fc4dc72ccb68329 + +COCOAPODS: 1.5.3 diff --git a/Example/Pods/Local Podspecs/LYToolsKit.podspec.json b/Example/Pods/Local Podspecs/LYToolsKit.podspec.json new file mode 100644 index 0000000..d6dc6d7 --- /dev/null +++ b/Example/Pods/Local Podspecs/LYToolsKit.podspec.json @@ -0,0 +1,49 @@ +{ + "name": "LYToolsKit", + "version": "0.1.0", + "summary": "LYToolsKit is Foundation|UI|Utility SDK.", + "homepage": "https://github.com/yyly/LYToolsKit", + "license": { + "type": "MIT", + "file": "LICENSE" + }, + "authors": { + "yyly": "mingyuegucheng@icloud.com" + }, + "source": { + "git": "https://github.com/yyly/LYToolsKit.git", + "tag": "0.1.0" + }, + "platforms": { + "ios": "9.0" + }, + "source_files": "LYToolsKit/LYToolsKit.h", + "subspecs": [ + { + "name": "Foundation", + "source_files": "LYToolsKit/Foundation/**/*.{h,m}", + "pod_target_xcconfig": { + "OTHER_LDFLAGS": "-ObjC" + } + }, + { + "name": "UI", + "source_files": "LYToolsKit/UI/**/*.{h,m}", + "pod_target_xcconfig": { + "OTHER_LDFLAGS": "-ObjC" + } + }, + { + "name": "Utility", + "source_files": "LYToolsKit/Utility/**/*.{h,m}", + "dependencies": { + "Masonry": [ + + ], + "LYToolsKit/UI": [ + + ] + } + } + ] +} diff --git a/Example/Pods/Manifest.lock b/Example/Pods/Manifest.lock new file mode 100644 index 0000000..279fb58 --- /dev/null +++ b/Example/Pods/Manifest.lock @@ -0,0 +1,30 @@ +PODS: + - LYToolsKit (0.1.0): + - LYToolsKit/Foundation (= 0.1.0) + - LYToolsKit/UI (= 0.1.0) + - LYToolsKit/Utility (= 0.1.0) + - LYToolsKit/Foundation (0.1.0) + - LYToolsKit/UI (0.1.0) + - LYToolsKit/Utility (0.1.0): + - LYToolsKit/UI + - Masonry + - Masonry (1.1.0) + +DEPENDENCIES: + - LYToolsKit (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Masonry + +EXTERNAL SOURCES: + LYToolsKit: + :path: "../" + +SPEC CHECKSUMS: + LYToolsKit: c4b27e0e6f3239e107ec12561f6ba43db738ecb1 + Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 + +PODFILE CHECKSUM: 65c98e54016424e0cbfc45321fc4dc72ccb68329 + +COCOAPODS: 1.5.3 diff --git a/Example/Pods/Masonry/LICENSE b/Example/Pods/Masonry/LICENSE new file mode 100644 index 0000000..a843c00 --- /dev/null +++ b/Example/Pods/Masonry/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/Example/Pods/Masonry/Masonry/MASCompositeConstraint.h b/Example/Pods/Masonry/Masonry/MASCompositeConstraint.h new file mode 100644 index 0000000..934c6f1 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASCompositeConstraint.h @@ -0,0 +1,26 @@ +// +// MASCompositeConstraint.h +// Masonry +// +// Created by Jonas Budelmann on 21/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASConstraint.h" +#import "MASUtilities.h" + +/** + * A group of MASConstraint objects + */ +@interface MASCompositeConstraint : MASConstraint + +/** + * Creates a composite with a predefined array of children + * + * @param children child MASConstraints + * + * @return a composite constraint + */ +- (id)initWithChildren:(NSArray *)children; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASCompositeConstraint.m b/Example/Pods/Masonry/Masonry/MASCompositeConstraint.m new file mode 100644 index 0000000..2002a40 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASCompositeConstraint.m @@ -0,0 +1,183 @@ +// +// MASCompositeConstraint.m +// Masonry +// +// Created by Jonas Budelmann on 21/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASCompositeConstraint.h" +#import "MASConstraint+Private.h" + +@interface MASCompositeConstraint () + +@property (nonatomic, strong) id mas_key; +@property (nonatomic, strong) NSMutableArray *childConstraints; + +@end + +@implementation MASCompositeConstraint + +- (id)initWithChildren:(NSArray *)children { + self = [super init]; + if (!self) return nil; + + _childConstraints = [children mutableCopy]; + for (MASConstraint *constraint in _childConstraints) { + constraint.delegate = self; + } + + return self; +} + +#pragma mark - MASConstraintDelegate + +- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { + NSUInteger index = [self.childConstraints indexOfObject:constraint]; + NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); + [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; +} + +- (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { + id strongDelegate = self.delegate; + MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; + newConstraint.delegate = self; + [self.childConstraints addObject:newConstraint]; + return newConstraint; +} + +#pragma mark - NSLayoutConstraint multiplier proxies + +- (MASConstraint * (^)(CGFloat))multipliedBy { + return ^id(CGFloat multiplier) { + for (MASConstraint *constraint in self.childConstraints) { + constraint.multipliedBy(multiplier); + } + return self; + }; +} + +- (MASConstraint * (^)(CGFloat))dividedBy { + return ^id(CGFloat divider) { + for (MASConstraint *constraint in self.childConstraints) { + constraint.dividedBy(divider); + } + return self; + }; +} + +#pragma mark - MASLayoutPriority proxy + +- (MASConstraint * (^)(MASLayoutPriority))priority { + return ^id(MASLayoutPriority priority) { + for (MASConstraint *constraint in self.childConstraints) { + constraint.priority(priority); + } + return self; + }; +} + +#pragma mark - NSLayoutRelation proxy + +- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { + return ^id(id attr, NSLayoutRelation relation) { + for (MASConstraint *constraint in self.childConstraints.copy) { + constraint.equalToWithRelation(attr, relation); + } + return self; + }; +} + +#pragma mark - attribute chaining + +- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { + [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; + return self; +} + +#pragma mark - Animator proxy + +#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) + +- (MASConstraint *)animator { + for (MASConstraint *constraint in self.childConstraints) { + [constraint animator]; + } + return self; +} + +#endif + +#pragma mark - debug helpers + +- (MASConstraint * (^)(id))key { + return ^id(id key) { + self.mas_key = key; + int i = 0; + for (MASConstraint *constraint in self.childConstraints) { + constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); + } + return self; + }; +} + +#pragma mark - NSLayoutConstraint constant setters + +- (void)setInsets:(MASEdgeInsets)insets { + for (MASConstraint *constraint in self.childConstraints) { + constraint.insets = insets; + } +} + +- (void)setInset:(CGFloat)inset { + for (MASConstraint *constraint in self.childConstraints) { + constraint.inset = inset; + } +} + +- (void)setOffset:(CGFloat)offset { + for (MASConstraint *constraint in self.childConstraints) { + constraint.offset = offset; + } +} + +- (void)setSizeOffset:(CGSize)sizeOffset { + for (MASConstraint *constraint in self.childConstraints) { + constraint.sizeOffset = sizeOffset; + } +} + +- (void)setCenterOffset:(CGPoint)centerOffset { + for (MASConstraint *constraint in self.childConstraints) { + constraint.centerOffset = centerOffset; + } +} + +#pragma mark - MASConstraint + +- (void)activate { + for (MASConstraint *constraint in self.childConstraints) { + [constraint activate]; + } +} + +- (void)deactivate { + for (MASConstraint *constraint in self.childConstraints) { + [constraint deactivate]; + } +} + +- (void)install { + for (MASConstraint *constraint in self.childConstraints) { + constraint.updateExisting = self.updateExisting; + [constraint install]; + } +} + +- (void)uninstall { + for (MASConstraint *constraint in self.childConstraints) { + [constraint uninstall]; + } +} + +@end diff --git a/Example/Pods/Masonry/Masonry/MASConstraint+Private.h b/Example/Pods/Masonry/Masonry/MASConstraint+Private.h new file mode 100644 index 0000000..ee0fd96 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASConstraint+Private.h @@ -0,0 +1,66 @@ +// +// MASConstraint+Private.h +// Masonry +// +// Created by Nick Tymchenko on 29/04/14. +// Copyright (c) 2014 cloudling. All rights reserved. +// + +#import "MASConstraint.h" + +@protocol MASConstraintDelegate; + + +@interface MASConstraint () + +/** + * Whether or not to check for an existing constraint instead of adding constraint + */ +@property (nonatomic, assign) BOOL updateExisting; + +/** + * Usually MASConstraintMaker but could be a parent MASConstraint + */ +@property (nonatomic, weak) id delegate; + +/** + * Based on a provided value type, is equal to calling: + * NSNumber - setOffset: + * NSValue with CGPoint - setPointOffset: + * NSValue with CGSize - setSizeOffset: + * NSValue with MASEdgeInsets - setInsets: + */ +- (void)setLayoutConstantWithValue:(NSValue *)value; + +@end + + +@interface MASConstraint (Abstract) + +/** + * Sets the constraint relation to given NSLayoutRelation + * returns a block which accepts one of the following: + * MASViewAttribute, UIView, NSValue, NSArray + * see readme for more details. + */ +- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; + +/** + * Override to set a custom chaining behaviour + */ +- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; + +@end + + +@protocol MASConstraintDelegate + +/** + * Notifies the delegate when the constraint needs to be replaced with another constraint. For example + * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks + */ +- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; + +- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASConstraint.h b/Example/Pods/Masonry/Masonry/MASConstraint.h new file mode 100644 index 0000000..3eaa8a1 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASConstraint.h @@ -0,0 +1,272 @@ +// +// MASConstraint.h +// Masonry +// +// Created by Jonas Budelmann on 22/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASUtilities.h" + +/** + * Enables Constraints to be created with chainable syntax + * Constraint can represent single NSLayoutConstraint (MASViewConstraint) + * or a group of NSLayoutConstraints (MASComposisteConstraint) + */ +@interface MASConstraint : NSObject + +// Chaining Support + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight + */ +- (MASConstraint * (^)(MASEdgeInsets insets))insets; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight + */ +- (MASConstraint * (^)(CGFloat inset))inset; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeWidth, NSLayoutAttributeHeight + */ +- (MASConstraint * (^)(CGSize offset))sizeOffset; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY + */ +- (MASConstraint * (^)(CGPoint offset))centerOffset; + +/** + * Modifies the NSLayoutConstraint constant + */ +- (MASConstraint * (^)(CGFloat offset))offset; + +/** + * Modifies the NSLayoutConstraint constant based on a value type + */ +- (MASConstraint * (^)(NSValue *value))valueOffset; + +/** + * Sets the NSLayoutConstraint multiplier property + */ +- (MASConstraint * (^)(CGFloat multiplier))multipliedBy; + +/** + * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy + */ +- (MASConstraint * (^)(CGFloat divider))dividedBy; + +/** + * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority + */ +- (MASConstraint * (^)(MASLayoutPriority priority))priority; + +/** + * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow + */ +- (MASConstraint * (^)(void))priorityLow; + +/** + * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium + */ +- (MASConstraint * (^)(void))priorityMedium; + +/** + * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh + */ +- (MASConstraint * (^)(void))priorityHigh; + +/** + * Sets the constraint relation to NSLayoutRelationEqual + * returns a block which accepts one of the following: + * MASViewAttribute, UIView, NSValue, NSArray + * see readme for more details. + */ +- (MASConstraint * (^)(id attr))equalTo; + +/** + * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual + * returns a block which accepts one of the following: + * MASViewAttribute, UIView, NSValue, NSArray + * see readme for more details. + */ +- (MASConstraint * (^)(id attr))greaterThanOrEqualTo; + +/** + * Sets the constraint relation to NSLayoutRelationLessThanOrEqual + * returns a block which accepts one of the following: + * MASViewAttribute, UIView, NSValue, NSArray + * see readme for more details. + */ +- (MASConstraint * (^)(id attr))lessThanOrEqualTo; + +/** + * Optional semantic property which has no effect but improves the readability of constraint + */ +- (MASConstraint *)with; + +/** + * Optional semantic property which has no effect but improves the readability of constraint + */ +- (MASConstraint *)and; + +/** + * Creates a new MASCompositeConstraint with the called attribute and reciever + */ +- (MASConstraint *)left; +- (MASConstraint *)top; +- (MASConstraint *)right; +- (MASConstraint *)bottom; +- (MASConstraint *)leading; +- (MASConstraint *)trailing; +- (MASConstraint *)width; +- (MASConstraint *)height; +- (MASConstraint *)centerX; +- (MASConstraint *)centerY; +- (MASConstraint *)baseline; + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +- (MASConstraint *)firstBaseline; +- (MASConstraint *)lastBaseline; + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +- (MASConstraint *)leftMargin; +- (MASConstraint *)rightMargin; +- (MASConstraint *)topMargin; +- (MASConstraint *)bottomMargin; +- (MASConstraint *)leadingMargin; +- (MASConstraint *)trailingMargin; +- (MASConstraint *)centerXWithinMargins; +- (MASConstraint *)centerYWithinMargins; + +#endif + + +/** + * Sets the constraint debug name + */ +- (MASConstraint * (^)(id key))key; + +// NSLayoutConstraint constant Setters +// for use outside of mas_updateConstraints/mas_makeConstraints blocks + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight + */ +- (void)setInsets:(MASEdgeInsets)insets; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight + */ +- (void)setInset:(CGFloat)inset; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeWidth, NSLayoutAttributeHeight + */ +- (void)setSizeOffset:(CGSize)sizeOffset; + +/** + * Modifies the NSLayoutConstraint constant, + * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following + * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY + */ +- (void)setCenterOffset:(CGPoint)centerOffset; + +/** + * Modifies the NSLayoutConstraint constant + */ +- (void)setOffset:(CGFloat)offset; + + +// NSLayoutConstraint Installation support + +#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) +/** + * Whether or not to go through the animator proxy when modifying the constraint + */ +@property (nonatomic, copy, readonly) MASConstraint *animator; +#endif + +/** + * Activates an NSLayoutConstraint if it's supported by an OS. + * Invokes install otherwise. + */ +- (void)activate; + +/** + * Deactivates previously installed/activated NSLayoutConstraint. + */ +- (void)deactivate; + +/** + * Creates a NSLayoutConstraint and adds it to the appropriate view. + */ +- (void)install; + +/** + * Removes previously installed NSLayoutConstraint + */ +- (void)uninstall; + +@end + + +/** + * Convenience auto-boxing macros for MASConstraint methods. + * + * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax. + * A potential drawback of this is that the unprefixed macros will appear in global scope. + */ +#define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__))) +#define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__))) +#define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__))) + +#define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__))) + + +#ifdef MAS_SHORTHAND_GLOBALS + +#define equalTo(...) mas_equalTo(__VA_ARGS__) +#define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__) +#define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__) + +#define offset(...) mas_offset(__VA_ARGS__) + +#endif + + +@interface MASConstraint (AutoboxingSupport) + +/** + * Aliases to corresponding relation methods (for shorthand macros) + * Also needed to aid autocompletion + */ +- (MASConstraint * (^)(id attr))mas_equalTo; +- (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo; +- (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo; + +/** + * A dummy method to aid autocompletion + */ +- (MASConstraint * (^)(id offset))mas_offset; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASConstraint.m b/Example/Pods/Masonry/Masonry/MASConstraint.m new file mode 100644 index 0000000..52de590 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASConstraint.m @@ -0,0 +1,301 @@ +// +// MASConstraint.m +// Masonry +// +// Created by Nick Tymchenko on 1/20/14. +// + +#import "MASConstraint.h" +#import "MASConstraint+Private.h" + +#define MASMethodNotImplemented() \ + @throw [NSException exceptionWithName:NSInternalInconsistencyException \ + reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \ + userInfo:nil] + +@implementation MASConstraint + +#pragma mark - Init + +- (id)init { + NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly."); + return [super init]; +} + +#pragma mark - NSLayoutRelation proxies + +- (MASConstraint * (^)(id))equalTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationEqual); + }; +} + +- (MASConstraint * (^)(id))mas_equalTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationEqual); + }; +} + +- (MASConstraint * (^)(id))greaterThanOrEqualTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); + }; +} + +- (MASConstraint * (^)(id))mas_greaterThanOrEqualTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); + }; +} + +- (MASConstraint * (^)(id))lessThanOrEqualTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); + }; +} + +- (MASConstraint * (^)(id))mas_lessThanOrEqualTo { + return ^id(id attribute) { + return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); + }; +} + +#pragma mark - MASLayoutPriority proxies + +- (MASConstraint * (^)(void))priorityLow { + return ^id{ + self.priority(MASLayoutPriorityDefaultLow); + return self; + }; +} + +- (MASConstraint * (^)(void))priorityMedium { + return ^id{ + self.priority(MASLayoutPriorityDefaultMedium); + return self; + }; +} + +- (MASConstraint * (^)(void))priorityHigh { + return ^id{ + self.priority(MASLayoutPriorityDefaultHigh); + return self; + }; +} + +#pragma mark - NSLayoutConstraint constant proxies + +- (MASConstraint * (^)(MASEdgeInsets))insets { + return ^id(MASEdgeInsets insets){ + self.insets = insets; + return self; + }; +} + +- (MASConstraint * (^)(CGFloat))inset { + return ^id(CGFloat inset){ + self.inset = inset; + return self; + }; +} + +- (MASConstraint * (^)(CGSize))sizeOffset { + return ^id(CGSize offset) { + self.sizeOffset = offset; + return self; + }; +} + +- (MASConstraint * (^)(CGPoint))centerOffset { + return ^id(CGPoint offset) { + self.centerOffset = offset; + return self; + }; +} + +- (MASConstraint * (^)(CGFloat))offset { + return ^id(CGFloat offset){ + self.offset = offset; + return self; + }; +} + +- (MASConstraint * (^)(NSValue *value))valueOffset { + return ^id(NSValue *offset) { + NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset); + [self setLayoutConstantWithValue:offset]; + return self; + }; +} + +- (MASConstraint * (^)(id offset))mas_offset { + // Will never be called due to macro + return nil; +} + +#pragma mark - NSLayoutConstraint constant setter + +- (void)setLayoutConstantWithValue:(NSValue *)value { + if ([value isKindOfClass:NSNumber.class]) { + self.offset = [(NSNumber *)value doubleValue]; + } else if (strcmp(value.objCType, @encode(CGPoint)) == 0) { + CGPoint point; + [value getValue:&point]; + self.centerOffset = point; + } else if (strcmp(value.objCType, @encode(CGSize)) == 0) { + CGSize size; + [value getValue:&size]; + self.sizeOffset = size; + } else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) { + MASEdgeInsets insets; + [value getValue:&insets]; + self.insets = insets; + } else { + NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value); + } +} + +#pragma mark - Semantic properties + +- (MASConstraint *)with { + return self; +} + +- (MASConstraint *)and { + return self; +} + +#pragma mark - Chaining + +- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute { + MASMethodNotImplemented(); +} + +- (MASConstraint *)left { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft]; +} + +- (MASConstraint *)top { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop]; +} + +- (MASConstraint *)right { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight]; +} + +- (MASConstraint *)bottom { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom]; +} + +- (MASConstraint *)leading { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading]; +} + +- (MASConstraint *)trailing { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing]; +} + +- (MASConstraint *)width { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth]; +} + +- (MASConstraint *)height { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight]; +} + +- (MASConstraint *)centerX { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX]; +} + +- (MASConstraint *)centerY { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY]; +} + +- (MASConstraint *)baseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline]; +} + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +- (MASConstraint *)firstBaseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline]; +} +- (MASConstraint *)lastBaseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline]; +} + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +- (MASConstraint *)leftMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin]; +} + +- (MASConstraint *)rightMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin]; +} + +- (MASConstraint *)topMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin]; +} + +- (MASConstraint *)bottomMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin]; +} + +- (MASConstraint *)leadingMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin]; +} + +- (MASConstraint *)trailingMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin]; +} + +- (MASConstraint *)centerXWithinMargins { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins]; +} + +- (MASConstraint *)centerYWithinMargins { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins]; +} + +#endif + +#pragma mark - Abstract + +- (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); } + +- (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); } + +- (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); } + +- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); } + +- (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); } + +- (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); } + +- (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); } + +- (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); } + +- (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); } + +- (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); } + +#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) + +- (MASConstraint *)animator { MASMethodNotImplemented(); } + +#endif + +- (void)activate { MASMethodNotImplemented(); } + +- (void)deactivate { MASMethodNotImplemented(); } + +- (void)install { MASMethodNotImplemented(); } + +- (void)uninstall { MASMethodNotImplemented(); } + +@end diff --git a/Example/Pods/Masonry/Masonry/MASConstraintMaker.h b/Example/Pods/Masonry/Masonry/MASConstraintMaker.h new file mode 100644 index 0000000..d9b58f4 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASConstraintMaker.h @@ -0,0 +1,146 @@ +// +// MASConstraintMaker.h +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASConstraint.h" +#import "MASUtilities.h" + +typedef NS_OPTIONS(NSInteger, MASAttribute) { + MASAttributeLeft = 1 << NSLayoutAttributeLeft, + MASAttributeRight = 1 << NSLayoutAttributeRight, + MASAttributeTop = 1 << NSLayoutAttributeTop, + MASAttributeBottom = 1 << NSLayoutAttributeBottom, + MASAttributeLeading = 1 << NSLayoutAttributeLeading, + MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, + MASAttributeWidth = 1 << NSLayoutAttributeWidth, + MASAttributeHeight = 1 << NSLayoutAttributeHeight, + MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, + MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, + MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + + MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, + MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + + MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, + MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, + MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, + MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, + MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, + MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, + MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, + MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, + +#endif + +}; + +/** + * Provides factory methods for creating MASConstraints. + * Constraints are collected until they are ready to be installed + * + */ +@interface MASConstraintMaker : NSObject + +/** + * The following properties return a new MASViewConstraint + * with the first item set to the makers associated view and the appropriate MASViewAttribute + */ +@property (nonatomic, strong, readonly) MASConstraint *left; +@property (nonatomic, strong, readonly) MASConstraint *top; +@property (nonatomic, strong, readonly) MASConstraint *right; +@property (nonatomic, strong, readonly) MASConstraint *bottom; +@property (nonatomic, strong, readonly) MASConstraint *leading; +@property (nonatomic, strong, readonly) MASConstraint *trailing; +@property (nonatomic, strong, readonly) MASConstraint *width; +@property (nonatomic, strong, readonly) MASConstraint *height; +@property (nonatomic, strong, readonly) MASConstraint *centerX; +@property (nonatomic, strong, readonly) MASConstraint *centerY; +@property (nonatomic, strong, readonly) MASConstraint *baseline; + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +@property (nonatomic, strong, readonly) MASConstraint *firstBaseline; +@property (nonatomic, strong, readonly) MASConstraint *lastBaseline; + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +@property (nonatomic, strong, readonly) MASConstraint *leftMargin; +@property (nonatomic, strong, readonly) MASConstraint *rightMargin; +@property (nonatomic, strong, readonly) MASConstraint *topMargin; +@property (nonatomic, strong, readonly) MASConstraint *bottomMargin; +@property (nonatomic, strong, readonly) MASConstraint *leadingMargin; +@property (nonatomic, strong, readonly) MASConstraint *trailingMargin; +@property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; +@property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; + +#endif + +/** + * Returns a block which creates a new MASCompositeConstraint with the first item set + * to the makers associated view and children corresponding to the set bits in the + * MASAttribute parameter. Combine multiple attributes via binary-or. + */ +@property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); + +/** + * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges + * which generates the appropriate MASViewConstraint children (top, left, bottom, right) + * with the first item set to the makers associated view + */ +@property (nonatomic, strong, readonly) MASConstraint *edges; + +/** + * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize + * which generates the appropriate MASViewConstraint children (width, height) + * with the first item set to the makers associated view + */ +@property (nonatomic, strong, readonly) MASConstraint *size; + +/** + * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter + * which generates the appropriate MASViewConstraint children (centerX, centerY) + * with the first item set to the makers associated view + */ +@property (nonatomic, strong, readonly) MASConstraint *center; + +/** + * Whether or not to check for an existing constraint instead of adding constraint + */ +@property (nonatomic, assign) BOOL updateExisting; + +/** + * Whether or not to remove existing constraints prior to installing + */ +@property (nonatomic, assign) BOOL removeExisting; + +/** + * initialises the maker with a default view + * + * @param view any MASConstraint are created with this view as the first item + * + * @return a new MASConstraintMaker + */ +- (id)initWithView:(MAS_VIEW *)view; + +/** + * Calls install method on any MASConstraints which have been created by this maker + * + * @return an array of all the installed MASConstraints + */ +- (NSArray *)install; + +- (MASConstraint * (^)(dispatch_block_t))group; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASConstraintMaker.m b/Example/Pods/Masonry/Masonry/MASConstraintMaker.m new file mode 100644 index 0000000..f11492a --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASConstraintMaker.m @@ -0,0 +1,273 @@ +// +// MASConstraintMaker.m +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASConstraintMaker.h" +#import "MASViewConstraint.h" +#import "MASCompositeConstraint.h" +#import "MASConstraint+Private.h" +#import "MASViewAttribute.h" +#import "View+MASAdditions.h" + +@interface MASConstraintMaker () + +@property (nonatomic, weak) MAS_VIEW *view; +@property (nonatomic, strong) NSMutableArray *constraints; + +@end + +@implementation MASConstraintMaker + +- (id)initWithView:(MAS_VIEW *)view { + self = [super init]; + if (!self) return nil; + + self.view = view; + self.constraints = NSMutableArray.new; + + return self; +} + +- (NSArray *)install { + if (self.removeExisting) { + NSArray *installedConstraints = [MASViewConstraint installedConstraintsForView:self.view]; + for (MASConstraint *constraint in installedConstraints) { + [constraint uninstall]; + } + } + NSArray *constraints = self.constraints.copy; + for (MASConstraint *constraint in constraints) { + constraint.updateExisting = self.updateExisting; + [constraint install]; + } + [self.constraints removeAllObjects]; + return constraints; +} + +#pragma mark - MASConstraintDelegate + +- (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { + NSUInteger index = [self.constraints indexOfObject:constraint]; + NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); + [self.constraints replaceObjectAtIndex:index withObject:replacementConstraint]; +} + +- (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { + MASViewAttribute *viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute]; + MASViewConstraint *newConstraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:viewAttribute]; + if ([constraint isKindOfClass:MASViewConstraint.class]) { + //replace with composite constraint + NSArray *children = @[constraint, newConstraint]; + MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children]; + compositeConstraint.delegate = self; + [self constraint:constraint shouldBeReplacedWithConstraint:compositeConstraint]; + return compositeConstraint; + } + if (!constraint) { + newConstraint.delegate = self; + [self.constraints addObject:newConstraint]; + } + return newConstraint; +} + +- (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs { + __unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading + | MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX + | MASAttributeCenterY | MASAttributeBaseline +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + | MASAttributeFirstBaseline | MASAttributeLastBaseline +#endif +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + | MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin + | MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins + | MASAttributeCenterYWithinMargins +#endif + ); + + NSAssert((attrs & anyAttribute) != 0, @"You didn't pass any attribute to make.attributes(...)"); + + NSMutableArray *attributes = [NSMutableArray array]; + + if (attrs & MASAttributeLeft) [attributes addObject:self.view.mas_left]; + if (attrs & MASAttributeRight) [attributes addObject:self.view.mas_right]; + if (attrs & MASAttributeTop) [attributes addObject:self.view.mas_top]; + if (attrs & MASAttributeBottom) [attributes addObject:self.view.mas_bottom]; + if (attrs & MASAttributeLeading) [attributes addObject:self.view.mas_leading]; + if (attrs & MASAttributeTrailing) [attributes addObject:self.view.mas_trailing]; + if (attrs & MASAttributeWidth) [attributes addObject:self.view.mas_width]; + if (attrs & MASAttributeHeight) [attributes addObject:self.view.mas_height]; + if (attrs & MASAttributeCenterX) [attributes addObject:self.view.mas_centerX]; + if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY]; + if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline]; + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + + if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.view.mas_firstBaseline]; + if (attrs & MASAttributeLastBaseline) [attributes addObject:self.view.mas_lastBaseline]; + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + + if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin]; + if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin]; + if (attrs & MASAttributeTopMargin) [attributes addObject:self.view.mas_topMargin]; + if (attrs & MASAttributeBottomMargin) [attributes addObject:self.view.mas_bottomMargin]; + if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.view.mas_leadingMargin]; + if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.view.mas_trailingMargin]; + if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.view.mas_centerXWithinMargins]; + if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.view.mas_centerYWithinMargins]; + +#endif + + NSMutableArray *children = [NSMutableArray arrayWithCapacity:attributes.count]; + + for (MASViewAttribute *a in attributes) { + [children addObject:[[MASViewConstraint alloc] initWithFirstViewAttribute:a]]; + } + + MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children]; + constraint.delegate = self; + [self.constraints addObject:constraint]; + return constraint; +} + +#pragma mark - standard Attributes + +- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { + return [self constraint:nil addConstraintWithLayoutAttribute:layoutAttribute]; +} + +- (MASConstraint *)left { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft]; +} + +- (MASConstraint *)top { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop]; +} + +- (MASConstraint *)right { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight]; +} + +- (MASConstraint *)bottom { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom]; +} + +- (MASConstraint *)leading { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading]; +} + +- (MASConstraint *)trailing { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing]; +} + +- (MASConstraint *)width { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth]; +} + +- (MASConstraint *)height { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight]; +} + +- (MASConstraint *)centerX { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX]; +} + +- (MASConstraint *)centerY { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY]; +} + +- (MASConstraint *)baseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline]; +} + +- (MASConstraint *(^)(MASAttribute))attributes { + return ^(MASAttribute attrs){ + return [self addConstraintWithAttributes:attrs]; + }; +} + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +- (MASConstraint *)firstBaseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline]; +} + +- (MASConstraint *)lastBaseline { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline]; +} + +#endif + + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +- (MASConstraint *)leftMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin]; +} + +- (MASConstraint *)rightMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin]; +} + +- (MASConstraint *)topMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin]; +} + +- (MASConstraint *)bottomMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin]; +} + +- (MASConstraint *)leadingMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin]; +} + +- (MASConstraint *)trailingMargin { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin]; +} + +- (MASConstraint *)centerXWithinMargins { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins]; +} + +- (MASConstraint *)centerYWithinMargins { + return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins]; +} + +#endif + + +#pragma mark - composite Attributes + +- (MASConstraint *)edges { + return [self addConstraintWithAttributes:MASAttributeTop | MASAttributeLeft | MASAttributeRight | MASAttributeBottom]; +} + +- (MASConstraint *)size { + return [self addConstraintWithAttributes:MASAttributeWidth | MASAttributeHeight]; +} + +- (MASConstraint *)center { + return [self addConstraintWithAttributes:MASAttributeCenterX | MASAttributeCenterY]; +} + +#pragma mark - grouping + +- (MASConstraint *(^)(dispatch_block_t group))group { + return ^id(dispatch_block_t group) { + NSInteger previousCount = self.constraints.count; + group(); + + NSArray *children = [self.constraints subarrayWithRange:NSMakeRange(previousCount, self.constraints.count - previousCount)]; + MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children]; + constraint.delegate = self; + return constraint; + }; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/MASLayoutConstraint.h b/Example/Pods/Masonry/Masonry/MASLayoutConstraint.h new file mode 100644 index 0000000..699041c --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASLayoutConstraint.h @@ -0,0 +1,22 @@ +// +// MASLayoutConstraint.h +// Masonry +// +// Created by Jonas Budelmann on 3/08/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "MASUtilities.h" + +/** + * When you are debugging or printing the constraints attached to a view this subclass + * makes it easier to identify which constraints have been created via Masonry + */ +@interface MASLayoutConstraint : NSLayoutConstraint + +/** + * a key to associate with this constraint + */ +@property (nonatomic, strong) id mas_key; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASLayoutConstraint.m b/Example/Pods/Masonry/Masonry/MASLayoutConstraint.m new file mode 100644 index 0000000..3483f02 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASLayoutConstraint.m @@ -0,0 +1,13 @@ +// +// MASLayoutConstraint.m +// Masonry +// +// Created by Jonas Budelmann on 3/08/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "MASLayoutConstraint.h" + +@implementation MASLayoutConstraint + +@end diff --git a/Example/Pods/Masonry/Masonry/MASUtilities.h b/Example/Pods/Masonry/Masonry/MASUtilities.h new file mode 100644 index 0000000..1dbfd93 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASUtilities.h @@ -0,0 +1,136 @@ +// +// MASUtilities.h +// Masonry +// +// Created by Jonas Budelmann on 19/08/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import + + + +#if TARGET_OS_IPHONE || TARGET_OS_TV + + #import + #define MAS_VIEW UIView + #define MAS_VIEW_CONTROLLER UIViewController + #define MASEdgeInsets UIEdgeInsets + + typedef UILayoutPriority MASLayoutPriority; + static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; + static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; + static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; + static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; + static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; + +#elif TARGET_OS_MAC + + #import + #define MAS_VIEW NSView + #define MASEdgeInsets NSEdgeInsets + + typedef NSLayoutPriority MASLayoutPriority; + static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; + static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; + static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; + static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; + static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; + static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; + static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; + static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; + +#endif + +/** + * Allows you to attach keys to objects matching the variable names passed. + * + * view1.mas_key = @"view1", view2.mas_key = @"view2"; + * + * is equivalent to: + * + * MASAttachKeys(view1, view2); + */ +#define MASAttachKeys(...) \ + { \ + NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ + for (id key in keyPairs.allKeys) { \ + id obj = keyPairs[key]; \ + NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ + @"Cannot attach mas_key to %@", obj); \ + [obj setMas_key:key]; \ + } \ + } + +/** + * Used to create object hashes + * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html + */ +#define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) +#define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) + +/** + * Given a scalar or struct value, wraps it in NSValue + * Based on EXPObjectify: https://github.com/specta/expecta + */ +static inline id _MASBoxValue(const char *type, ...) { + va_list v; + va_start(v, type); + id obj = nil; + if (strcmp(type, @encode(id)) == 0) { + id actual = va_arg(v, id); + obj = actual; + } else if (strcmp(type, @encode(CGPoint)) == 0) { + CGPoint actual = (CGPoint)va_arg(v, CGPoint); + obj = [NSValue value:&actual withObjCType:type]; + } else if (strcmp(type, @encode(CGSize)) == 0) { + CGSize actual = (CGSize)va_arg(v, CGSize); + obj = [NSValue value:&actual withObjCType:type]; + } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { + MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); + obj = [NSValue value:&actual withObjCType:type]; + } else if (strcmp(type, @encode(double)) == 0) { + double actual = (double)va_arg(v, double); + obj = [NSNumber numberWithDouble:actual]; + } else if (strcmp(type, @encode(float)) == 0) { + float actual = (float)va_arg(v, double); + obj = [NSNumber numberWithFloat:actual]; + } else if (strcmp(type, @encode(int)) == 0) { + int actual = (int)va_arg(v, int); + obj = [NSNumber numberWithInt:actual]; + } else if (strcmp(type, @encode(long)) == 0) { + long actual = (long)va_arg(v, long); + obj = [NSNumber numberWithLong:actual]; + } else if (strcmp(type, @encode(long long)) == 0) { + long long actual = (long long)va_arg(v, long long); + obj = [NSNumber numberWithLongLong:actual]; + } else if (strcmp(type, @encode(short)) == 0) { + short actual = (short)va_arg(v, int); + obj = [NSNumber numberWithShort:actual]; + } else if (strcmp(type, @encode(char)) == 0) { + char actual = (char)va_arg(v, int); + obj = [NSNumber numberWithChar:actual]; + } else if (strcmp(type, @encode(bool)) == 0) { + bool actual = (bool)va_arg(v, int); + obj = [NSNumber numberWithBool:actual]; + } else if (strcmp(type, @encode(unsigned char)) == 0) { + unsigned char actual = (unsigned char)va_arg(v, unsigned int); + obj = [NSNumber numberWithUnsignedChar:actual]; + } else if (strcmp(type, @encode(unsigned int)) == 0) { + unsigned int actual = (unsigned int)va_arg(v, unsigned int); + obj = [NSNumber numberWithUnsignedInt:actual]; + } else if (strcmp(type, @encode(unsigned long)) == 0) { + unsigned long actual = (unsigned long)va_arg(v, unsigned long); + obj = [NSNumber numberWithUnsignedLong:actual]; + } else if (strcmp(type, @encode(unsigned long long)) == 0) { + unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); + obj = [NSNumber numberWithUnsignedLongLong:actual]; + } else if (strcmp(type, @encode(unsigned short)) == 0) { + unsigned short actual = (unsigned short)va_arg(v, unsigned int); + obj = [NSNumber numberWithUnsignedShort:actual]; + } + va_end(v); + return obj; +} + +#define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) diff --git a/Example/Pods/Masonry/Masonry/MASViewAttribute.h b/Example/Pods/Masonry/Masonry/MASViewAttribute.h new file mode 100644 index 0000000..601c25d --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASViewAttribute.h @@ -0,0 +1,49 @@ +// +// MASViewAttribute.h +// Masonry +// +// Created by Jonas Budelmann on 21/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASUtilities.h" + +/** + * An immutable tuple which stores the view and the related NSLayoutAttribute. + * Describes part of either the left or right hand side of a constraint equation + */ +@interface MASViewAttribute : NSObject + +/** + * The view which the reciever relates to. Can be nil if item is not a view. + */ +@property (nonatomic, weak, readonly) MAS_VIEW *view; + +/** + * The item which the reciever relates to. + */ +@property (nonatomic, weak, readonly) id item; + +/** + * The attribute which the reciever relates to + */ +@property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; + +/** + * Convenience initializer. + */ +- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; + +/** + * The designated initializer. + */ +- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; + +/** + * Determine whether the layoutAttribute is a size attribute + * + * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight + */ +- (BOOL)isSizeAttribute; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASViewAttribute.m b/Example/Pods/Masonry/Masonry/MASViewAttribute.m new file mode 100644 index 0000000..e573e8b --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASViewAttribute.m @@ -0,0 +1,46 @@ +// +// MASViewAttribute.m +// Masonry +// +// Created by Jonas Budelmann on 21/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASViewAttribute.h" + +@implementation MASViewAttribute + +- (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { + self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; + return self; +} + +- (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { + self = [super init]; + if (!self) return nil; + + _view = view; + _item = item; + _layoutAttribute = layoutAttribute; + + return self; +} + +- (BOOL)isSizeAttribute { + return self.layoutAttribute == NSLayoutAttributeWidth + || self.layoutAttribute == NSLayoutAttributeHeight; +} + +- (BOOL)isEqual:(MASViewAttribute *)viewAttribute { + if ([viewAttribute isKindOfClass:self.class]) { + return self.view == viewAttribute.view + && self.layoutAttribute == viewAttribute.layoutAttribute; + } + return [super isEqual:viewAttribute]; +} + +- (NSUInteger)hash { + return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/MASViewConstraint.h b/Example/Pods/Masonry/Masonry/MASViewConstraint.h new file mode 100644 index 0000000..ec390d1 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASViewConstraint.h @@ -0,0 +1,48 @@ +// +// MASViewConstraint.h +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASViewAttribute.h" +#import "MASConstraint.h" +#import "MASLayoutConstraint.h" +#import "MASUtilities.h" + +/** + * A single constraint. + * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view + */ +@interface MASViewConstraint : MASConstraint + +/** + * First item/view and first attribute of the NSLayoutConstraint + */ +@property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; + +/** + * Second item/view and second attribute of the NSLayoutConstraint + */ +@property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; + +/** + * initialises the MASViewConstraint with the first part of the equation + * + * @param firstViewAttribute view.mas_left, view.mas_width etc. + * + * @return a new view constraint + */ +- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; + +/** + * Returns all MASViewConstraints installed with this view as a first item. + * + * @param view A view to retrieve constraints for. + * + * @return An array of MASViewConstraints. + */ ++ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; + +@end diff --git a/Example/Pods/Masonry/Masonry/MASViewConstraint.m b/Example/Pods/Masonry/Masonry/MASViewConstraint.m new file mode 100644 index 0000000..173eec1 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/MASViewConstraint.m @@ -0,0 +1,401 @@ +// +// MASViewConstraint.m +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASViewConstraint.h" +#import "MASConstraint+Private.h" +#import "MASCompositeConstraint.h" +#import "MASLayoutConstraint.h" +#import "View+MASAdditions.h" +#import + +@interface MAS_VIEW (MASConstraints) + +@property (nonatomic, readonly) NSMutableSet *mas_installedConstraints; + +@end + +@implementation MAS_VIEW (MASConstraints) + +static char kInstalledConstraintsKey; + +- (NSMutableSet *)mas_installedConstraints { + NSMutableSet *constraints = objc_getAssociatedObject(self, &kInstalledConstraintsKey); + if (!constraints) { + constraints = [NSMutableSet set]; + objc_setAssociatedObject(self, &kInstalledConstraintsKey, constraints, OBJC_ASSOCIATION_RETAIN_NONATOMIC); + } + return constraints; +} + +@end + + +@interface MASViewConstraint () + +@property (nonatomic, strong, readwrite) MASViewAttribute *secondViewAttribute; +@property (nonatomic, weak) MAS_VIEW *installedView; +@property (nonatomic, weak) MASLayoutConstraint *layoutConstraint; +@property (nonatomic, assign) NSLayoutRelation layoutRelation; +@property (nonatomic, assign) MASLayoutPriority layoutPriority; +@property (nonatomic, assign) CGFloat layoutMultiplier; +@property (nonatomic, assign) CGFloat layoutConstant; +@property (nonatomic, assign) BOOL hasLayoutRelation; +@property (nonatomic, strong) id mas_key; +@property (nonatomic, assign) BOOL useAnimator; + +@end + +@implementation MASViewConstraint + +- (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute { + self = [super init]; + if (!self) return nil; + + _firstViewAttribute = firstViewAttribute; + self.layoutPriority = MASLayoutPriorityRequired; + self.layoutMultiplier = 1; + + return self; +} + +#pragma mark - NSCoping + +- (id)copyWithZone:(NSZone __unused *)zone { + MASViewConstraint *constraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:self.firstViewAttribute]; + constraint.layoutConstant = self.layoutConstant; + constraint.layoutRelation = self.layoutRelation; + constraint.layoutPriority = self.layoutPriority; + constraint.layoutMultiplier = self.layoutMultiplier; + constraint.delegate = self.delegate; + return constraint; +} + +#pragma mark - Public + ++ (NSArray *)installedConstraintsForView:(MAS_VIEW *)view { + return [view.mas_installedConstraints allObjects]; +} + +#pragma mark - Private + +- (void)setLayoutConstant:(CGFloat)layoutConstant { + _layoutConstant = layoutConstant; + +#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) + if (self.useAnimator) { + [self.layoutConstraint.animator setConstant:layoutConstant]; + } else { + self.layoutConstraint.constant = layoutConstant; + } +#else + self.layoutConstraint.constant = layoutConstant; +#endif +} + +- (void)setLayoutRelation:(NSLayoutRelation)layoutRelation { + _layoutRelation = layoutRelation; + self.hasLayoutRelation = YES; +} + +- (BOOL)supportsActiveProperty { + return [self.layoutConstraint respondsToSelector:@selector(isActive)]; +} + +- (BOOL)isActive { + BOOL active = YES; + if ([self supportsActiveProperty]) { + active = [self.layoutConstraint isActive]; + } + + return active; +} + +- (BOOL)hasBeenInstalled { + return (self.layoutConstraint != nil) && [self isActive]; +} + +- (void)setSecondViewAttribute:(id)secondViewAttribute { + if ([secondViewAttribute isKindOfClass:NSValue.class]) { + [self setLayoutConstantWithValue:secondViewAttribute]; + } else if ([secondViewAttribute isKindOfClass:MAS_VIEW.class]) { + _secondViewAttribute = [[MASViewAttribute alloc] initWithView:secondViewAttribute layoutAttribute:self.firstViewAttribute.layoutAttribute]; + } else if ([secondViewAttribute isKindOfClass:MASViewAttribute.class]) { + _secondViewAttribute = secondViewAttribute; + } else { + NSAssert(NO, @"attempting to add unsupported attribute: %@", secondViewAttribute); + } +} + +#pragma mark - NSLayoutConstraint multiplier proxies + +- (MASConstraint * (^)(CGFloat))multipliedBy { + return ^id(CGFloat multiplier) { + NSAssert(!self.hasBeenInstalled, + @"Cannot modify constraint multiplier after it has been installed"); + + self.layoutMultiplier = multiplier; + return self; + }; +} + + +- (MASConstraint * (^)(CGFloat))dividedBy { + return ^id(CGFloat divider) { + NSAssert(!self.hasBeenInstalled, + @"Cannot modify constraint multiplier after it has been installed"); + + self.layoutMultiplier = 1.0/divider; + return self; + }; +} + +#pragma mark - MASLayoutPriority proxy + +- (MASConstraint * (^)(MASLayoutPriority))priority { + return ^id(MASLayoutPriority priority) { + NSAssert(!self.hasBeenInstalled, + @"Cannot modify constraint priority after it has been installed"); + + self.layoutPriority = priority; + return self; + }; +} + +#pragma mark - NSLayoutRelation proxy + +- (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { + return ^id(id attribute, NSLayoutRelation relation) { + if ([attribute isKindOfClass:NSArray.class]) { + NSAssert(!self.hasLayoutRelation, @"Redefinition of constraint relation"); + NSMutableArray *children = NSMutableArray.new; + for (id attr in attribute) { + MASViewConstraint *viewConstraint = [self copy]; + viewConstraint.layoutRelation = relation; + viewConstraint.secondViewAttribute = attr; + [children addObject:viewConstraint]; + } + MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children]; + compositeConstraint.delegate = self.delegate; + [self.delegate constraint:self shouldBeReplacedWithConstraint:compositeConstraint]; + return compositeConstraint; + } else { + NSAssert(!self.hasLayoutRelation || self.layoutRelation == relation && [attribute isKindOfClass:NSValue.class], @"Redefinition of constraint relation"); + self.layoutRelation = relation; + self.secondViewAttribute = attribute; + return self; + } + }; +} + +#pragma mark - Semantic properties + +- (MASConstraint *)with { + return self; +} + +- (MASConstraint *)and { + return self; +} + +#pragma mark - attribute chaining + +- (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { + NSAssert(!self.hasLayoutRelation, @"Attributes should be chained before defining the constraint relation"); + + return [self.delegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; +} + +#pragma mark - Animator proxy + +#if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) + +- (MASConstraint *)animator { + self.useAnimator = YES; + return self; +} + +#endif + +#pragma mark - debug helpers + +- (MASConstraint * (^)(id))key { + return ^id(id key) { + self.mas_key = key; + return self; + }; +} + +#pragma mark - NSLayoutConstraint constant setters + +- (void)setInsets:(MASEdgeInsets)insets { + NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; + switch (layoutAttribute) { + case NSLayoutAttributeLeft: + case NSLayoutAttributeLeading: + self.layoutConstant = insets.left; + break; + case NSLayoutAttributeTop: + self.layoutConstant = insets.top; + break; + case NSLayoutAttributeBottom: + self.layoutConstant = -insets.bottom; + break; + case NSLayoutAttributeRight: + case NSLayoutAttributeTrailing: + self.layoutConstant = -insets.right; + break; + default: + break; + } +} + +- (void)setInset:(CGFloat)inset { + [self setInsets:(MASEdgeInsets){.top = inset, .left = inset, .bottom = inset, .right = inset}]; +} + +- (void)setOffset:(CGFloat)offset { + self.layoutConstant = offset; +} + +- (void)setSizeOffset:(CGSize)sizeOffset { + NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; + switch (layoutAttribute) { + case NSLayoutAttributeWidth: + self.layoutConstant = sizeOffset.width; + break; + case NSLayoutAttributeHeight: + self.layoutConstant = sizeOffset.height; + break; + default: + break; + } +} + +- (void)setCenterOffset:(CGPoint)centerOffset { + NSLayoutAttribute layoutAttribute = self.firstViewAttribute.layoutAttribute; + switch (layoutAttribute) { + case NSLayoutAttributeCenterX: + self.layoutConstant = centerOffset.x; + break; + case NSLayoutAttributeCenterY: + self.layoutConstant = centerOffset.y; + break; + default: + break; + } +} + +#pragma mark - MASConstraint + +- (void)activate { + [self install]; +} + +- (void)deactivate { + [self uninstall]; +} + +- (void)install { + if (self.hasBeenInstalled) { + return; + } + + if ([self supportsActiveProperty] && self.layoutConstraint) { + self.layoutConstraint.active = YES; + [self.firstViewAttribute.view.mas_installedConstraints addObject:self]; + return; + } + + MAS_VIEW *firstLayoutItem = self.firstViewAttribute.item; + NSLayoutAttribute firstLayoutAttribute = self.firstViewAttribute.layoutAttribute; + MAS_VIEW *secondLayoutItem = self.secondViewAttribute.item; + NSLayoutAttribute secondLayoutAttribute = self.secondViewAttribute.layoutAttribute; + + // alignment attributes must have a secondViewAttribute + // therefore we assume that is refering to superview + // eg make.left.equalTo(@10) + if (!self.firstViewAttribute.isSizeAttribute && !self.secondViewAttribute) { + secondLayoutItem = self.firstViewAttribute.view.superview; + secondLayoutAttribute = firstLayoutAttribute; + } + + MASLayoutConstraint *layoutConstraint + = [MASLayoutConstraint constraintWithItem:firstLayoutItem + attribute:firstLayoutAttribute + relatedBy:self.layoutRelation + toItem:secondLayoutItem + attribute:secondLayoutAttribute + multiplier:self.layoutMultiplier + constant:self.layoutConstant]; + + layoutConstraint.priority = self.layoutPriority; + layoutConstraint.mas_key = self.mas_key; + + if (self.secondViewAttribute.view) { + MAS_VIEW *closestCommonSuperview = [self.firstViewAttribute.view mas_closestCommonSuperview:self.secondViewAttribute.view]; + NSAssert(closestCommonSuperview, + @"couldn't find a common superview for %@ and %@", + self.firstViewAttribute.view, self.secondViewAttribute.view); + self.installedView = closestCommonSuperview; + } else if (self.firstViewAttribute.isSizeAttribute) { + self.installedView = self.firstViewAttribute.view; + } else { + self.installedView = self.firstViewAttribute.view.superview; + } + + + MASLayoutConstraint *existingConstraint = nil; + if (self.updateExisting) { + existingConstraint = [self layoutConstraintSimilarTo:layoutConstraint]; + } + if (existingConstraint) { + // just update the constant + existingConstraint.constant = layoutConstraint.constant; + self.layoutConstraint = existingConstraint; + } else { + [self.installedView addConstraint:layoutConstraint]; + self.layoutConstraint = layoutConstraint; + [firstLayoutItem.mas_installedConstraints addObject:self]; + } +} + +- (MASLayoutConstraint *)layoutConstraintSimilarTo:(MASLayoutConstraint *)layoutConstraint { + // check if any constraints are the same apart from the only mutable property constant + + // go through constraints in reverse as we do not want to match auto-resizing or interface builder constraints + // and they are likely to be added first. + for (NSLayoutConstraint *existingConstraint in self.installedView.constraints.reverseObjectEnumerator) { + if (![existingConstraint isKindOfClass:MASLayoutConstraint.class]) continue; + if (existingConstraint.firstItem != layoutConstraint.firstItem) continue; + if (existingConstraint.secondItem != layoutConstraint.secondItem) continue; + if (existingConstraint.firstAttribute != layoutConstraint.firstAttribute) continue; + if (existingConstraint.secondAttribute != layoutConstraint.secondAttribute) continue; + if (existingConstraint.relation != layoutConstraint.relation) continue; + if (existingConstraint.multiplier != layoutConstraint.multiplier) continue; + if (existingConstraint.priority != layoutConstraint.priority) continue; + + return (id)existingConstraint; + } + return nil; +} + +- (void)uninstall { + if ([self supportsActiveProperty]) { + self.layoutConstraint.active = NO; + [self.firstViewAttribute.view.mas_installedConstraints removeObject:self]; + return; + } + + [self.installedView removeConstraint:self.layoutConstraint]; + self.layoutConstraint = nil; + self.installedView = nil; + + [self.firstViewAttribute.view.mas_installedConstraints removeObject:self]; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/Masonry.h b/Example/Pods/Masonry/Masonry/Masonry.h new file mode 100644 index 0000000..d1bd579 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/Masonry.h @@ -0,0 +1,29 @@ +// +// Masonry.h +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import + +//! Project version number for Masonry. +FOUNDATION_EXPORT double MasonryVersionNumber; + +//! Project version string for Masonry. +FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; + +#import "MASUtilities.h" +#import "View+MASAdditions.h" +#import "View+MASShorthandAdditions.h" +#import "ViewController+MASAdditions.h" +#import "NSArray+MASAdditions.h" +#import "NSArray+MASShorthandAdditions.h" +#import "MASConstraint.h" +#import "MASCompositeConstraint.h" +#import "MASViewAttribute.h" +#import "MASViewConstraint.h" +#import "MASConstraintMaker.h" +#import "MASLayoutConstraint.h" +#import "NSLayoutConstraint+MASDebugAdditions.h" diff --git a/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h b/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h new file mode 100644 index 0000000..587618d --- /dev/null +++ b/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h @@ -0,0 +1,72 @@ +// +// NSArray+MASAdditions.h +// +// +// Created by Daniel Hammond on 11/26/13. +// +// + +#import "MASUtilities.h" +#import "MASConstraintMaker.h" +#import "MASViewAttribute.h" + +typedef NS_ENUM(NSUInteger, MASAxisType) { + MASAxisTypeHorizontal, + MASAxisTypeVertical +}; + +@interface NSArray (MASAdditions) + +/** + * Creates a MASConstraintMaker with each view in the callee. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view + * + * @param block scope within which you can build up the constraints which you wish to apply to each view. + * + * @return Array of created MASConstraints + */ +- (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with each view in the callee. + * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. + * If an existing constraint exists then it will be updated instead. + * + * @param block scope within which you can build up the constraints which you wish to apply to each view. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with each view in the callee. + * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. + * All constraints previously installed for the views will be removed. + * + * @param block scope within which you can build up the constraints which you wish to apply to each view. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * distribute with fixed spacing + * + * @param axisType which axis to distribute items along + * @param fixedSpacing the spacing between each item + * @param leadSpacing the spacing before the first item and the container + * @param tailSpacing the spacing after the last item and the container + */ +- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; + +/** + * distribute with fixed item size + * + * @param axisType which axis to distribute items along + * @param fixedItemLength the fixed length of each item + * @param leadSpacing the spacing before the first item and the container + * @param tailSpacing the spacing after the last item and the container + */ +- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; + +@end diff --git a/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m b/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m new file mode 100644 index 0000000..831d8cd --- /dev/null +++ b/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m @@ -0,0 +1,162 @@ +// +// NSArray+MASAdditions.m +// +// +// Created by Daniel Hammond on 11/26/13. +// +// + +#import "NSArray+MASAdditions.h" +#import "View+MASAdditions.h" + +@implementation NSArray (MASAdditions) + +- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { + NSMutableArray *constraints = [NSMutableArray array]; + for (MAS_VIEW *view in self) { + NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); + [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; + } + return constraints; +} + +- (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { + NSMutableArray *constraints = [NSMutableArray array]; + for (MAS_VIEW *view in self) { + NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); + [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; + } + return constraints; +} + +- (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { + NSMutableArray *constraints = [NSMutableArray array]; + for (MAS_VIEW *view in self) { + NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); + [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; + } + return constraints; +} + +- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { + if (self.count < 2) { + NSAssert(self.count>1,@"views to distribute need to bigger than one"); + return; + } + + MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; + if (axisType == MASAxisTypeHorizontal) { + MAS_VIEW *prev; + for (int i = 0; i < self.count; i++) { + MAS_VIEW *v = self[i]; + [v mas_makeConstraints:^(MASConstraintMaker *make) { + if (prev) { + make.width.equalTo(prev); + make.left.equalTo(prev.mas_right).offset(fixedSpacing); + if (i == self.count - 1) {//last one + make.right.equalTo(tempSuperView).offset(-tailSpacing); + } + } + else {//first one + make.left.equalTo(tempSuperView).offset(leadSpacing); + } + + }]; + prev = v; + } + } + else { + MAS_VIEW *prev; + for (int i = 0; i < self.count; i++) { + MAS_VIEW *v = self[i]; + [v mas_makeConstraints:^(MASConstraintMaker *make) { + if (prev) { + make.height.equalTo(prev); + make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); + if (i == self.count - 1) {//last one + make.bottom.equalTo(tempSuperView).offset(-tailSpacing); + } + } + else {//first one + make.top.equalTo(tempSuperView).offset(leadSpacing); + } + + }]; + prev = v; + } + } +} + +- (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { + if (self.count < 2) { + NSAssert(self.count>1,@"views to distribute need to bigger than one"); + return; + } + + MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; + if (axisType == MASAxisTypeHorizontal) { + MAS_VIEW *prev; + for (int i = 0; i < self.count; i++) { + MAS_VIEW *v = self[i]; + [v mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.equalTo(@(fixedItemLength)); + if (prev) { + if (i == self.count - 1) {//last one + make.right.equalTo(tempSuperView).offset(-tailSpacing); + } + else { + CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); + make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); + } + } + else {//first one + make.left.equalTo(tempSuperView).offset(leadSpacing); + } + }]; + prev = v; + } + } + else { + MAS_VIEW *prev; + for (int i = 0; i < self.count; i++) { + MAS_VIEW *v = self[i]; + [v mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.equalTo(@(fixedItemLength)); + if (prev) { + if (i == self.count - 1) {//last one + make.bottom.equalTo(tempSuperView).offset(-tailSpacing); + } + else { + CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); + make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); + } + } + else {//first one + make.top.equalTo(tempSuperView).offset(leadSpacing); + } + }]; + prev = v; + } + } +} + +- (MAS_VIEW *)mas_commonSuperviewOfViews +{ + MAS_VIEW *commonSuperview = nil; + MAS_VIEW *previousView = nil; + for (id object in self) { + if ([object isKindOfClass:[MAS_VIEW class]]) { + MAS_VIEW *view = (MAS_VIEW *)object; + if (previousView) { + commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; + } else { + commonSuperview = view; + } + previousView = view; + } + } + 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."); + return commonSuperview; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h b/Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h new file mode 100644 index 0000000..8b47369 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h @@ -0,0 +1,41 @@ +// +// NSArray+MASShorthandAdditions.h +// Masonry +// +// Created by Jonas Budelmann on 22/07/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "NSArray+MASAdditions.h" + +#ifdef MAS_SHORTHAND + +/** + * Shorthand array additions without the 'mas_' prefixes, + * only enabled if MAS_SHORTHAND is defined + */ +@interface NSArray (MASShorthandAdditions) + +- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; +- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; +- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; + +@end + +@implementation NSArray (MASShorthandAdditions) + +- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { + return [self mas_makeConstraints:block]; +} + +- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { + return [self mas_updateConstraints:block]; +} + +- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { + return [self mas_remakeConstraints:block]; +} + +@end + +#endif diff --git a/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h b/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h new file mode 100644 index 0000000..1279b4f --- /dev/null +++ b/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h @@ -0,0 +1,16 @@ +// +// NSLayoutConstraint+MASDebugAdditions.h +// Masonry +// +// Created by Jonas Budelmann on 3/08/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "MASUtilities.h" + +/** + * makes debug and log output of NSLayoutConstraints more readable + */ +@interface NSLayoutConstraint (MASDebugAdditions) + +@end diff --git a/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m b/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m new file mode 100644 index 0000000..ab539a2 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m @@ -0,0 +1,146 @@ +// +// NSLayoutConstraint+MASDebugAdditions.m +// Masonry +// +// Created by Jonas Budelmann on 3/08/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "NSLayoutConstraint+MASDebugAdditions.h" +#import "MASConstraint.h" +#import "MASLayoutConstraint.h" + +@implementation NSLayoutConstraint (MASDebugAdditions) + +#pragma mark - description maps + ++ (NSDictionary *)layoutRelationDescriptionsByValue { + static dispatch_once_t once; + static NSDictionary *descriptionMap; + dispatch_once(&once, ^{ + descriptionMap = @{ + @(NSLayoutRelationEqual) : @"==", + @(NSLayoutRelationGreaterThanOrEqual) : @">=", + @(NSLayoutRelationLessThanOrEqual) : @"<=", + }; + }); + return descriptionMap; +} + ++ (NSDictionary *)layoutAttributeDescriptionsByValue { + static dispatch_once_t once; + static NSDictionary *descriptionMap; + dispatch_once(&once, ^{ + descriptionMap = @{ + @(NSLayoutAttributeTop) : @"top", + @(NSLayoutAttributeLeft) : @"left", + @(NSLayoutAttributeBottom) : @"bottom", + @(NSLayoutAttributeRight) : @"right", + @(NSLayoutAttributeLeading) : @"leading", + @(NSLayoutAttributeTrailing) : @"trailing", + @(NSLayoutAttributeWidth) : @"width", + @(NSLayoutAttributeHeight) : @"height", + @(NSLayoutAttributeCenterX) : @"centerX", + @(NSLayoutAttributeCenterY) : @"centerY", + @(NSLayoutAttributeBaseline) : @"baseline", + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", + @(NSLayoutAttributeLastBaseline) : @"lastBaseline", +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + @(NSLayoutAttributeLeftMargin) : @"leftMargin", + @(NSLayoutAttributeRightMargin) : @"rightMargin", + @(NSLayoutAttributeTopMargin) : @"topMargin", + @(NSLayoutAttributeBottomMargin) : @"bottomMargin", + @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", + @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", + @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", + @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", +#endif + + }; + + }); + return descriptionMap; +} + + ++ (NSDictionary *)layoutPriorityDescriptionsByValue { + static dispatch_once_t once; + static NSDictionary *descriptionMap; + dispatch_once(&once, ^{ +#if TARGET_OS_IPHONE || TARGET_OS_TV + descriptionMap = @{ + @(MASLayoutPriorityDefaultHigh) : @"high", + @(MASLayoutPriorityDefaultLow) : @"low", + @(MASLayoutPriorityDefaultMedium) : @"medium", + @(MASLayoutPriorityRequired) : @"required", + @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", + }; +#elif TARGET_OS_MAC + descriptionMap = @{ + @(MASLayoutPriorityDefaultHigh) : @"high", + @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", + @(MASLayoutPriorityDefaultMedium) : @"medium", + @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", + @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", + @(MASLayoutPriorityDefaultLow) : @"low", + @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", + @(MASLayoutPriorityRequired) : @"required", + }; +#endif + }); + return descriptionMap; +} + +#pragma mark - description override + ++ (NSString *)descriptionForObject:(id)obj { + if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { + return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; + } + return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; +} + +- (NSString *)description { + NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; + + [description appendString:[self.class descriptionForObject:self]]; + + [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; + if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { + [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; + } + + [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; + + if (self.secondItem) { + [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; + } + if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { + [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; + } + + if (self.multiplier != 1) { + [description appendFormat:@" * %g", self.multiplier]; + } + + if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { + [description appendFormat:@" %g", self.constant]; + } else { + if (self.constant) { + [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; + } + } + + if (self.priority != MASLayoutPriorityRequired) { + [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; + } + + [description appendString:@">"]; + return description; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/View+MASAdditions.h b/Example/Pods/Masonry/Masonry/View+MASAdditions.h new file mode 100644 index 0000000..f7343d2 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/View+MASAdditions.h @@ -0,0 +1,111 @@ +// +// UIView+MASAdditions.h +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "MASUtilities.h" +#import "MASConstraintMaker.h" +#import "MASViewAttribute.h" + +/** + * Provides constraint maker block + * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs + */ +@interface MAS_VIEW (MASAdditions) + +/** + * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute + */ +@property (nonatomic, strong, readonly) MASViewAttribute *mas_left; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_top; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_right; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_width; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_height; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; +@property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; + +#endif + +#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) + +@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); + +#endif + +/** + * a key to associate with this view + */ +@property (nonatomic, strong) id mas_key; + +/** + * Finds the closest common superview between this view and another view + * + * @param view other view + * + * @return returns nil if common superview could not be found + */ +- (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; + +/** + * Creates a MASConstraintMaker with the callee view. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing + * + * @param block scope within which you can build up the constraints which you wish to apply to the view. + * + * @return Array of created MASConstraints + */ +- (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with the callee view. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. + * If an existing constraint exists then it will be updated instead. + * + * @param block scope within which you can build up the constraints which you wish to apply to the view. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +/** + * Creates a MASConstraintMaker with the callee view. + * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. + * All constraints previously installed for the view will be removed. + * + * @param block scope within which you can build up the constraints which you wish to apply to the view. + * + * @return Array of created/updated MASConstraints + */ +- (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; + +@end diff --git a/Example/Pods/Masonry/Masonry/View+MASAdditions.m b/Example/Pods/Masonry/Masonry/View+MASAdditions.m new file mode 100644 index 0000000..4fa07b4 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/View+MASAdditions.m @@ -0,0 +1,186 @@ +// +// UIView+MASAdditions.m +// Masonry +// +// Created by Jonas Budelmann on 20/07/13. +// Copyright (c) 2013 cloudling. All rights reserved. +// + +#import "View+MASAdditions.h" +#import + +@implementation MAS_VIEW (MASAdditions) + +- (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block { + self.translatesAutoresizingMaskIntoConstraints = NO; + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; + block(constraintMaker); + return [constraintMaker install]; +} + +- (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block { + self.translatesAutoresizingMaskIntoConstraints = NO; + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; + constraintMaker.updateExisting = YES; + block(constraintMaker); + return [constraintMaker install]; +} + +- (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { + self.translatesAutoresizingMaskIntoConstraints = NO; + MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; + constraintMaker.removeExisting = YES; + block(constraintMaker); + return [constraintMaker install]; +} + +#pragma mark - NSLayoutAttribute properties + +- (MASViewAttribute *)mas_left { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft]; +} + +- (MASViewAttribute *)mas_top { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop]; +} + +- (MASViewAttribute *)mas_right { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight]; +} + +- (MASViewAttribute *)mas_bottom { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom]; +} + +- (MASViewAttribute *)mas_leading { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading]; +} + +- (MASViewAttribute *)mas_trailing { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing]; +} + +- (MASViewAttribute *)mas_width { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth]; +} + +- (MASViewAttribute *)mas_height { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight]; +} + +- (MASViewAttribute *)mas_centerX { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX]; +} + +- (MASViewAttribute *)mas_centerY { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY]; +} + +- (MASViewAttribute *)mas_baseline { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline]; +} + +- (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute +{ + return ^(NSLayoutAttribute attr) { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr]; + }; +} + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +- (MASViewAttribute *)mas_firstBaseline { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline]; +} +- (MASViewAttribute *)mas_lastBaseline { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline]; +} + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +- (MASViewAttribute *)mas_leftMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin]; +} + +- (MASViewAttribute *)mas_rightMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin]; +} + +- (MASViewAttribute *)mas_topMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin]; +} + +- (MASViewAttribute *)mas_bottomMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin]; +} + +- (MASViewAttribute *)mas_leadingMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin]; +} + +- (MASViewAttribute *)mas_trailingMargin { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin]; +} + +- (MASViewAttribute *)mas_centerXWithinMargins { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins]; +} + +- (MASViewAttribute *)mas_centerYWithinMargins { + return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins]; +} + +#endif + +#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) + +- (MASViewAttribute *)mas_safeAreaLayoutGuide { + return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; +} +- (MASViewAttribute *)mas_safeAreaLayoutGuideTop { + return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop]; +} +- (MASViewAttribute *)mas_safeAreaLayoutGuideBottom { + return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; +} +- (MASViewAttribute *)mas_safeAreaLayoutGuideLeft { + return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft]; +} +- (MASViewAttribute *)mas_safeAreaLayoutGuideRight { + return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight]; +} + +#endif + +#pragma mark - associated properties + +- (id)mas_key { + return objc_getAssociatedObject(self, @selector(mas_key)); +} + +- (void)setMas_key:(id)key { + objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); +} + +#pragma mark - heirachy + +- (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view { + MAS_VIEW *closestCommonSuperview = nil; + + MAS_VIEW *secondViewSuperview = view; + while (!closestCommonSuperview && secondViewSuperview) { + MAS_VIEW *firstViewSuperview = self; + while (!closestCommonSuperview && firstViewSuperview) { + if (secondViewSuperview == firstViewSuperview) { + closestCommonSuperview = secondViewSuperview; + } + firstViewSuperview = firstViewSuperview.superview; + } + secondViewSuperview = secondViewSuperview.superview; + } + return closestCommonSuperview; +} + +@end diff --git a/Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h b/Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h new file mode 100644 index 0000000..1c19a94 --- /dev/null +++ b/Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h @@ -0,0 +1,133 @@ +// +// UIView+MASShorthandAdditions.h +// Masonry +// +// Created by Jonas Budelmann on 22/07/13. +// Copyright (c) 2013 Jonas Budelmann. All rights reserved. +// + +#import "View+MASAdditions.h" + +#ifdef MAS_SHORTHAND + +/** + * Shorthand view additions without the 'mas_' prefixes, + * only enabled if MAS_SHORTHAND is defined + */ +@interface MAS_VIEW (MASShorthandAdditions) + +@property (nonatomic, strong, readonly) MASViewAttribute *left; +@property (nonatomic, strong, readonly) MASViewAttribute *top; +@property (nonatomic, strong, readonly) MASViewAttribute *right; +@property (nonatomic, strong, readonly) MASViewAttribute *bottom; +@property (nonatomic, strong, readonly) MASViewAttribute *leading; +@property (nonatomic, strong, readonly) MASViewAttribute *trailing; +@property (nonatomic, strong, readonly) MASViewAttribute *width; +@property (nonatomic, strong, readonly) MASViewAttribute *height; +@property (nonatomic, strong, readonly) MASViewAttribute *centerX; +@property (nonatomic, strong, readonly) MASViewAttribute *centerY; +@property (nonatomic, strong, readonly) MASViewAttribute *baseline; +@property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +@property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; +@property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +@property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *topMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; +@property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; +@property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; + +#endif + +#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) + +@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); +@property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); + +#endif + +- (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; +- (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; +- (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; + +@end + +#define MAS_ATTR_FORWARD(attr) \ +- (MASViewAttribute *)attr { \ + return [self mas_##attr]; \ +} + +@implementation MAS_VIEW (MASShorthandAdditions) + +MAS_ATTR_FORWARD(top); +MAS_ATTR_FORWARD(left); +MAS_ATTR_FORWARD(bottom); +MAS_ATTR_FORWARD(right); +MAS_ATTR_FORWARD(leading); +MAS_ATTR_FORWARD(trailing); +MAS_ATTR_FORWARD(width); +MAS_ATTR_FORWARD(height); +MAS_ATTR_FORWARD(centerX); +MAS_ATTR_FORWARD(centerY); +MAS_ATTR_FORWARD(baseline); + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) + +MAS_ATTR_FORWARD(firstBaseline); +MAS_ATTR_FORWARD(lastBaseline); + +#endif + +#if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) + +MAS_ATTR_FORWARD(leftMargin); +MAS_ATTR_FORWARD(rightMargin); +MAS_ATTR_FORWARD(topMargin); +MAS_ATTR_FORWARD(bottomMargin); +MAS_ATTR_FORWARD(leadingMargin); +MAS_ATTR_FORWARD(trailingMargin); +MAS_ATTR_FORWARD(centerXWithinMargins); +MAS_ATTR_FORWARD(centerYWithinMargins); + +#endif + +#if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) + +MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); +MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); +MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); +MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); + +#endif + +- (MASViewAttribute *(^)(NSLayoutAttribute))attribute { + return [self mas_attribute]; +} + +- (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { + return [self mas_makeConstraints:block]; +} + +- (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { + return [self mas_updateConstraints:block]; +} + +- (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { + return [self mas_remakeConstraints:block]; +} + +@end + +#endif diff --git a/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h b/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h new file mode 100644 index 0000000..79fd1fa --- /dev/null +++ b/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h @@ -0,0 +1,30 @@ +// +// UIViewController+MASAdditions.h +// Masonry +// +// Created by Craig Siemens on 2015-06-23. +// +// + +#import "MASUtilities.h" +#import "MASConstraintMaker.h" +#import "MASViewAttribute.h" + +#ifdef MAS_VIEW_CONTROLLER + +@interface MAS_VIEW_CONTROLLER (MASAdditions) + +/** + * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute + */ +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; +@property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; + + +@end + +#endif diff --git a/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m b/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m new file mode 100644 index 0000000..2f5139f --- /dev/null +++ b/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m @@ -0,0 +1,39 @@ +// +// UIViewController+MASAdditions.m +// Masonry +// +// Created by Craig Siemens on 2015-06-23. +// +// + +#import "ViewController+MASAdditions.h" + +#ifdef MAS_VIEW_CONTROLLER + +@implementation MAS_VIEW_CONTROLLER (MASAdditions) + +- (MASViewAttribute *)mas_topLayoutGuide { + return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; +} +- (MASViewAttribute *)mas_topLayoutGuideTop { + return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; +} +- (MASViewAttribute *)mas_topLayoutGuideBottom { + return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; +} + +- (MASViewAttribute *)mas_bottomLayoutGuide { + return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; +} +- (MASViewAttribute *)mas_bottomLayoutGuideTop { + return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; +} +- (MASViewAttribute *)mas_bottomLayoutGuideBottom { + return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; +} + + + +@end + +#endif diff --git a/Example/Pods/Masonry/README.md b/Example/Pods/Masonry/README.md new file mode 100644 index 0000000..d428657 --- /dev/null +++ b/Example/Pods/Masonry/README.md @@ -0,0 +1,415 @@ +# Masonry [![Build Status](https://travis-ci.org/SnapKit/Masonry.svg?branch=master)](https://travis-ci.org/SnapKit/Masonry) [![Coverage Status](https://img.shields.io/coveralls/SnapKit/Masonry.svg?style=flat-square)](https://coveralls.io/r/SnapKit/Masonry) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) ![Pod Version](https://img.shields.io/cocoapods/v/Masonry.svg?style=flat) + +**Masonry is still actively maintained, we are committed to fixing bugs and merging good quality PRs from the wider community. However if you're using Swift in your project, we recommend using [SnapKit](https://github.com/SnapKit/SnapKit) as it provides better type safety with a simpler API.** + +Masonry is a light-weight layout framework which wraps AutoLayout with a nicer syntax. Masonry has its own layout DSL which provides a chainable way of describing your NSLayoutConstraints which results in layout code that is more concise and readable. +Masonry supports iOS and Mac OS X. + +For examples take a look at the **Masonry iOS Examples** project in the Masonry workspace. You will need to run `pod install` after downloading. + +## What's wrong with NSLayoutConstraints? + +Under the hood Auto Layout is a powerful and flexible way of organising and laying out your views. However creating constraints from code is verbose and not very descriptive. +Imagine a simple example in which you want to have a view fill its superview but inset by 10 pixels on every side +```obj-c +UIView *superview = self.view; + +UIView *view1 = [[UIView alloc] init]; +view1.translatesAutoresizingMaskIntoConstraints = NO; +view1.backgroundColor = [UIColor greenColor]; +[superview addSubview:view1]; + +UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10); + +[superview addConstraints:@[ + + //view1 constraints + [NSLayoutConstraint constraintWithItem:view1 + attribute:NSLayoutAttributeTop + relatedBy:NSLayoutRelationEqual + toItem:superview + attribute:NSLayoutAttributeTop + multiplier:1.0 + constant:padding.top], + + [NSLayoutConstraint constraintWithItem:view1 + attribute:NSLayoutAttributeLeft + relatedBy:NSLayoutRelationEqual + toItem:superview + attribute:NSLayoutAttributeLeft + multiplier:1.0 + constant:padding.left], + + [NSLayoutConstraint constraintWithItem:view1 + attribute:NSLayoutAttributeBottom + relatedBy:NSLayoutRelationEqual + toItem:superview + attribute:NSLayoutAttributeBottom + multiplier:1.0 + constant:-padding.bottom], + + [NSLayoutConstraint constraintWithItem:view1 + attribute:NSLayoutAttributeRight + relatedBy:NSLayoutRelationEqual + toItem:superview + attribute:NSLayoutAttributeRight + multiplier:1 + constant:-padding.right], + + ]]; +``` +Even with such a simple example the code needed is quite verbose and quickly becomes unreadable when you have more than 2 or 3 views. +Another option is to use Visual Format Language (VFL), which is a bit less long winded. +However the ASCII type syntax has its own pitfalls and its also a bit harder to animate as `NSLayoutConstraint constraintsWithVisualFormat:` returns an array. + +## Prepare to meet your Maker! + +Heres the same constraints created using MASConstraintMaker + +```obj-c +UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10); + +[view1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(superview.mas_top).with.offset(padding.top); //with is an optional semantic filler + make.left.equalTo(superview.mas_left).with.offset(padding.left); + make.bottom.equalTo(superview.mas_bottom).with.offset(-padding.bottom); + make.right.equalTo(superview.mas_right).with.offset(-padding.right); +}]; +``` +Or even shorter + +```obj-c +[view1 mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(superview).with.insets(padding); +}]; +``` + +Also note in the first example we had to add the constraints to the superview `[superview addConstraints:...`. +Masonry however will automagically add constraints to the appropriate view. + +Masonry will also call `view1.translatesAutoresizingMaskIntoConstraints = NO;` for you. + +## Not all things are created equal + +> `.equalTo` equivalent to **NSLayoutRelationEqual** + +> `.lessThanOrEqualTo` equivalent to **NSLayoutRelationLessThanOrEqual** + +> `.greaterThanOrEqualTo` equivalent to **NSLayoutRelationGreaterThanOrEqual** + +These three equality constraints accept one argument which can be any of the following: + +#### 1. MASViewAttribute + +```obj-c +make.centerX.lessThanOrEqualTo(view2.mas_left); +``` + +MASViewAttribute | NSLayoutAttribute +------------------------- | -------------------------- +view.mas_left | NSLayoutAttributeLeft +view.mas_right | NSLayoutAttributeRight +view.mas_top | NSLayoutAttributeTop +view.mas_bottom | NSLayoutAttributeBottom +view.mas_leading | NSLayoutAttributeLeading +view.mas_trailing | NSLayoutAttributeTrailing +view.mas_width | NSLayoutAttributeWidth +view.mas_height | NSLayoutAttributeHeight +view.mas_centerX | NSLayoutAttributeCenterX +view.mas_centerY | NSLayoutAttributeCenterY +view.mas_baseline | NSLayoutAttributeBaseline + +#### 2. UIView/NSView + +if you want view.left to be greater than or equal to label.left : +```obj-c +//these two constraints are exactly the same +make.left.greaterThanOrEqualTo(label); +make.left.greaterThanOrEqualTo(label.mas_left); +``` + +#### 3. NSNumber + +Auto Layout allows width and height to be set to constant values. +if you want to set view to have a minimum and maximum width you could pass a number to the equality blocks: +```obj-c +//width >= 200 && width <= 400 +make.width.greaterThanOrEqualTo(@200); +make.width.lessThanOrEqualTo(@400) +``` + +However Auto Layout does not allow alignment attributes such as left, right, centerY etc to be set to constant values. +So if you pass a NSNumber for these attributes Masonry will turn these into constraints relative to the view’s superview ie: +```obj-c +//creates view.left = view.superview.left + 10 +make.left.lessThanOrEqualTo(@10) +``` + +Instead of using NSNumber, you can use primitives and structs to build your constraints, like so: +```obj-c +make.top.mas_equalTo(42); +make.height.mas_equalTo(20); +make.size.mas_equalTo(CGSizeMake(50, 100)); +make.edges.mas_equalTo(UIEdgeInsetsMake(10, 0, 10, 0)); +make.left.mas_equalTo(view).mas_offset(UIEdgeInsetsMake(10, 0, 10, 0)); +``` + +By default, macros which support [autoboxing](https://en.wikipedia.org/wiki/Autoboxing#Autoboxing) are prefixed with `mas_`. Unprefixed versions are available by defining `MAS_SHORTHAND_GLOBALS` before importing Masonry. + +#### 4. NSArray + +An array of a mixture of any of the previous types +```obj-c +make.height.equalTo(@[view1.mas_height, view2.mas_height]); +make.height.equalTo(@[view1, view2]); +make.left.equalTo(@[view1, @100, view3.right]); +```` + +## Learn to prioritize + +> `.priority` allows you to specify an exact priority + +> `.priorityHigh` equivalent to **UILayoutPriorityDefaultHigh** + +> `.priorityMedium` is half way between high and low + +> `.priorityLow` equivalent to **UILayoutPriorityDefaultLow** + +Priorities are can be tacked on to the end of a constraint chain like so: +```obj-c +make.left.greaterThanOrEqualTo(label.mas_left).with.priorityLow(); + +make.top.equalTo(label.mas_top).with.priority(600); +``` + +## Composition, composition, composition + +Masonry also gives you a few convenience methods which create multiple constraints at the same time. These are called MASCompositeConstraints + +#### edges + +```obj-c +// make top, left, bottom, right equal view2 +make.edges.equalTo(view2); + +// make top = superview.top + 5, left = superview.left + 10, +// bottom = superview.bottom - 15, right = superview.right - 20 +make.edges.equalTo(superview).insets(UIEdgeInsetsMake(5, 10, 15, 20)) +``` + +#### size + +```obj-c +// make width and height greater than or equal to titleLabel +make.size.greaterThanOrEqualTo(titleLabel) + +// make width = superview.width + 100, height = superview.height - 50 +make.size.equalTo(superview).sizeOffset(CGSizeMake(100, -50)) +``` + +#### center +```obj-c +// make centerX and centerY = button1 +make.center.equalTo(button1) + +// make centerX = superview.centerX - 5, centerY = superview.centerY + 10 +make.center.equalTo(superview).centerOffset(CGPointMake(-5, 10)) +``` + +You can chain view attributes for increased readability: + +```obj-c +// All edges but the top should equal those of the superview +make.left.right.and.bottom.equalTo(superview); +make.top.equalTo(otherView); +``` + +## Hold on for dear life + +Sometimes you need modify existing constraints in order to animate or remove/replace constraints. +In Masonry there are a few different approaches to updating constraints. + +#### 1. References +You can hold on to a reference of a particular constraint by assigning the result of a constraint make expression to a local variable or a class property. +You could also reference multiple constraints by storing them away in an array. + +```obj-c +// in public/private interface +@property (nonatomic, strong) MASConstraint *topConstraint; + +... + +// when making constraints +[view1 mas_makeConstraints:^(MASConstraintMaker *make) { + self.topConstraint = make.top.equalTo(superview.mas_top).with.offset(padding.top); + make.left.equalTo(superview.mas_left).with.offset(padding.left); +}]; + +... +// then later you can call +[self.topConstraint uninstall]; +``` + +#### 2. mas_updateConstraints +Alternatively if you are only updating the constant value of the constraint you can use the convience method `mas_updateConstraints` instead of `mas_makeConstraints` + +```obj-c +// this is Apple's recommended place for adding/updating constraints +// this method can get called multiple times in response to setNeedsUpdateConstraints +// which can be called by UIKit internally or in your code if you need to trigger an update to your constraints +- (void)updateConstraints { + [self.growingButton mas_updateConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self); + make.width.equalTo(@(self.buttonSize.width)).priorityLow(); + make.height.equalTo(@(self.buttonSize.height)).priorityLow(); + make.width.lessThanOrEqualTo(self); + make.height.lessThanOrEqualTo(self); + }]; + + //according to apple super should be called at end of method + [super updateConstraints]; +} +``` + +### 3. mas_remakeConstraints +`mas_updateConstraints` is useful for updating a set of constraints, but doing anything beyond updating constant values can get exhausting. That's where `mas_remakeConstraints` comes in. + +`mas_remakeConstraints` is similar to `mas_updateConstraints`, but instead of updating constant values, it will remove all of its constraints before installing them again. This lets you provide different constraints without having to keep around references to ones which you want to remove. + +```obj-c +- (void)changeButtonPosition { + [self.button mas_remakeConstraints:^(MASConstraintMaker *make) { + make.size.equalTo(self.buttonSize); + + if (topLeft) { + make.top.and.left.offset(10); + } else { + make.bottom.and.right.offset(-10); + } + }]; +} +``` + +You can find more detailed examples of all three approaches in the **Masonry iOS Examples** project. + +## When the ^&*!@ hits the fan! + +Laying out your views doesn't always goto plan. So when things literally go pear shaped, you don't want to be looking at console output like this: + +```obj-c +Unable to simultaneously satisfy constraints.....blah blah blah.... +( + "=5000)]>", + "", + "", + "" +) + +Will attempt to recover by breaking constraint +=5000)]> +``` + +Masonry adds a category to NSLayoutConstraint which overrides the default implementation of `- (NSString *)description`. +Now you can give meaningful names to views and constraints, and also easily pick out the constraints created by Masonry. + +which means your console output can now look like this: + +```obj-c +Unable to simultaneously satisfy constraints......blah blah blah.... +( + "", + "= 5000>", + "", + "" +) + +Will attempt to recover by breaking constraint += 5000> +``` + +For an example of how to set this up take a look at the **Masonry iOS Examples** project in the Masonry workspace. + +## Where should I create my constraints? + +```objc +@implementation DIYCustomView + +- (id)init { + self = [super init]; + if (!self) return nil; + + // --- Create your views here --- + self.button = [[UIButton alloc] init]; + + return self; +} + +// tell UIKit that you are using AutoLayout ++ (BOOL)requiresConstraintBasedLayout { + return YES; +} + +// this is Apple's recommended place for adding/updating constraints +- (void)updateConstraints { + + // --- remake/update constraints here + [self.button remakeConstraints:^(MASConstraintMaker *make) { + make.width.equalTo(@(self.buttonSize.width)); + make.height.equalTo(@(self.buttonSize.height)); + }]; + + //according to apple super should be called at end of method + [super updateConstraints]; +} + +- (void)didTapButton:(UIButton *)button { + // --- Do your changes ie change variables that affect your layout etc --- + self.buttonSize = CGSize(200, 200); + + // tell constraints they need updating + [self setNeedsUpdateConstraints]; +} + +@end +``` + +## Installation +Use the [orsome](http://www.youtube.com/watch?v=YaIZF8uUTtk) [CocoaPods](http://github.com/CocoaPods/CocoaPods). + +In your Podfile +>`pod 'Masonry'` + +If you want to use masonry without all those pesky 'mas_' prefixes. Add #define MAS_SHORTHAND to your prefix.pch before importing Masonry +>`#define MAS_SHORTHAND` + +Get busy Masoning +>`#import "Masonry.h"` + +## Code Snippets + +Copy the included code snippets to ``~/Library/Developer/Xcode/UserData/CodeSnippets`` to write your masonry blocks at lightning speed! + +`mas_make` -> ` [<#view#> mas_makeConstraints:^(MASConstraintMaker *make) { + <#code#> + }];` + +`mas_update` -> ` [<#view#> mas_updateConstraints:^(MASConstraintMaker *make) { + <#code#> + }];` + +`mas_remake` -> ` [<#view#> mas_remakeConstraints:^(MASConstraintMaker *make) { + <#code#> + }];` + +## Features +* Not limited to subset of Auto Layout. Anything NSLayoutConstraint can do, Masonry can do too! +* Great debug support, give your views and constraints meaningful names. +* Constraints read like sentences. +* No crazy macro magic. Masonry won't pollute the global namespace with macros. +* Not string or dictionary based and hence you get compile time checking. + +## TODO +* Eye candy +* Mac example project +* More tests and examples + diff --git a/Example/Pods/Pods.xcodeproj/project.pbxproj b/Example/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 0000000..eaa9baa --- /dev/null +++ b/Example/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,1463 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 028FEC384E2461209287DB7FD1D318D3 /* UITextView+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = FC63FA8DE6D1008CCA734F85EA6A4A3F /* UITextView+LYExt.m */; }; + 03340FE6DB380AF385272676331E421D /* Masonry.h in Headers */ = {isa = PBXBuildFile; fileRef = 303B58A2959C8EEE96799AD558DDA1D3 /* Masonry.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 04BE77B325101E01F2DF62B3C4072FC2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */; }; + 05B138C0C1E0DAF6AAD22A2DF87CF63C /* LYCoverView.m in Sources */ = {isa = PBXBuildFile; fileRef = 683633AA4F07AE2B13999181F36A892F /* LYCoverView.m */; }; + 0816A0F3D8B9CF1C332F331B6D947AFF /* Pods-LYToolsKit_Example-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 552A1FFC6C1789DEDF34B1D330ECDCBB /* Pods-LYToolsKit_Example-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 08548563B48BB35488B6D224DBBF4DD7 /* NSString+LYUnits.h in Headers */ = {isa = PBXBuildFile; fileRef = 196C2B0604A897C53943B3C89DC5825E /* NSString+LYUnits.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0B474A887D8F0632243132E65567A448 /* MASConstraint+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 77F2CF8861113B6F7AAE7EA65C6A7C1B /* MASConstraint+Private.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0DC2F4CCD226982061D86CB88ABA2F1E /* UIColor+LYString.h in Headers */ = {isa = PBXBuildFile; fileRef = B9B86AFEF0842FA05C786D3C2A2C72D3 /* UIColor+LYString.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0DEA62A206CF56890863EA0ED9D29F87 /* UIView+LYEnlargeTouchArea.m in Sources */ = {isa = PBXBuildFile; fileRef = A98480DA552C8C3F7A7EF23C59FA4CE3 /* UIView+LYEnlargeTouchArea.m */; }; + 0E57D14AF975A52A446DF2B05C0466A3 /* View+MASShorthandAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 61881F60AB333EA86CE7881063A4BA60 /* View+MASShorthandAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0F20898555A76114361C34270852143A /* MASCompositeConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 537638D0C329C86D4ED401237F5D895F /* MASCompositeConstraint.m */; }; + 17A8EBE6EB76463C46D8913AFDE932BE /* NSLayoutConstraint+MASDebugAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F69E835336330FF06E7268D32D667C9 /* NSLayoutConstraint+MASDebugAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1BC716DF86A363742337EE3D8D779649 /* MASViewAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 96DCAB46CA2931B8140F2639F17404AF /* MASViewAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1C493FFCED61D5E237A9EC22447B8C92 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B1DDB58FB8525698C8C459E7485FF5DB /* UIKit.framework */; }; + 1C9FC66EDF975AF796401A373F2D00C9 /* LYTouchTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = FC676DE1E2DFB1F6E062AFA3E5C2C34D /* LYTouchTrace.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1D0E95A256A2F415BC67E18522AC4111 /* LYCoverView.h in Headers */ = {isa = PBXBuildFile; fileRef = 1BDBFF09C5D71B570AC97F1F9731339A /* LYCoverView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1E0BFCF5DF1D3E24C6BA479319202145 /* LYUI.h in Headers */ = {isa = PBXBuildFile; fileRef = E9BEEAC28396C9494B9644C5C6A9A343 /* LYUI.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 27100B21A088F42841BBDD941136943F /* UIImage+LYImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 67E8D249737C149D34D03FC2DB901082 /* UIImage+LYImage.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 2878DA752BB01C266016595BFA7F347A /* UICountingLabel.h in Headers */ = {isa = PBXBuildFile; fileRef = 33B607A68E96FDC942AB9500B68C93F8 /* UICountingLabel.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3087DE886E48F936A4A4BFC9D10CACDD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */; }; + 3214666CFDA48659B084090D8F9AF344 /* ViewController+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = C6D5C71A7A4B3156186EC98A377E8543 /* ViewController+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 3295E1B7597963233CD66D603A6E9861 /* NSArray+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = B1C550CDA10D592ABB6A0383A3509F05 /* NSArray+MASAdditions.m */; }; + 33E325586DFF6871D190366D3E773F68 /* ViewController+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 3980E01C213ECEDEABAC38C1CFD3946D /* ViewController+MASAdditions.m */; }; + 35F2028864076DA02089DD949BBD1848 /* MASConstraintMaker.m in Sources */ = {isa = PBXBuildFile; fileRef = FF3818136FED67BD32E3A7FAEDE4F68F /* MASConstraintMaker.m */; }; + 3D19ABB4A14629E9EED9E3C0A5D41A1E /* UIImage+LYImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 23604F9CA0F3567F745FA2967EF28AA1 /* UIImage+LYImage.m */; }; + 3F4CFF77E94EDDC79A82E6A2856622E9 /* UIView+LYCut.m in Sources */ = {isa = PBXBuildFile; fileRef = 15AFF814BA92A3DA4CE3E347F5677E8D /* UIView+LYCut.m */; }; + 40803C4930693D6BEA3B342E48B33B76 /* UIButton+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = 0C96672A5CF4455CF8447E7874849E2D /* UIButton+LYExt.m */; }; + 40E0EBD3B82BE3C03CB89B3399125ACF /* MASConstraintMaker.h in Headers */ = {isa = PBXBuildFile; fileRef = A02D339E60E114FCC992372E93245BA1 /* MASConstraintMaker.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4564C070B0170BC26198543CC47C365F /* LYAlertController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4810F4F988DD7AF927FDC391B91247BC /* LYAlertController.m */; }; + 4696AB7EA110A0D7D76BC44A5E15CBB6 /* NSString+LYJudge.h in Headers */ = {isa = PBXBuildFile; fileRef = BFB8D819BA350BC8B1A53810C2A1CB3C /* NSString+LYJudge.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4CDC8CE7B8D1AB129F1061246BDE31A3 /* UIView+LYCut.h in Headers */ = {isa = PBXBuildFile; fileRef = 48C2C5672822A492A6A7769CD4CF8072 /* UIView+LYCut.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 4D7DD546B3455144A6C36C37227FE0A3 /* LYUIMacro.h in Headers */ = {isa = PBXBuildFile; fileRef = F1B9C9376523F943E82787C09FF62A3E /* LYUIMacro.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 57D6C25FD241F19366BAE20B123E3104 /* MASLayoutConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = C484EF8499F67EC81CA7E27930A63CDC /* MASLayoutConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 58834F03497C2A6D3C99EF84425940A6 /* MASLayoutConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 611E26C24600589F4729E5EF510272FB /* MASLayoutConstraint.m */; }; + 5F1A710A4CEDF323650B3E7F2D9D8079 /* UIImageView+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = C27CD0B4DE28BEDA216D6B633A9C06B6 /* UIImageView+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6451F48B3C59ED7D5363A4F55EE3EFCF /* NSObject+LYHook.h in Headers */ = {isa = PBXBuildFile; fileRef = BB9E4F00E57E74C0631864D577D1D3EB /* NSObject+LYHook.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 67BD9D6146383E7311AA3671CE9871CA /* UIButton+LYDelay.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A37A1C36317EB000B129AE413870B59 /* UIButton+LYDelay.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6829C728D042952398D73F31EB7AA4F3 /* LYAlertController.h in Headers */ = {isa = PBXBuildFile; fileRef = 0A67A141F6E68F87869451095C4D536D /* LYAlertController.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6A05A1BEF7E6D60CEE39B7CA2D14786D /* Masonry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BF35C23E029BF10AE1D3595169AFBCF /* Masonry.framework */; }; + 6F375E0360645008C02C3F4D1CB0B459 /* Masonry-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 818E990F262EC48F8DAAFD014D7E9234 /* Masonry-dummy.m */; }; + 6F5A2CB6DD7C421AF9845EEB9B234A10 /* UIButton+LYDelay.m in Sources */ = {isa = PBXBuildFile; fileRef = AF3EBA0EB85D2685F609D7E122C4A159 /* UIButton+LYDelay.m */; }; + 7008C0AEE623980C1764D0536D9F5AE2 /* LYReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 4DCACB8228CE2B4661BC9AA051E8DD0E /* LYReachability.m */; }; + 7014C6AB228A79B03B1E7888EA4A563F /* UIView+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = 3FB6791CB1DB6EBC5E365A0B71BF19DD /* UIView+LYExt.m */; }; + 7119276F9BDF5E55A5E43B6084E27E1C /* UILabel+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = AB532DBF747352456798410FBF1E3FA7 /* UILabel+LYExt.m */; }; + 7365D7982617DFA4193827244C4CD622 /* UIImage+LYResize.h in Headers */ = {isa = PBXBuildFile; fileRef = 04BF60128215932EB4BABBC24610631D /* UIImage+LYResize.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 74D7B1D032D13886C8666269C803350B /* MASConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = ECBBB506D4D551AB1A637EE3145A459E /* MASConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 767471620BF9D434BAEE4BD0D9096223 /* UITextField+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = D49F54F585B08430AC9FA9BCB83F7787 /* UITextField+LYExt.m */; }; + 78BD51B1A87CBE5F53E099C348BC9515 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */; }; + 8214827B85980C289947EAF0C25ED57A /* LYToolsKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 81F895C8CED0F64F5D149B31D1FB13EF /* LYToolsKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 86C3D895D2B7BBA947C5DFC3503E420D /* UIImage+LYResize.m in Sources */ = {isa = PBXBuildFile; fileRef = 9DA160E97E13528F9001851365E5C788 /* UIImage+LYResize.m */; }; + 8C4AA277131CC7C40912B29AF2E7C31A /* NSString+LYUnits.m in Sources */ = {isa = PBXBuildFile; fileRef = BFB27E982CADBECED6AFF75A926548E0 /* NSString+LYUnits.m */; }; + 8C76EADF5DCEF91C6CBDFDCC9020CF78 /* NSString+LYJS.h in Headers */ = {isa = PBXBuildFile; fileRef = 6A1486A3542DD77C329842884A445B32 /* NSString+LYJS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 91D46E9E56F949819E40D8B689634694 /* MASConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 986CB32629319F7F2256662716334944 /* MASConstraint.m */; }; + 9AB143D8C95AC17AE5BF8ABE9AC80E38 /* Masonry-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1FB8A9BDAB144F118F7F74E1F2B74097 /* Masonry-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A366D3DFE5CF7BFB27C5B8BFA0E1FC84 /* MASViewAttribute.m in Sources */ = {isa = PBXBuildFile; fileRef = 0925CC604B01F156279E8952DDE3EDDB /* MASViewAttribute.m */; }; + A3F6D9D914A6A8C679B0916085221406 /* UIButton+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = D967C14F01C1C1C3439CBC8B030C8079 /* UIButton+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AACCD6CB3297E531005DFA8E610F5DB9 /* LYToolsKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3636A603E4FF89A45494D238EABCF7DB /* LYToolsKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ABDF158B500EA63AF742C3782E3A9B5D /* Pods-LYToolsKit_Tests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = FCA511F5F6BB1668B66B3B451F54E5E8 /* Pods-LYToolsKit_Tests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + ADC9751E9A659ED0DA79AA9D2FEA180A /* Pods-LYToolsKit_Example-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 821C12BF8CD1B5F411C10B234783C588 /* Pods-LYToolsKit_Example-dummy.m */; }; + AE5132328F9634BC8DD92D85E2A10083 /* NSString+LYURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D6947D83FBD7500F15648428824BD8 /* NSString+LYURL.h */; settings = {ATTRIBUTES = (Public, ); }; }; + AF19A4D823578ABD980565ED009A4D02 /* NSString+LYJS.m in Sources */ = {isa = PBXBuildFile; fileRef = CDF68572B6A08EF04829F89EF56BB6D2 /* NSString+LYJS.m */; }; + B24AFBD09EE453C6E55013E9C5CD2C81 /* NSDate+LYString.h in Headers */ = {isa = PBXBuildFile; fileRef = 465406F4B94E031B1325286CB2D5811E /* NSDate+LYString.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BA141360B73C7F0A98370C1C91DDEA8F /* LYTouchTrace.m in Sources */ = {isa = PBXBuildFile; fileRef = 581D4A415880BE8C4DC3B81EE1927FBB /* LYTouchTrace.m */; }; + BA73CC05E3A10FB794CAFEB7D2EA924C /* UIImage+LYBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 0A846BE7BEC8F184DBE1D1EDA8904FE6 /* UIImage+LYBase64.m */; }; + BF4B4A8206329014A9725FBBC13FDD27 /* UITextField+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF436FF766C7E5DCB7DABB65A691349 /* UITextField+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C10C6EED54B42F96B31850781495B54A /* NSLayoutConstraint+MASDebugAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A214B89738295B4A4B00EEB1960E8865 /* NSLayoutConstraint+MASDebugAdditions.m */; }; + C2525CFA00FDB5632B675852EBCEEB50 /* View+MASAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EC0A25DD6F58D072A4ACFC92D9237BF /* View+MASAdditions.m */; }; + C414F10EC5C8ABD840301A460DB5BA1B /* UILabel+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = B7894437B6122F2EDC551B618E0C7F12 /* UILabel+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C490407D2173112FFF1A7C5AF0B9FF7D /* UIView+LYTouch.h in Headers */ = {isa = PBXBuildFile; fileRef = 672C8723AF78A75DC0F883FEE5AE3203 /* UIView+LYTouch.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C4C42C91DE8EEC9EC47A146F32D2A6F4 /* UIView+LYEnlargeTouchArea.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD7AB2B072A269A1136C0FAE9E67E87 /* UIView+LYEnlargeTouchArea.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C556C6D80A8F5A3B279B29B25F7968E7 /* LYFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 28843D7AE3060E51E84F08174C324648 /* LYFoundation.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C80A1B087ABF70566A91FF1191A43B2F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */; }; + C8F37F708E3F831F095AC94F60F2A396 /* LYToolsKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 493A347932C5AC57908A69F5FC24B93F /* LYToolsKit-dummy.m */; }; + D0C68F1C1CA5AAEBE17169DD4C070D29 /* UIColor+LYString.m in Sources */ = {isa = PBXBuildFile; fileRef = 0BE1FAC22CBD216DEA2BE8B3A5A3AAF6 /* UIColor+LYString.m */; }; + D2256D18E9D1256C77BD4958959E3DBF /* Pods-LYToolsKit_Tests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 85214D4A9C04CC9D2F78C39B6D34E3F2 /* Pods-LYToolsKit_Tests-dummy.m */; }; + D3BA89F403D3BFA7E086AB0710694106 /* UIDevice+LYHardware.h in Headers */ = {isa = PBXBuildFile; fileRef = 12CFA4BEC4C7405507FC542AF6B40846 /* UIDevice+LYHardware.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D523576EB3ED95E2E1D076D814EB0D45 /* MASUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = AD04C760F0EB4FE7B23D85D56145A97F /* MASUtilities.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D695858BB153D40D106A6655AF15807A /* UIView+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A8C97ECA80C361E834AF7EC34701E8 /* UIView+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D6F188223C3612B7C8B79C0E6F662493 /* View+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = FF217FE4E512E3883BAD867868CB42D9 /* View+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + D8440EF602D29D94D63B8A99ACD33659 /* LYReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = B4825669B5B7A9C86E622C264850A443 /* LYReachability.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DB0151C1DA24AEB1C99224D00510E643 /* UIImageView+LYExt.m in Sources */ = {isa = PBXBuildFile; fileRef = F0F45D89053594C8F87E1906592CC229 /* UIImageView+LYExt.m */; }; + DC75075EEDBD992B2A87E99845FB48AC /* LYUtility.h in Headers */ = {isa = PBXBuildFile; fileRef = A508CB0C1DCED313911F1DC58C2C55F5 /* LYUtility.h */; settings = {ATTRIBUTES = (Public, ); }; }; + DE10C9844D606F7F02F68DB1B1B726AA /* NSString+LYURL.m in Sources */ = {isa = PBXBuildFile; fileRef = E9DEC28C5606216701DC9E9430BC4490 /* NSString+LYURL.m */; }; + DE23BA00218213B72CDF5162C59F2A11 /* UICountingLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA59942D6EBA5736EE309A6E23B292E /* UICountingLabel.m */; }; + DE531B2448B5EB642DE1F1BB1C28E7C7 /* UIImage+LYBase64.h in Headers */ = {isa = PBXBuildFile; fileRef = 885E61BB33875C4D5B5E2F455BBF1C09 /* UIImage+LYBase64.h */; settings = {ATTRIBUTES = (Public, ); }; }; + E069DDC88033ED19344DC2A65C783FE8 /* NSArray+MASAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 5A649F9297535214EF97548C9EA9FA33 /* NSArray+MASAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EAC8A50047172E142B30C4E53DDA53F0 /* NSObject+LYHook.m in Sources */ = {isa = PBXBuildFile; fileRef = D61BBF1AE50765DD1F4B3B0BCEE138AC /* NSObject+LYHook.m */; }; + EB53AA55B7F9A48C801DD681FF588337 /* UIDevice+LYHardware.m in Sources */ = {isa = PBXBuildFile; fileRef = 3906ADFF4B51521B9033596D88B6DBB6 /* UIDevice+LYHardware.m */; }; + EB5BDE84A54C5EE0B0CB6F950EA9DAE4 /* NSArray+MASShorthandAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = F8187F5CAD09C6C6B2B54C65B4A807C9 /* NSArray+MASShorthandAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; }; + EC007222678CADECC6E0469689874A91 /* MASCompositeConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 79BEFB59B86F59C579FF7594DCF78FEB /* MASCompositeConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F100E4DDE525E87DD15AF3A6A8C9FB52 /* NSDate+LYString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AD57AED1FF8AC06A681B74B4390B4E2 /* NSDate+LYString.m */; }; + F3C444E6600DC899E4A31AECEB26D72D /* NSString+LYJudge.m in Sources */ = {isa = PBXBuildFile; fileRef = C79EC4A9E6EFB8046BFF48C54E4255B5 /* NSString+LYJudge.m */; }; + F4754805A81DF7415472DFBAC0E8876F /* MASViewConstraint.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E4875E63FFAFF84A3CDFE99F28B551E /* MASViewConstraint.m */; }; + F5237922AAC1AE6B0106E2899A01F5F7 /* MASViewConstraint.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F0183E721D7FD6AF70B4A911C1B1B95 /* MASViewConstraint.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FAF661946E012B733B8BA27FDCEFDE96 /* UITextView+LYExt.h in Headers */ = {isa = PBXBuildFile; fileRef = 67B1520A5AB0BB5A739FF5F6F15E0D7F /* UITextView+LYExt.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FD4221C22DF77624AA660005BB83F925 /* UIView+LYTouch.m in Sources */ = {isa = PBXBuildFile; fileRef = B181DAF6EA4E5EF60B01379BBC43B7F7 /* UIView+LYTouch.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 5975DE32C1E4C705970715B6997E480C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15980544DA3C24331A66A6E0719CD5E5; + remoteInfo = Masonry; + }; + 7474744F9A3C25475472B20B74D708E7 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = E28A52CD8CF1555D022B6E0B1615F560; + remoteInfo = "Pods-LYToolsKit_Example"; + }; + AC77CD8B341AF4CABC86322E4502A320 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 32454BBF377FE9AB11384FCB627E119F; + remoteInfo = LYToolsKit; + }; + E0FFDDF0F0536135C3F948F3F99050DA /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D41D8CD98F00B204E9800998ECF8427E /* Project object */; + proxyType = 1; + remoteGlobalIDString = 15980544DA3C24331A66A6E0719CD5E5; + remoteInfo = Masonry; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 04BF60128215932EB4BABBC24610631D /* UIImage+LYResize.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIImage+LYResize.h"; sourceTree = ""; }; + 0925CC604B01F156279E8952DDE3EDDB /* MASViewAttribute.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASViewAttribute.m; path = Masonry/MASViewAttribute.m; sourceTree = ""; }; + 0A67A141F6E68F87869451095C4D536D /* LYAlertController.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = LYAlertController.h; sourceTree = ""; }; + 0A846BE7BEC8F184DBE1D1EDA8904FE6 /* UIImage+LYBase64.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LYBase64.m"; sourceTree = ""; }; + 0BE1FAC22CBD216DEA2BE8B3A5A3AAF6 /* UIColor+LYString.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIColor+LYString.m"; sourceTree = ""; }; + 0C96672A5CF4455CF8447E7874849E2D /* UIButton+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIButton+LYExt.m"; sourceTree = ""; }; + 0CBBD268F2C0E7A490AF022775720DC0 /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Masonry.framework; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 12CFA4BEC4C7405507FC542AF6B40846 /* UIDevice+LYHardware.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIDevice+LYHardware.h"; sourceTree = ""; }; + 134C6343D3A07A5B3AE29B85FF79707B /* Pods-LYToolsKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LYToolsKit_Example.release.xcconfig"; sourceTree = ""; }; + 15AFF814BA92A3DA4CE3E347F5677E8D /* UIView+LYCut.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIView+LYCut.m"; sourceTree = ""; }; + 196C2B0604A897C53943B3C89DC5825E /* NSString+LYUnits.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSString+LYUnits.h"; sourceTree = ""; }; + 1BDBFF09C5D71B570AC97F1F9731339A /* LYCoverView.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = LYCoverView.h; sourceTree = ""; }; + 1C3A1C89B5BB371E09E8F726013D9255 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 1F0183E721D7FD6AF70B4A911C1B1B95 /* MASViewConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewConstraint.h; path = Masonry/MASViewConstraint.h; sourceTree = ""; }; + 1FB8A9BDAB144F118F7F74E1F2B74097 /* Masonry-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Masonry-umbrella.h"; sourceTree = ""; }; + 22A8C97ECA80C361E834AF7EC34701E8 /* UIView+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIView+LYExt.h"; sourceTree = ""; }; + 23604F9CA0F3567F745FA2967EF28AA1 /* UIImage+LYImage.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LYImage.m"; sourceTree = ""; }; + 273AFD9939842DC75C0B2051B99A8BD1 /* Pods-LYToolsKit_Tests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-LYToolsKit_Tests-acknowledgements.plist"; sourceTree = ""; }; + 28843D7AE3060E51E84F08174C324648 /* LYFoundation.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LYFoundation.h; path = LYToolsKit/Foundation/LYFoundation.h; sourceTree = ""; }; + 2CA59942D6EBA5736EE309A6E23B292E /* UICountingLabel.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = UICountingLabel.m; sourceTree = ""; }; + 2DD7AB2B072A269A1136C0FAE9E67E87 /* UIView+LYEnlargeTouchArea.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIView+LYEnlargeTouchArea.h"; sourceTree = ""; }; + 2F69E835336330FF06E7268D32D667C9 /* NSLayoutConstraint+MASDebugAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSLayoutConstraint+MASDebugAdditions.h"; path = "Masonry/NSLayoutConstraint+MASDebugAdditions.h"; sourceTree = ""; }; + 303B58A2959C8EEE96799AD558DDA1D3 /* Masonry.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = Masonry.h; path = Masonry/Masonry.h; sourceTree = ""; }; + 3144325017A9C27CF69F267A1F9233B3 /* Pods-LYToolsKit_Tests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LYToolsKit_Tests-frameworks.sh"; sourceTree = ""; }; + 33B607A68E96FDC942AB9500B68C93F8 /* UICountingLabel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = UICountingLabel.h; sourceTree = ""; }; + 347CB52270B9932A21AD45534B01247F /* LYToolsKit.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; path = LYToolsKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 3636A603E4FF89A45494D238EABCF7DB /* LYToolsKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LYToolsKit-umbrella.h"; sourceTree = ""; }; + 36C40591902578632718E317104564A2 /* Masonry.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Masonry.modulemap; sourceTree = ""; }; + 3839A1AD8E883475BF8F8C6274F8A953 /* Masonry.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Masonry.xcconfig; sourceTree = ""; }; + 3906ADFF4B51521B9033596D88B6DBB6 /* UIDevice+LYHardware.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIDevice+LYHardware.m"; sourceTree = ""; }; + 3980E01C213ECEDEABAC38C1CFD3946D /* ViewController+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "ViewController+MASAdditions.m"; path = "Masonry/ViewController+MASAdditions.m"; sourceTree = ""; }; + 3FB6791CB1DB6EBC5E365A0B71BF19DD /* UIView+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIView+LYExt.m"; sourceTree = ""; }; + 450784CC39ADC3AC569ADFA59CF36F7C /* Pods_LYToolsKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_LYToolsKit_Tests.framework; path = "Pods-LYToolsKit_Tests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 465406F4B94E031B1325286CB2D5811E /* NSDate+LYString.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSDate+LYString.h"; sourceTree = ""; }; + 4810F4F988DD7AF927FDC391B91247BC /* LYAlertController.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = LYAlertController.m; sourceTree = ""; }; + 48C2C5672822A492A6A7769CD4CF8072 /* UIView+LYCut.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIView+LYCut.h"; sourceTree = ""; }; + 493A347932C5AC57908A69F5FC24B93F /* LYToolsKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "LYToolsKit-dummy.m"; sourceTree = ""; }; + 4AD57AED1FF8AC06A681B74B4390B4E2 /* NSDate+LYString.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSDate+LYString.m"; sourceTree = ""; }; + 4BF436FF766C7E5DCB7DABB65A691349 /* UITextField+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UITextField+LYExt.h"; sourceTree = ""; }; + 4DCACB8228CE2B4661BC9AA051E8DD0E /* LYReachability.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = LYReachability.m; sourceTree = ""; }; + 53708DD2D4606CC529E850963494D8E2 /* LYToolsKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = LYToolsKit.framework; path = LYToolsKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 537638D0C329C86D4ED401237F5D895F /* MASCompositeConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASCompositeConstraint.m; path = Masonry/MASCompositeConstraint.m; sourceTree = ""; }; + 552A1FFC6C1789DEDF34B1D330ECDCBB /* Pods-LYToolsKit_Example-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-LYToolsKit_Example-umbrella.h"; sourceTree = ""; }; + 581D4A415880BE8C4DC3B81EE1927FBB /* LYTouchTrace.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = LYTouchTrace.m; sourceTree = ""; }; + 5A649F9297535214EF97548C9EA9FA33 /* NSArray+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+MASAdditions.h"; path = "Masonry/NSArray+MASAdditions.h"; sourceTree = ""; }; + 611E26C24600589F4729E5EF510272FB /* MASLayoutConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASLayoutConstraint.m; path = Masonry/MASLayoutConstraint.m; sourceTree = ""; }; + 61881F60AB333EA86CE7881063A4BA60 /* View+MASShorthandAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASShorthandAdditions.h"; path = "Masonry/View+MASShorthandAdditions.h"; sourceTree = ""; }; + 66AEB8BDA8F54BFF86A9F82E3713720B /* LYToolsKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = LYToolsKit.xcconfig; sourceTree = ""; }; + 672C8723AF78A75DC0F883FEE5AE3203 /* UIView+LYTouch.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIView+LYTouch.h"; sourceTree = ""; }; + 672E60046F61B699AEB2EC00E1BA5B5D /* LYToolsKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = LYToolsKit.modulemap; sourceTree = ""; }; + 67B1520A5AB0BB5A739FF5F6F15E0D7F /* UITextView+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UITextView+LYExt.h"; sourceTree = ""; }; + 67E8D249737C149D34D03FC2DB901082 /* UIImage+LYImage.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIImage+LYImage.h"; sourceTree = ""; }; + 683633AA4F07AE2B13999181F36A892F /* LYCoverView.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = LYCoverView.m; sourceTree = ""; }; + 6A1486A3542DD77C329842884A445B32 /* NSString+LYJS.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSString+LYJS.h"; sourceTree = ""; }; + 6A37A1C36317EB000B129AE413870B59 /* UIButton+LYDelay.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIButton+LYDelay.h"; sourceTree = ""; }; + 6BF35C23E029BF10AE1D3595169AFBCF /* Masonry.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Masonry.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6E4875E63FFAFF84A3CDFE99F28B551E /* MASViewConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASViewConstraint.m; path = Masonry/MASViewConstraint.m; sourceTree = ""; }; + 6FC421FC0FDF34FA104FB736C6A27B3C /* Pods-LYToolsKit_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LYToolsKit_Tests.release.xcconfig"; sourceTree = ""; }; + 729254CF6FFD7659EC028B8FB9E2E2F3 /* Pods-LYToolsKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LYToolsKit_Example.debug.xcconfig"; sourceTree = ""; }; + 77F2CF8861113B6F7AAE7EA65C6A7C1B /* MASConstraint+Private.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "MASConstraint+Private.h"; path = "Masonry/MASConstraint+Private.h"; sourceTree = ""; }; + 79BEFB59B86F59C579FF7594DCF78FEB /* MASCompositeConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASCompositeConstraint.h; path = Masonry/MASCompositeConstraint.h; sourceTree = ""; }; + 7EC0A25DD6F58D072A4ACFC92D9237BF /* View+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "View+MASAdditions.m"; path = "Masonry/View+MASAdditions.m"; sourceTree = ""; }; + 818E990F262EC48F8DAAFD014D7E9234 /* Masonry-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Masonry-dummy.m"; sourceTree = ""; }; + 81F895C8CED0F64F5D149B31D1FB13EF /* LYToolsKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LYToolsKit.h; path = LYToolsKit/LYToolsKit.h; sourceTree = ""; }; + 821C12BF8CD1B5F411C10B234783C588 /* Pods-LYToolsKit_Example-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-LYToolsKit_Example-dummy.m"; sourceTree = ""; }; + 8223B4B9D2A5B7C0F33D1BC8949FA9F5 /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 824E4F655A70302BE021390DC9438509 /* Pods_LYToolsKit_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_LYToolsKit_Example.framework; path = "Pods-LYToolsKit_Example.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 83D6947D83FBD7500F15648428824BD8 /* NSString+LYURL.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSString+LYURL.h"; sourceTree = ""; }; + 85214D4A9C04CC9D2F78C39B6D34E3F2 /* Pods-LYToolsKit_Tests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-LYToolsKit_Tests-dummy.m"; sourceTree = ""; }; + 870B3CF1AAF901ACDC1A1A5883C6F6E1 /* Pods-LYToolsKit_Example-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LYToolsKit_Example-frameworks.sh"; sourceTree = ""; }; + 885E61BB33875C4D5B5E2F455BBF1C09 /* UIImage+LYBase64.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIImage+LYBase64.h"; sourceTree = ""; }; + 918BDFA2EDCF96EF97BB5788D8A924FA /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 96DCAB46CA2931B8140F2639F17404AF /* MASViewAttribute.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASViewAttribute.h; path = Masonry/MASViewAttribute.h; sourceTree = ""; }; + 986CB32629319F7F2256662716334944 /* MASConstraint.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraint.m; path = Masonry/MASConstraint.m; sourceTree = ""; }; + 9A54DF97A912E6A76E65D4EE21265483 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + 9DA160E97E13528F9001851365E5C788 /* UIImage+LYResize.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIImage+LYResize.m"; sourceTree = ""; }; + A02D339E60E114FCC992372E93245BA1 /* MASConstraintMaker.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraintMaker.h; path = Masonry/MASConstraintMaker.h; sourceTree = ""; }; + A214B89738295B4A4B00EEB1960E8865 /* NSLayoutConstraint+MASDebugAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSLayoutConstraint+MASDebugAdditions.m"; path = "Masonry/NSLayoutConstraint+MASDebugAdditions.m"; sourceTree = ""; }; + A508CB0C1DCED313911F1DC58C2C55F5 /* LYUtility.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LYUtility.h; path = LYToolsKit/Utility/LYUtility.h; sourceTree = ""; }; + A51771963E8DF9900E19CFED0EB67A30 /* Pods-LYToolsKit_Example-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LYToolsKit_Example-resources.sh"; sourceTree = ""; }; + A98480DA552C8C3F7A7EF23C59FA4CE3 /* UIView+LYEnlargeTouchArea.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIView+LYEnlargeTouchArea.m"; sourceTree = ""; }; + AB532DBF747352456798410FBF1E3FA7 /* UILabel+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UILabel+LYExt.m"; sourceTree = ""; }; + AD04C760F0EB4FE7B23D85D56145A97F /* MASUtilities.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASUtilities.h; path = Masonry/MASUtilities.h; sourceTree = ""; }; + AEE8FA4345312638361B8A6552E2C2D3 /* Pods-LYToolsKit_Example.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-LYToolsKit_Example.modulemap"; sourceTree = ""; }; + AF3EBA0EB85D2685F609D7E122C4A159 /* UIButton+LYDelay.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIButton+LYDelay.m"; sourceTree = ""; }; + B01971B212F763268E4AABFAC75CF18E /* Pods-LYToolsKit_Example-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-LYToolsKit_Example-acknowledgements.markdown"; sourceTree = ""; }; + B181DAF6EA4E5EF60B01379BBC43B7F7 /* UIView+LYTouch.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIView+LYTouch.m"; sourceTree = ""; }; + B1C550CDA10D592ABB6A0383A3509F05 /* NSArray+MASAdditions.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = "NSArray+MASAdditions.m"; path = "Masonry/NSArray+MASAdditions.m"; sourceTree = ""; }; + B1DDB58FB8525698C8C459E7485FF5DB /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; + B4825669B5B7A9C86E622C264850A443 /* LYReachability.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = LYReachability.h; sourceTree = ""; }; + B58CA6409B8D9E2E02C771229014BEDC /* Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + B6F80727A3F8E984518A9D5ECFBB5DBA /* Pods-LYToolsKit_Example-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-LYToolsKit_Example-acknowledgements.plist"; sourceTree = ""; }; + B7894437B6122F2EDC551B618E0C7F12 /* UILabel+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UILabel+LYExt.h"; sourceTree = ""; }; + B9B86AFEF0842FA05C786D3C2A2C72D3 /* UIColor+LYString.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIColor+LYString.h"; sourceTree = ""; }; + BB9E4F00E57E74C0631864D577D1D3EB /* NSObject+LYHook.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSObject+LYHook.h"; sourceTree = ""; }; + BE3C47B92537A97A3116DF9CF88E1948 /* Pods-LYToolsKit_Tests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-LYToolsKit_Tests.modulemap"; sourceTree = ""; }; + BFB27E982CADBECED6AFF75A926548E0 /* NSString+LYUnits.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSString+LYUnits.m"; sourceTree = ""; }; + BFB8D819BA350BC8B1A53810C2A1CB3C /* NSString+LYJudge.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "NSString+LYJudge.h"; sourceTree = ""; }; + C27CD0B4DE28BEDA216D6B633A9C06B6 /* UIImageView+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIImageView+LYExt.h"; sourceTree = ""; }; + C484EF8499F67EC81CA7E27930A63CDC /* MASLayoutConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASLayoutConstraint.h; path = Masonry/MASLayoutConstraint.h; sourceTree = ""; }; + C6D5C71A7A4B3156186EC98A377E8543 /* ViewController+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "ViewController+MASAdditions.h"; path = "Masonry/ViewController+MASAdditions.h"; sourceTree = ""; }; + C79EC4A9E6EFB8046BFF48C54E4255B5 /* NSString+LYJudge.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSString+LYJudge.m"; sourceTree = ""; }; + CDF68572B6A08EF04829F89EF56BB6D2 /* NSString+LYJS.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSString+LYJS.m"; sourceTree = ""; }; + CF513E2D56BECC54035E618D2EB531D9 /* LYToolsKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "LYToolsKit-prefix.pch"; sourceTree = ""; }; + D452E84A7523E3769E23601FDE752430 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; path = LICENSE; sourceTree = ""; }; + D49F54F585B08430AC9FA9BCB83F7787 /* UITextField+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UITextField+LYExt.m"; sourceTree = ""; }; + D61BBF1AE50765DD1F4B3B0BCEE138AC /* NSObject+LYHook.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSObject+LYHook.m"; sourceTree = ""; }; + D967C14F01C1C1C3439CBC8B030C8079 /* UIButton+LYExt.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "UIButton+LYExt.h"; sourceTree = ""; }; + DA6995D5A94C6B452D915B626C6B84D5 /* Pods-LYToolsKit_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-LYToolsKit_Tests.debug.xcconfig"; sourceTree = ""; }; + E09AC619331DDCCFE5FBFD1764B106FB /* Pods-LYToolsKit_Tests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-LYToolsKit_Tests-acknowledgements.markdown"; sourceTree = ""; }; + E77198CEE0CF691E7915471E9F19CD96 /* Masonry-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Masonry-prefix.pch"; sourceTree = ""; }; + E9BEEAC28396C9494B9644C5C6A9A343 /* LYUI.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = LYUI.h; path = LYToolsKit/UI/LYUI.h; sourceTree = ""; }; + E9DEC28C5606216701DC9E9430BC4490 /* NSString+LYURL.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "NSString+LYURL.m"; sourceTree = ""; }; + ECBBB506D4D551AB1A637EE3145A459E /* MASConstraint.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = MASConstraint.h; path = Masonry/MASConstraint.h; sourceTree = ""; }; + F0F45D89053594C8F87E1906592CC229 /* UIImageView+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+LYExt.m"; sourceTree = ""; }; + F1B9C9376523F943E82787C09FF62A3E /* LYUIMacro.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = LYUIMacro.h; sourceTree = ""; }; + F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; + F8187F5CAD09C6C6B2B54C65B4A807C9 /* NSArray+MASShorthandAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "NSArray+MASShorthandAdditions.h"; path = "Masonry/NSArray+MASShorthandAdditions.h"; sourceTree = ""; }; + FB7950BC9FD72E2C159376EAA5262D3B /* Pods-LYToolsKit_Tests-resources.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-LYToolsKit_Tests-resources.sh"; sourceTree = ""; }; + FC63FA8DE6D1008CCA734F85EA6A4A3F /* UITextView+LYExt.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "UITextView+LYExt.m"; sourceTree = ""; }; + FC676DE1E2DFB1F6E062AFA3E5C2C34D /* LYTouchTrace.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = LYTouchTrace.h; sourceTree = ""; }; + FCA511F5F6BB1668B66B3B451F54E5E8 /* Pods-LYToolsKit_Tests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-LYToolsKit_Tests-umbrella.h"; sourceTree = ""; }; + FF217FE4E512E3883BAD867868CB42D9 /* View+MASAdditions.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = "View+MASAdditions.h"; path = "Masonry/View+MASAdditions.h"; sourceTree = ""; }; + FF3818136FED67BD32E3A7FAEDE4F68F /* MASConstraintMaker.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = MASConstraintMaker.m; path = Masonry/MASConstraintMaker.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 554A7974F11410759DA697E6E10C4A9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C80A1B087ABF70566A91FF1191A43B2F /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 98096ADBF0C883FFDE258AC22F41F4D5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 78BD51B1A87CBE5F53E099C348BC9515 /* Foundation.framework in Frameworks */, + 1C493FFCED61D5E237A9EC22447B8C92 /* UIKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB7CA96854430D3226C4EA8354409542 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 04BE77B325101E01F2DF62B3C4072FC2 /* Foundation.framework in Frameworks */, + 6A05A1BEF7E6D60CEE39B7CA2D14786D /* Masonry.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F9E3D32F04E544FB59D92970C564FA40 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3087DE886E48F936A4A4BFC9D10CACDD /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 01D537520CB08933DF8DC6FE7AA9AE5D /* Pod */ = { + isa = PBXGroup; + children = ( + D452E84A7523E3769E23601FDE752430 /* LICENSE */, + 347CB52270B9932A21AD45534B01247F /* LYToolsKit.podspec */, + 9A54DF97A912E6A76E65D4EE21265483 /* README.md */, + ); + name = Pod; + sourceTree = ""; + }; + 04AE54EF62BEB8811630AE7A7B7D7DCB /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + DF10BE8201E9BBD25823722563DB1D55 /* Pods-LYToolsKit_Example */, + 4C093B2D9E1EEFA3D99F7D5ED1F2A425 /* Pods-LYToolsKit_Tests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 0539C0CC852D4BECBEF5EF6FFBB627F4 /* UIView */ = { + isa = PBXGroup; + children = ( + 48C2C5672822A492A6A7769CD4CF8072 /* UIView+LYCut.h */, + 15AFF814BA92A3DA4CE3E347F5677E8D /* UIView+LYCut.m */, + 2DD7AB2B072A269A1136C0FAE9E67E87 /* UIView+LYEnlargeTouchArea.h */, + A98480DA552C8C3F7A7EF23C59FA4CE3 /* UIView+LYEnlargeTouchArea.m */, + 672C8723AF78A75DC0F883FEE5AE3203 /* UIView+LYTouch.h */, + B181DAF6EA4E5EF60B01379BBC43B7F7 /* UIView+LYTouch.m */, + ); + name = UIView; + path = UIView; + sourceTree = ""; + }; + 1512A7C7754C0FB9A56E10404E84777B /* Development Pods */ = { + isa = PBXGroup; + children = ( + 859D84C773C9CFA1B7AE31C04A8A17D2 /* LYToolsKit */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 29CDE67D5B5409A49622BAC53368D0F1 /* NSString */ = { + isa = PBXGroup; + children = ( + 6A1486A3542DD77C329842884A445B32 /* NSString+LYJS.h */, + CDF68572B6A08EF04829F89EF56BB6D2 /* NSString+LYJS.m */, + BFB8D819BA350BC8B1A53810C2A1CB3C /* NSString+LYJudge.h */, + C79EC4A9E6EFB8046BFF48C54E4255B5 /* NSString+LYJudge.m */, + 196C2B0604A897C53943B3C89DC5825E /* NSString+LYUnits.h */, + BFB27E982CADBECED6AFF75A926548E0 /* NSString+LYUnits.m */, + 83D6947D83FBD7500F15648428824BD8 /* NSString+LYURL.h */, + E9DEC28C5606216701DC9E9430BC4490 /* NSString+LYURL.m */, + ); + name = NSString; + path = LYToolsKit/Foundation/NSString; + sourceTree = ""; + }; + 2A1F39AB7C05F465E8BBA86F344C228C /* UIColor */ = { + isa = PBXGroup; + children = ( + B9B86AFEF0842FA05C786D3C2A2C72D3 /* UIColor+LYString.h */, + 0BE1FAC22CBD216DEA2BE8B3A5A3AAF6 /* UIColor+LYString.m */, + ); + name = UIColor; + path = UIColor; + sourceTree = ""; + }; + 2E713D287BFD0074B635686CAE7F084C /* Utility */ = { + isa = PBXGroup; + children = ( + A508CB0C1DCED313911F1DC58C2C55F5 /* LYUtility.h */, + 6903488E2B899FAFF492875EE9EDE680 /* UIApplication */, + B35E6B1B1A188487D39300F447EE0510 /* UILabel */, + D48AB0718339CB32D162823FE562F570 /* UIView */, + ); + name = Utility; + sourceTree = ""; + }; + 477E4786712464258D7B1F2B64808265 /* UI */ = { + isa = PBXGroup; + children = ( + 9945FAD982CF6A9DD7ECD522C735A4A2 /* Reachability */, + 8CD0E004CAAE14B686346E81871DB97F /* UIAlert */, + E7E97803AED1140C9BD47C31D24A2598 /* UIButton */, + 2A1F39AB7C05F465E8BBA86F344C228C /* UIColor */, + 96F8A201C5B9BD853F7ED6CDFC4740CE /* UIDevice */, + 6D65D24776D3F3726263C8BB464B2717 /* UIImage */, + 0539C0CC852D4BECBEF5EF6FFBB627F4 /* UIView */, + F4B6EF47F18DEE2817D6B6B3BFEFFF15 /* UIViewExt */, + ); + name = UI; + path = LYToolsKit/UI/UI; + sourceTree = ""; + }; + 4C093B2D9E1EEFA3D99F7D5ED1F2A425 /* Pods-LYToolsKit_Tests */ = { + isa = PBXGroup; + children = ( + 1C3A1C89B5BB371E09E8F726013D9255 /* Info.plist */, + BE3C47B92537A97A3116DF9CF88E1948 /* Pods-LYToolsKit_Tests.modulemap */, + E09AC619331DDCCFE5FBFD1764B106FB /* Pods-LYToolsKit_Tests-acknowledgements.markdown */, + 273AFD9939842DC75C0B2051B99A8BD1 /* Pods-LYToolsKit_Tests-acknowledgements.plist */, + 85214D4A9C04CC9D2F78C39B6D34E3F2 /* Pods-LYToolsKit_Tests-dummy.m */, + 3144325017A9C27CF69F267A1F9233B3 /* Pods-LYToolsKit_Tests-frameworks.sh */, + FB7950BC9FD72E2C159376EAA5262D3B /* Pods-LYToolsKit_Tests-resources.sh */, + FCA511F5F6BB1668B66B3B451F54E5E8 /* Pods-LYToolsKit_Tests-umbrella.h */, + DA6995D5A94C6B452D915B626C6B84D5 /* Pods-LYToolsKit_Tests.debug.xcconfig */, + 6FC421FC0FDF34FA104FB736C6A27B3C /* Pods-LYToolsKit_Tests.release.xcconfig */, + ); + name = "Pods-LYToolsKit_Tests"; + path = "Target Support Files/Pods-LYToolsKit_Tests"; + sourceTree = ""; + }; + 59511511C2B4BC905C933DCC67E365C4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6BF35C23E029BF10AE1D3595169AFBCF /* Masonry.framework */, + DC7E422848DE4538BD67FA85E4EF5FAF /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6903488E2B899FAFF492875EE9EDE680 /* UIApplication */ = { + isa = PBXGroup; + children = ( + FC676DE1E2DFB1F6E062AFA3E5C2C34D /* LYTouchTrace.h */, + 581D4A415880BE8C4DC3B81EE1927FBB /* LYTouchTrace.m */, + ); + name = UIApplication; + path = LYToolsKit/Utility/UIApplication; + sourceTree = ""; + }; + 6D65D24776D3F3726263C8BB464B2717 /* UIImage */ = { + isa = PBXGroup; + children = ( + 885E61BB33875C4D5B5E2F455BBF1C09 /* UIImage+LYBase64.h */, + 0A846BE7BEC8F184DBE1D1EDA8904FE6 /* UIImage+LYBase64.m */, + 67E8D249737C149D34D03FC2DB901082 /* UIImage+LYImage.h */, + 23604F9CA0F3567F745FA2967EF28AA1 /* UIImage+LYImage.m */, + 04BF60128215932EB4BABBC24610631D /* UIImage+LYResize.h */, + 9DA160E97E13528F9001851365E5C788 /* UIImage+LYResize.m */, + ); + name = UIImage; + path = UIImage; + sourceTree = ""; + }; + 7DB346D0F39D3F0E887471402A8071AB = { + isa = PBXGroup; + children = ( + 93A4A3777CF96A4AAC1D13BA6DCCEA73 /* Podfile */, + 1512A7C7754C0FB9A56E10404E84777B /* Development Pods */, + 59511511C2B4BC905C933DCC67E365C4 /* Frameworks */, + E9B49E9D4F6BC02AA78DCF86BCED2145 /* Pods */, + 816EB66FF6E918A1F8E0AAFBEE8D46CE /* Products */, + 04AE54EF62BEB8811630AE7A7B7D7DCB /* Targets Support Files */, + ); + sourceTree = ""; + }; + 816EB66FF6E918A1F8E0AAFBEE8D46CE /* Products */ = { + isa = PBXGroup; + children = ( + 53708DD2D4606CC529E850963494D8E2 /* LYToolsKit.framework */, + 0CBBD268F2C0E7A490AF022775720DC0 /* Masonry.framework */, + 824E4F655A70302BE021390DC9438509 /* Pods_LYToolsKit_Example.framework */, + 450784CC39ADC3AC569ADFA59CF36F7C /* Pods_LYToolsKit_Tests.framework */, + ); + name = Products; + sourceTree = ""; + }; + 859D84C773C9CFA1B7AE31C04A8A17D2 /* LYToolsKit */ = { + isa = PBXGroup; + children = ( + 81F895C8CED0F64F5D149B31D1FB13EF /* LYToolsKit.h */, + 866396331ADFC0B76A2A0EA890A7DCE0 /* Foundation */, + 01D537520CB08933DF8DC6FE7AA9AE5D /* Pod */, + BD3A7D2F1E8EC8B5479E13457C0E76EF /* Support Files */, + A3E9DEEB40DFB50103B65712EF3CD009 /* UI */, + 2E713D287BFD0074B635686CAE7F084C /* Utility */, + ); + name = LYToolsKit; + path = ../..; + sourceTree = ""; + }; + 866396331ADFC0B76A2A0EA890A7DCE0 /* Foundation */ = { + isa = PBXGroup; + children = ( + 28843D7AE3060E51E84F08174C324648 /* LYFoundation.h */, + C4EEA811C6E3EA4ECA50750CEEB3EF15 /* NSDate */, + A0E57F1D2B2135667575E79505973094 /* NSObject */, + 29CDE67D5B5409A49622BAC53368D0F1 /* NSString */, + ); + name = Foundation; + sourceTree = ""; + }; + 885A020B70A2181581248E049C591DA8 /* Macro */ = { + isa = PBXGroup; + children = ( + F1B9C9376523F943E82787C09FF62A3E /* LYUIMacro.h */, + ); + name = Macro; + path = LYToolsKit/UI/Macro; + sourceTree = ""; + }; + 8CD0E004CAAE14B686346E81871DB97F /* UIAlert */ = { + isa = PBXGroup; + children = ( + 0A67A141F6E68F87869451095C4D536D /* LYAlertController.h */, + 4810F4F988DD7AF927FDC391B91247BC /* LYAlertController.m */, + ); + name = UIAlert; + path = UIAlert; + sourceTree = ""; + }; + 96F8A201C5B9BD853F7ED6CDFC4740CE /* UIDevice */ = { + isa = PBXGroup; + children = ( + 12CFA4BEC4C7405507FC542AF6B40846 /* UIDevice+LYHardware.h */, + 3906ADFF4B51521B9033596D88B6DBB6 /* UIDevice+LYHardware.m */, + ); + name = UIDevice; + path = UIDevice; + sourceTree = ""; + }; + 9945FAD982CF6A9DD7ECD522C735A4A2 /* Reachability */ = { + isa = PBXGroup; + children = ( + B4825669B5B7A9C86E622C264850A443 /* LYReachability.h */, + 4DCACB8228CE2B4661BC9AA051E8DD0E /* LYReachability.m */, + ); + name = Reachability; + path = Reachability; + sourceTree = ""; + }; + A0E57F1D2B2135667575E79505973094 /* NSObject */ = { + isa = PBXGroup; + children = ( + BB9E4F00E57E74C0631864D577D1D3EB /* NSObject+LYHook.h */, + D61BBF1AE50765DD1F4B3B0BCEE138AC /* NSObject+LYHook.m */, + ); + name = NSObject; + path = LYToolsKit/Foundation/NSObject; + sourceTree = ""; + }; + A2A20986957FCCEF3865AFC2DAE207A8 /* Masonry */ = { + isa = PBXGroup; + children = ( + 79BEFB59B86F59C579FF7594DCF78FEB /* MASCompositeConstraint.h */, + 537638D0C329C86D4ED401237F5D895F /* MASCompositeConstraint.m */, + ECBBB506D4D551AB1A637EE3145A459E /* MASConstraint.h */, + 986CB32629319F7F2256662716334944 /* MASConstraint.m */, + 77F2CF8861113B6F7AAE7EA65C6A7C1B /* MASConstraint+Private.h */, + A02D339E60E114FCC992372E93245BA1 /* MASConstraintMaker.h */, + FF3818136FED67BD32E3A7FAEDE4F68F /* MASConstraintMaker.m */, + C484EF8499F67EC81CA7E27930A63CDC /* MASLayoutConstraint.h */, + 611E26C24600589F4729E5EF510272FB /* MASLayoutConstraint.m */, + 303B58A2959C8EEE96799AD558DDA1D3 /* Masonry.h */, + AD04C760F0EB4FE7B23D85D56145A97F /* MASUtilities.h */, + 96DCAB46CA2931B8140F2639F17404AF /* MASViewAttribute.h */, + 0925CC604B01F156279E8952DDE3EDDB /* MASViewAttribute.m */, + 1F0183E721D7FD6AF70B4A911C1B1B95 /* MASViewConstraint.h */, + 6E4875E63FFAFF84A3CDFE99F28B551E /* MASViewConstraint.m */, + 5A649F9297535214EF97548C9EA9FA33 /* NSArray+MASAdditions.h */, + B1C550CDA10D592ABB6A0383A3509F05 /* NSArray+MASAdditions.m */, + F8187F5CAD09C6C6B2B54C65B4A807C9 /* NSArray+MASShorthandAdditions.h */, + 2F69E835336330FF06E7268D32D667C9 /* NSLayoutConstraint+MASDebugAdditions.h */, + A214B89738295B4A4B00EEB1960E8865 /* NSLayoutConstraint+MASDebugAdditions.m */, + FF217FE4E512E3883BAD867868CB42D9 /* View+MASAdditions.h */, + 7EC0A25DD6F58D072A4ACFC92D9237BF /* View+MASAdditions.m */, + 61881F60AB333EA86CE7881063A4BA60 /* View+MASShorthandAdditions.h */, + C6D5C71A7A4B3156186EC98A377E8543 /* ViewController+MASAdditions.h */, + 3980E01C213ECEDEABAC38C1CFD3946D /* ViewController+MASAdditions.m */, + D253588BAFB01A953DA60C10CD597F84 /* Support Files */, + ); + name = Masonry; + path = Masonry; + sourceTree = ""; + }; + A3E9DEEB40DFB50103B65712EF3CD009 /* UI */ = { + isa = PBXGroup; + children = ( + E9BEEAC28396C9494B9644C5C6A9A343 /* LYUI.h */, + 885A020B70A2181581248E049C591DA8 /* Macro */, + 477E4786712464258D7B1F2B64808265 /* UI */, + ); + name = UI; + sourceTree = ""; + }; + B35E6B1B1A188487D39300F447EE0510 /* UILabel */ = { + isa = PBXGroup; + children = ( + 33B607A68E96FDC942AB9500B68C93F8 /* UICountingLabel.h */, + 2CA59942D6EBA5736EE309A6E23B292E /* UICountingLabel.m */, + ); + name = UILabel; + path = LYToolsKit/Utility/UILabel; + sourceTree = ""; + }; + BD3A7D2F1E8EC8B5479E13457C0E76EF /* Support Files */ = { + isa = PBXGroup; + children = ( + B58CA6409B8D9E2E02C771229014BEDC /* Info.plist */, + 672E60046F61B699AEB2EC00E1BA5B5D /* LYToolsKit.modulemap */, + 66AEB8BDA8F54BFF86A9F82E3713720B /* LYToolsKit.xcconfig */, + 493A347932C5AC57908A69F5FC24B93F /* LYToolsKit-dummy.m */, + CF513E2D56BECC54035E618D2EB531D9 /* LYToolsKit-prefix.pch */, + 3636A603E4FF89A45494D238EABCF7DB /* LYToolsKit-umbrella.h */, + ); + name = "Support Files"; + path = "Example/Pods/Target Support Files/LYToolsKit"; + sourceTree = ""; + }; + C4EEA811C6E3EA4ECA50750CEEB3EF15 /* NSDate */ = { + isa = PBXGroup; + children = ( + 465406F4B94E031B1325286CB2D5811E /* NSDate+LYString.h */, + 4AD57AED1FF8AC06A681B74B4390B4E2 /* NSDate+LYString.m */, + ); + name = NSDate; + path = LYToolsKit/Foundation/NSDate; + sourceTree = ""; + }; + D253588BAFB01A953DA60C10CD597F84 /* Support Files */ = { + isa = PBXGroup; + children = ( + 8223B4B9D2A5B7C0F33D1BC8949FA9F5 /* Info.plist */, + 36C40591902578632718E317104564A2 /* Masonry.modulemap */, + 3839A1AD8E883475BF8F8C6274F8A953 /* Masonry.xcconfig */, + 818E990F262EC48F8DAAFD014D7E9234 /* Masonry-dummy.m */, + E77198CEE0CF691E7915471E9F19CD96 /* Masonry-prefix.pch */, + 1FB8A9BDAB144F118F7F74E1F2B74097 /* Masonry-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Masonry"; + sourceTree = ""; + }; + D48AB0718339CB32D162823FE562F570 /* UIView */ = { + isa = PBXGroup; + children = ( + 1BDBFF09C5D71B570AC97F1F9731339A /* LYCoverView.h */, + 683633AA4F07AE2B13999181F36A892F /* LYCoverView.m */, + ); + name = UIView; + path = LYToolsKit/Utility/UIView; + sourceTree = ""; + }; + DC7E422848DE4538BD67FA85E4EF5FAF /* iOS */ = { + isa = PBXGroup; + children = ( + F4ECFD12E78C2CA945044CB88F411C65 /* Foundation.framework */, + B1DDB58FB8525698C8C459E7485FF5DB /* UIKit.framework */, + ); + name = iOS; + sourceTree = ""; + }; + DF10BE8201E9BBD25823722563DB1D55 /* Pods-LYToolsKit_Example */ = { + isa = PBXGroup; + children = ( + 918BDFA2EDCF96EF97BB5788D8A924FA /* Info.plist */, + AEE8FA4345312638361B8A6552E2C2D3 /* Pods-LYToolsKit_Example.modulemap */, + B01971B212F763268E4AABFAC75CF18E /* Pods-LYToolsKit_Example-acknowledgements.markdown */, + B6F80727A3F8E984518A9D5ECFBB5DBA /* Pods-LYToolsKit_Example-acknowledgements.plist */, + 821C12BF8CD1B5F411C10B234783C588 /* Pods-LYToolsKit_Example-dummy.m */, + 870B3CF1AAF901ACDC1A1A5883C6F6E1 /* Pods-LYToolsKit_Example-frameworks.sh */, + A51771963E8DF9900E19CFED0EB67A30 /* Pods-LYToolsKit_Example-resources.sh */, + 552A1FFC6C1789DEDF34B1D330ECDCBB /* Pods-LYToolsKit_Example-umbrella.h */, + 729254CF6FFD7659EC028B8FB9E2E2F3 /* Pods-LYToolsKit_Example.debug.xcconfig */, + 134C6343D3A07A5B3AE29B85FF79707B /* Pods-LYToolsKit_Example.release.xcconfig */, + ); + name = "Pods-LYToolsKit_Example"; + path = "Target Support Files/Pods-LYToolsKit_Example"; + sourceTree = ""; + }; + E7E97803AED1140C9BD47C31D24A2598 /* UIButton */ = { + isa = PBXGroup; + children = ( + 6A37A1C36317EB000B129AE413870B59 /* UIButton+LYDelay.h */, + AF3EBA0EB85D2685F609D7E122C4A159 /* UIButton+LYDelay.m */, + ); + name = UIButton; + path = UIButton; + sourceTree = ""; + }; + E9B49E9D4F6BC02AA78DCF86BCED2145 /* Pods */ = { + isa = PBXGroup; + children = ( + A2A20986957FCCEF3865AFC2DAE207A8 /* Masonry */, + ); + name = Pods; + sourceTree = ""; + }; + F4B6EF47F18DEE2817D6B6B3BFEFFF15 /* UIViewExt */ = { + isa = PBXGroup; + children = ( + D967C14F01C1C1C3439CBC8B030C8079 /* UIButton+LYExt.h */, + 0C96672A5CF4455CF8447E7874849E2D /* UIButton+LYExt.m */, + C27CD0B4DE28BEDA216D6B633A9C06B6 /* UIImageView+LYExt.h */, + F0F45D89053594C8F87E1906592CC229 /* UIImageView+LYExt.m */, + B7894437B6122F2EDC551B618E0C7F12 /* UILabel+LYExt.h */, + AB532DBF747352456798410FBF1E3FA7 /* UILabel+LYExt.m */, + 4BF436FF766C7E5DCB7DABB65A691349 /* UITextField+LYExt.h */, + D49F54F585B08430AC9FA9BCB83F7787 /* UITextField+LYExt.m */, + 67B1520A5AB0BB5A739FF5F6F15E0D7F /* UITextView+LYExt.h */, + FC63FA8DE6D1008CCA734F85EA6A4A3F /* UITextView+LYExt.m */, + 22A8C97ECA80C361E834AF7EC34701E8 /* UIView+LYExt.h */, + 3FB6791CB1DB6EBC5E365A0B71BF19DD /* UIView+LYExt.m */, + ); + name = UIViewExt; + path = UIViewExt; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 3236108257695AE0DB3C326B52E3FB2F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 6829C728D042952398D73F31EB7AA4F3 /* LYAlertController.h in Headers */, + 1D0E95A256A2F415BC67E18522AC4111 /* LYCoverView.h in Headers */, + C556C6D80A8F5A3B279B29B25F7968E7 /* LYFoundation.h in Headers */, + D8440EF602D29D94D63B8A99ACD33659 /* LYReachability.h in Headers */, + AACCD6CB3297E531005DFA8E610F5DB9 /* LYToolsKit-umbrella.h in Headers */, + 8214827B85980C289947EAF0C25ED57A /* LYToolsKit.h in Headers */, + 1C9FC66EDF975AF796401A373F2D00C9 /* LYTouchTrace.h in Headers */, + 1E0BFCF5DF1D3E24C6BA479319202145 /* LYUI.h in Headers */, + 4D7DD546B3455144A6C36C37227FE0A3 /* LYUIMacro.h in Headers */, + DC75075EEDBD992B2A87E99845FB48AC /* LYUtility.h in Headers */, + B24AFBD09EE453C6E55013E9C5CD2C81 /* NSDate+LYString.h in Headers */, + 6451F48B3C59ED7D5363A4F55EE3EFCF /* NSObject+LYHook.h in Headers */, + 8C76EADF5DCEF91C6CBDFDCC9020CF78 /* NSString+LYJS.h in Headers */, + 4696AB7EA110A0D7D76BC44A5E15CBB6 /* NSString+LYJudge.h in Headers */, + 08548563B48BB35488B6D224DBBF4DD7 /* NSString+LYUnits.h in Headers */, + AE5132328F9634BC8DD92D85E2A10083 /* NSString+LYURL.h in Headers */, + 67BD9D6146383E7311AA3671CE9871CA /* UIButton+LYDelay.h in Headers */, + A3F6D9D914A6A8C679B0916085221406 /* UIButton+LYExt.h in Headers */, + 0DC2F4CCD226982061D86CB88ABA2F1E /* UIColor+LYString.h in Headers */, + 2878DA752BB01C266016595BFA7F347A /* UICountingLabel.h in Headers */, + D3BA89F403D3BFA7E086AB0710694106 /* UIDevice+LYHardware.h in Headers */, + DE531B2448B5EB642DE1F1BB1C28E7C7 /* UIImage+LYBase64.h in Headers */, + 27100B21A088F42841BBDD941136943F /* UIImage+LYImage.h in Headers */, + 7365D7982617DFA4193827244C4CD622 /* UIImage+LYResize.h in Headers */, + 5F1A710A4CEDF323650B3E7F2D9D8079 /* UIImageView+LYExt.h in Headers */, + C414F10EC5C8ABD840301A460DB5BA1B /* UILabel+LYExt.h in Headers */, + BF4B4A8206329014A9725FBBC13FDD27 /* UITextField+LYExt.h in Headers */, + FAF661946E012B733B8BA27FDCEFDE96 /* UITextView+LYExt.h in Headers */, + 4CDC8CE7B8D1AB129F1061246BDE31A3 /* UIView+LYCut.h in Headers */, + C4C42C91DE8EEC9EC47A146F32D2A6F4 /* UIView+LYEnlargeTouchArea.h in Headers */, + D695858BB153D40D106A6655AF15807A /* UIView+LYExt.h in Headers */, + C490407D2173112FFF1A7C5AF0B9FF7D /* UIView+LYTouch.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 7987360BE7ECE18AA61A3FE9C87A6292 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + EC007222678CADECC6E0469689874A91 /* MASCompositeConstraint.h in Headers */, + 0B474A887D8F0632243132E65567A448 /* MASConstraint+Private.h in Headers */, + 74D7B1D032D13886C8666269C803350B /* MASConstraint.h in Headers */, + 40E0EBD3B82BE3C03CB89B3399125ACF /* MASConstraintMaker.h in Headers */, + 57D6C25FD241F19366BAE20B123E3104 /* MASLayoutConstraint.h in Headers */, + 9AB143D8C95AC17AE5BF8ABE9AC80E38 /* Masonry-umbrella.h in Headers */, + 03340FE6DB380AF385272676331E421D /* Masonry.h in Headers */, + D523576EB3ED95E2E1D076D814EB0D45 /* MASUtilities.h in Headers */, + 1BC716DF86A363742337EE3D8D779649 /* MASViewAttribute.h in Headers */, + F5237922AAC1AE6B0106E2899A01F5F7 /* MASViewConstraint.h in Headers */, + E069DDC88033ED19344DC2A65C783FE8 /* NSArray+MASAdditions.h in Headers */, + EB5BDE84A54C5EE0B0CB6F950EA9DAE4 /* NSArray+MASShorthandAdditions.h in Headers */, + 17A8EBE6EB76463C46D8913AFDE932BE /* NSLayoutConstraint+MASDebugAdditions.h in Headers */, + D6F188223C3612B7C8B79C0E6F662493 /* View+MASAdditions.h in Headers */, + 0E57D14AF975A52A446DF2B05C0466A3 /* View+MASShorthandAdditions.h in Headers */, + 3214666CFDA48659B084090D8F9AF344 /* ViewController+MASAdditions.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 87750C8896649F35D38C5178CA3A1880 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ABDF158B500EA63AF742C3782E3A9B5D /* Pods-LYToolsKit_Tests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D25653908FC9411FE6AA2C88D970C9A6 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0816A0F3D8B9CF1C332F331B6D947AFF /* Pods-LYToolsKit_Example-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 15980544DA3C24331A66A6E0719CD5E5 /* Masonry */ = { + isa = PBXNativeTarget; + buildConfigurationList = FD5A2E8D263AA1187EB2CB85555E2A8C /* Build configuration list for PBXNativeTarget "Masonry" */; + buildPhases = ( + 7987360BE7ECE18AA61A3FE9C87A6292 /* Headers */, + 7DE4356531AEFF60ACA0740258587EDC /* Sources */, + 98096ADBF0C883FFDE258AC22F41F4D5 /* Frameworks */, + FBD300AA7CC90F318F80CEB4D57D6DDD /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Masonry; + productName = Masonry; + productReference = 0CBBD268F2C0E7A490AF022775720DC0 /* Masonry.framework */; + productType = "com.apple.product-type.framework"; + }; + 32454BBF377FE9AB11384FCB627E119F /* LYToolsKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8BED0D9A7C292E4D80F29D2FE70DA264 /* Build configuration list for PBXNativeTarget "LYToolsKit" */; + buildPhases = ( + 3236108257695AE0DB3C326B52E3FB2F /* Headers */, + 89BAF390339D5D6C891E5E27513A5413 /* Sources */, + DB7CA96854430D3226C4EA8354409542 /* Frameworks */, + 087E55E532AC7555E3438ADF1B91D82B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 022DCD87B9FB745952C51A3B2B4185A8 /* PBXTargetDependency */, + ); + name = LYToolsKit; + productName = LYToolsKit; + productReference = 53708DD2D4606CC529E850963494D8E2 /* LYToolsKit.framework */; + productType = "com.apple.product-type.framework"; + }; + D0C7CC26704615C91EAD57A7D18B54E5 /* Pods-LYToolsKit_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 85B1D84A6418C9BDD6125D61793641DB /* Build configuration list for PBXNativeTarget "Pods-LYToolsKit_Tests" */; + buildPhases = ( + 87750C8896649F35D38C5178CA3A1880 /* Headers */, + D6637EB8811479037320AF93514BD6B3 /* Sources */, + F9E3D32F04E544FB59D92970C564FA40 /* Frameworks */, + E9030EB4F5AF9D2EF0663578DA1ABC54 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 543612A86DC46C349CF52812F46A6DED /* PBXTargetDependency */, + ); + name = "Pods-LYToolsKit_Tests"; + productName = "Pods-LYToolsKit_Tests"; + productReference = 450784CC39ADC3AC569ADFA59CF36F7C /* Pods_LYToolsKit_Tests.framework */; + productType = "com.apple.product-type.framework"; + }; + E28A52CD8CF1555D022B6E0B1615F560 /* Pods-LYToolsKit_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = AF9AD4AB260D26F9F671F153EFDBEFE0 /* Build configuration list for PBXNativeTarget "Pods-LYToolsKit_Example" */; + buildPhases = ( + D25653908FC9411FE6AA2C88D970C9A6 /* Headers */, + CE2FC5DDD27F0368D57B4BC33D4D0DAC /* Sources */, + 554A7974F11410759DA697E6E10C4A9C /* Frameworks */, + A9371964FAF17CB94D684EECEC597EB9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 50896C2181431EE00B09E7D7EAEA46E5 /* PBXTargetDependency */, + 72162141B079F3B71B841468BB7199EC /* PBXTargetDependency */, + ); + name = "Pods-LYToolsKit_Example"; + productName = "Pods-LYToolsKit_Example"; + productReference = 824E4F655A70302BE021390DC9438509 /* Pods_LYToolsKit_Example.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D41D8CD98F00B204E9800998ECF8427E /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + }; + buildConfigurationList = 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 7DB346D0F39D3F0E887471402A8071AB; + productRefGroup = 816EB66FF6E918A1F8E0AAFBEE8D46CE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 32454BBF377FE9AB11384FCB627E119F /* LYToolsKit */, + 15980544DA3C24331A66A6E0719CD5E5 /* Masonry */, + E28A52CD8CF1555D022B6E0B1615F560 /* Pods-LYToolsKit_Example */, + D0C7CC26704615C91EAD57A7D18B54E5 /* Pods-LYToolsKit_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 087E55E532AC7555E3438ADF1B91D82B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A9371964FAF17CB94D684EECEC597EB9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E9030EB4F5AF9D2EF0663578DA1ABC54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + FBD300AA7CC90F318F80CEB4D57D6DDD /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7DE4356531AEFF60ACA0740258587EDC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0F20898555A76114361C34270852143A /* MASCompositeConstraint.m in Sources */, + 91D46E9E56F949819E40D8B689634694 /* MASConstraint.m in Sources */, + 35F2028864076DA02089DD949BBD1848 /* MASConstraintMaker.m in Sources */, + 58834F03497C2A6D3C99EF84425940A6 /* MASLayoutConstraint.m in Sources */, + 6F375E0360645008C02C3F4D1CB0B459 /* Masonry-dummy.m in Sources */, + A366D3DFE5CF7BFB27C5B8BFA0E1FC84 /* MASViewAttribute.m in Sources */, + F4754805A81DF7415472DFBAC0E8876F /* MASViewConstraint.m in Sources */, + 3295E1B7597963233CD66D603A6E9861 /* NSArray+MASAdditions.m in Sources */, + C10C6EED54B42F96B31850781495B54A /* NSLayoutConstraint+MASDebugAdditions.m in Sources */, + C2525CFA00FDB5632B675852EBCEEB50 /* View+MASAdditions.m in Sources */, + 33E325586DFF6871D190366D3E773F68 /* ViewController+MASAdditions.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 89BAF390339D5D6C891E5E27513A5413 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4564C070B0170BC26198543CC47C365F /* LYAlertController.m in Sources */, + 05B138C0C1E0DAF6AAD22A2DF87CF63C /* LYCoverView.m in Sources */, + 7008C0AEE623980C1764D0536D9F5AE2 /* LYReachability.m in Sources */, + C8F37F708E3F831F095AC94F60F2A396 /* LYToolsKit-dummy.m in Sources */, + BA141360B73C7F0A98370C1C91DDEA8F /* LYTouchTrace.m in Sources */, + F100E4DDE525E87DD15AF3A6A8C9FB52 /* NSDate+LYString.m in Sources */, + EAC8A50047172E142B30C4E53DDA53F0 /* NSObject+LYHook.m in Sources */, + AF19A4D823578ABD980565ED009A4D02 /* NSString+LYJS.m in Sources */, + F3C444E6600DC899E4A31AECEB26D72D /* NSString+LYJudge.m in Sources */, + 8C4AA277131CC7C40912B29AF2E7C31A /* NSString+LYUnits.m in Sources */, + DE10C9844D606F7F02F68DB1B1B726AA /* NSString+LYURL.m in Sources */, + 6F5A2CB6DD7C421AF9845EEB9B234A10 /* UIButton+LYDelay.m in Sources */, + 40803C4930693D6BEA3B342E48B33B76 /* UIButton+LYExt.m in Sources */, + D0C68F1C1CA5AAEBE17169DD4C070D29 /* UIColor+LYString.m in Sources */, + DE23BA00218213B72CDF5162C59F2A11 /* UICountingLabel.m in Sources */, + EB53AA55B7F9A48C801DD681FF588337 /* UIDevice+LYHardware.m in Sources */, + BA73CC05E3A10FB794CAFEB7D2EA924C /* UIImage+LYBase64.m in Sources */, + 3D19ABB4A14629E9EED9E3C0A5D41A1E /* UIImage+LYImage.m in Sources */, + 86C3D895D2B7BBA947C5DFC3503E420D /* UIImage+LYResize.m in Sources */, + DB0151C1DA24AEB1C99224D00510E643 /* UIImageView+LYExt.m in Sources */, + 7119276F9BDF5E55A5E43B6084E27E1C /* UILabel+LYExt.m in Sources */, + 767471620BF9D434BAEE4BD0D9096223 /* UITextField+LYExt.m in Sources */, + 028FEC384E2461209287DB7FD1D318D3 /* UITextView+LYExt.m in Sources */, + 3F4CFF77E94EDDC79A82E6A2856622E9 /* UIView+LYCut.m in Sources */, + 0DEA62A206CF56890863EA0ED9D29F87 /* UIView+LYEnlargeTouchArea.m in Sources */, + 7014C6AB228A79B03B1E7888EA4A563F /* UIView+LYExt.m in Sources */, + FD4221C22DF77624AA660005BB83F925 /* UIView+LYTouch.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + CE2FC5DDD27F0368D57B4BC33D4D0DAC /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ADC9751E9A659ED0DA79AA9D2FEA180A /* Pods-LYToolsKit_Example-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D6637EB8811479037320AF93514BD6B3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D2256D18E9D1256C77BD4958959E3DBF /* Pods-LYToolsKit_Tests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 022DCD87B9FB745952C51A3B2B4185A8 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Masonry; + target = 15980544DA3C24331A66A6E0719CD5E5 /* Masonry */; + targetProxy = 5975DE32C1E4C705970715B6997E480C /* PBXContainerItemProxy */; + }; + 50896C2181431EE00B09E7D7EAEA46E5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = LYToolsKit; + target = 32454BBF377FE9AB11384FCB627E119F /* LYToolsKit */; + targetProxy = AC77CD8B341AF4CABC86322E4502A320 /* PBXContainerItemProxy */; + }; + 543612A86DC46C349CF52812F46A6DED /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Pods-LYToolsKit_Example"; + target = E28A52CD8CF1555D022B6E0B1615F560 /* Pods-LYToolsKit_Example */; + targetProxy = 7474744F9A3C25475472B20B74D708E7 /* PBXContainerItemProxy */; + }; + 72162141B079F3B71B841468BB7199EC /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Masonry; + target = 15980544DA3C24331A66A6E0719CD5E5 /* Masonry */; + targetProxy = E0FFDDF0F0536135C3F948F3F99050DA /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 06E5F0272649F89CBDF5F35211464E52 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 134C6343D3A07A5B3AE29B85FF79707B /* Pods-LYToolsKit_Example.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LYToolsKit_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 0CC266760401B42AF31AB7BE20910619 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3839A1AD8E883475BF8F8C6274F8A953 /* Masonry.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Masonry/Masonry-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Masonry/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Masonry/Masonry.modulemap"; + PRODUCT_MODULE_NAME = Masonry; + PRODUCT_NAME = Masonry; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 3BB279C5CF0635B9E9536219A8677C42 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 66AEB8BDA8F54BFF86A9F82E3713720B /* LYToolsKit.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/LYToolsKit/LYToolsKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LYToolsKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/LYToolsKit/LYToolsKit.modulemap"; + PRODUCT_MODULE_NAME = LYToolsKit; + PRODUCT_NAME = LYToolsKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 4F0D3FC0B4928871EFBFC3D21FB7DE35 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6FC421FC0FDF34FA104FB736C6A27B3C /* Pods-LYToolsKit_Tests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LYToolsKit_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 56A05ADD3BABDA1B56D1F979845809B1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + A2D1812A7EF9BFA1BB4BBE1110CEEE14 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 3839A1AD8E883475BF8F8C6274F8A953 /* Masonry.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Masonry/Masonry-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Masonry/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Masonry/Masonry.modulemap"; + PRODUCT_MODULE_NAME = Masonry; + PRODUCT_NAME = Masonry; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + AD0880AC8E569C758BF39EEB4070111B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 66AEB8BDA8F54BFF86A9F82E3713720B /* LYToolsKit.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/LYToolsKit/LYToolsKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/LYToolsKit/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/LYToolsKit/LYToolsKit.modulemap"; + PRODUCT_MODULE_NAME = LYToolsKit; + PRODUCT_NAME = LYToolsKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + BEFDB93BF207328A04F1220475D02C3B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGNING_ALLOWED = NO; + CODE_SIGNING_REQUIRED = NO; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + E53BCBABC6757D03A94D30013A8D36F3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 729254CF6FFD7659EC028B8FB9E2E2F3 /* Pods-LYToolsKit_Example.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LYToolsKit_Example/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + F797EF6A77256B5977E279CEFC6C765C /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DA6995D5A94C6B452D915B626C6B84D5 /* Pods-LYToolsKit_Tests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-LYToolsKit_Tests/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + BEFDB93BF207328A04F1220475D02C3B /* Debug */, + 56A05ADD3BABDA1B56D1F979845809B1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 85B1D84A6418C9BDD6125D61793641DB /* Build configuration list for PBXNativeTarget "Pods-LYToolsKit_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + F797EF6A77256B5977E279CEFC6C765C /* Debug */, + 4F0D3FC0B4928871EFBFC3D21FB7DE35 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8BED0D9A7C292E4D80F29D2FE70DA264 /* Build configuration list for PBXNativeTarget "LYToolsKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AD0880AC8E569C758BF39EEB4070111B /* Debug */, + 3BB279C5CF0635B9E9536219A8677C42 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + AF9AD4AB260D26F9F671F153EFDBEFE0 /* Build configuration list for PBXNativeTarget "Pods-LYToolsKit_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E53BCBABC6757D03A94D30013A8D36F3 /* Debug */, + 06E5F0272649F89CBDF5F35211464E52 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FD5A2E8D263AA1187EB2CB85555E2A8C /* Build configuration list for PBXNativeTarget "Masonry" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A2D1812A7EF9BFA1BB4BBE1110CEEE14 /* Debug */, + 0CC266760401B42AF31AB7BE20910619 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = D41D8CD98F00B204E9800998ECF8427E /* Project object */; +} diff --git a/Example/Pods/Target Support Files/LYToolsKit/Info.plist b/Example/Pods/Target Support Files/LYToolsKit/Info.plist new file mode 100644 index 0000000..161a9d3 --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-dummy.m b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-dummy.m new file mode 100644 index 0000000..20c8e50 --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_LYToolsKit : NSObject +@end +@implementation PodsDummy_LYToolsKit +@end diff --git a/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-prefix.pch b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-umbrella.h b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-umbrella.h new file mode 100644 index 0000000..6f37fe9 --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit-umbrella.h @@ -0,0 +1,47 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "LYToolsKit.h" +#import "LYFoundation.h" +#import "NSDate+LYString.h" +#import "NSObject+LYHook.h" +#import "NSString+LYJS.h" +#import "NSString+LYJudge.h" +#import "NSString+LYUnits.h" +#import "NSString+LYURL.h" +#import "LYUI.h" +#import "LYUIMacro.h" +#import "LYReachability.h" +#import "LYAlertController.h" +#import "UIButton+LYDelay.h" +#import "UIColor+LYString.h" +#import "UIDevice+LYHardware.h" +#import "UIImage+LYBase64.h" +#import "UIImage+LYImage.h" +#import "UIImage+LYResize.h" +#import "UIView+LYCut.h" +#import "UIView+LYEnlargeTouchArea.h" +#import "UIView+LYTouch.h" +#import "UIButton+LYExt.h" +#import "UIImageView+LYExt.h" +#import "UILabel+LYExt.h" +#import "UITextField+LYExt.h" +#import "UITextView+LYExt.h" +#import "UIView+LYExt.h" +#import "LYUtility.h" +#import "LYTouchTrace.h" +#import "UICountingLabel.h" +#import "LYCoverView.h" + +FOUNDATION_EXPORT double LYToolsKitVersionNumber; +FOUNDATION_EXPORT const unsigned char LYToolsKitVersionString[]; + diff --git a/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.modulemap b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.modulemap new file mode 100644 index 0000000..741f74a --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.modulemap @@ -0,0 +1,6 @@ +framework module LYToolsKit { + umbrella header "LYToolsKit-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.xcconfig b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.xcconfig new file mode 100644 index 0000000..cfcc41d --- /dev/null +++ b/Example/Pods/Target Support Files/LYToolsKit/LYToolsKit.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = -ObjC +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/Masonry/Info.plist b/Example/Pods/Target Support Files/Masonry/Info.plist new file mode 100644 index 0000000..21a30b4 --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.1.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Masonry/Masonry-dummy.m b/Example/Pods/Target Support Files/Masonry/Masonry-dummy.m new file mode 100644 index 0000000..04001b1 --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Masonry-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Masonry : NSObject +@end +@implementation PodsDummy_Masonry +@end diff --git a/Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch b/Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch new file mode 100644 index 0000000..beb2a24 --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h b/Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h new file mode 100644 index 0000000..3fe9c4c --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h @@ -0,0 +1,31 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "MASCompositeConstraint.h" +#import "MASConstraint+Private.h" +#import "MASConstraint.h" +#import "MASConstraintMaker.h" +#import "MASLayoutConstraint.h" +#import "Masonry.h" +#import "MASUtilities.h" +#import "MASViewAttribute.h" +#import "MASViewConstraint.h" +#import "NSArray+MASAdditions.h" +#import "NSArray+MASShorthandAdditions.h" +#import "NSLayoutConstraint+MASDebugAdditions.h" +#import "View+MASAdditions.h" +#import "View+MASShorthandAdditions.h" +#import "ViewController+MASAdditions.h" + +FOUNDATION_EXPORT double MasonryVersionNumber; +FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; + diff --git a/Example/Pods/Target Support Files/Masonry/Masonry.modulemap b/Example/Pods/Target Support Files/Masonry/Masonry.modulemap new file mode 100644 index 0000000..06ec492 --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Masonry.modulemap @@ -0,0 +1,6 @@ +framework module Masonry { + umbrella header "Masonry-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Masonry/Masonry.xcconfig b/Example/Pods/Target Support Files/Masonry/Masonry.xcconfig new file mode 100644 index 0000000..a7b2cee --- /dev/null +++ b/Example/Pods/Target Support Files/Masonry/Masonry.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = -framework "Foundation" -framework "UIKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Info.plist b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.markdown new file mode 100644 index 0000000..1a2d662 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.markdown @@ -0,0 +1,48 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## LYToolsKit + +Copyright (c) 2018 yyly + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## Masonry + +Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.plist new file mode 100644 index 0000000..1bf3e7d --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-acknowledgements.plist @@ -0,0 +1,86 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2018 yyly <wulang@99fenqi.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + LYToolsKit + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + License + MIT + Title + Masonry + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-dummy.m b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-dummy.m new file mode 100644 index 0000000..ce53db6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_LYToolsKit_Example : NSObject +@end +@implementation PodsDummy_Pods_LYToolsKit_Example +@end diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-frameworks.sh b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-frameworks.sh new file mode 100755 index 0000000..f8623f0 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-frameworks.sh @@ -0,0 +1,155 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/LYToolsKit/LYToolsKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/LYToolsKit/LYToolsKit.framework" + install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-resources.sh b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-resources.sh new file mode 100755 index 0000000..345301f --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-umbrella.h b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-umbrella.h new file mode 100644 index 0000000..855f880 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_LYToolsKit_ExampleVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_LYToolsKit_ExampleVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.debug.xcconfig b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.debug.xcconfig new file mode 100644 index 0000000..ec44e96 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.debug.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit/LYToolsKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "LYToolsKit" -framework "Masonry" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap new file mode 100644 index 0000000..bb510d9 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.modulemap @@ -0,0 +1,6 @@ +framework module Pods_LYToolsKit_Example { + umbrella header "Pods-LYToolsKit_Example-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.release.xcconfig b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.release.xcconfig new file mode 100644 index 0000000..ec44e96 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Example/Pods-LYToolsKit_Example.release.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit/LYToolsKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" +OTHER_LDFLAGS = $(inherited) -framework "LYToolsKit" -framework "Masonry" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Info.plist b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Info.plist new file mode 100644 index 0000000..2243fe6 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.markdown b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.markdown new file mode 100644 index 0000000..102af75 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.plist b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.plist new file mode 100644 index 0000000..7acbad1 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-dummy.m b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-dummy.m new file mode 100644 index 0000000..73ed28b --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_LYToolsKit_Tests : NSObject +@end +@implementation PodsDummy_Pods_LYToolsKit_Tests +@end diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-frameworks.sh b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-frameworks.sh new file mode 100755 index 0000000..08e3eaa --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" + else + # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-resources.sh b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-resources.sh new file mode 100755 index 0000000..345301f --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-umbrella.h b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-umbrella.h new file mode 100644 index 0000000..0d7f646 --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_LYToolsKit_TestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_LYToolsKit_TestsVersionString[]; + diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.debug.xcconfig b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.debug.xcconfig new file mode 100644 index 0000000..9fae30a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.debug.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit/LYToolsKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap new file mode 100644 index 0000000..8e3276a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_LYToolsKit_Tests { + umbrella header "Pods-LYToolsKit_Tests-umbrella.h" + + export * + module * { export * } +} diff --git a/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.release.xcconfig b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.release.xcconfig new file mode 100644 index 0000000..9fae30a --- /dev/null +++ b/Example/Pods/Target Support Files/Pods-LYToolsKit_Tests/Pods-LYToolsKit_Tests.release.xcconfig @@ -0,0 +1,8 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/LYToolsKit/LYToolsKit.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/Example/Tests/Tests.m b/Example/Tests/Tests.m index c64be00..69420f8 100644 --- a/Example/Tests/Tests.m +++ b/Example/Tests/Tests.m @@ -7,6 +7,7 @@ // @import XCTest; +#import @interface Tests : XCTestCase diff --git a/LYToolsKit.podspec b/LYToolsKit.podspec index ad0a4c5..ac6f15a 100644 --- a/LYToolsKit.podspec +++ b/LYToolsKit.podspec @@ -1,40 +1,33 @@ -# -# Be sure to run `pod lib lint LYToolsKit.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html -# - Pod::Spec.new do |s| s.name = 'LYToolsKit' s.version = '0.1.0' - s.summary = 'A short description of LYToolsKit.' - -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - - s.description = <<-DESC -TODO: Add long description of the pod here. - DESC + s.summary = 'LYToolsKit is Foundation|UI|Utility SDK.' s.homepage = 'https://github.com/yyly/LYToolsKit' # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' s.license = { :type => 'MIT', :file => 'LICENSE' } - s.author = { 'yyly' => 'wulang@99fenqi.com' } + s.author = { 'yyly' => 'mingyuegucheng@icloud.com' } s.source = { :git => 'https://github.com/yyly/LYToolsKit.git', :tag => s.version.to_s } - # s.social_media_url = 'https://twitter.com/' - s.ios.deployment_target = '8.0' + s.ios.deployment_target = '9.0' + + s.source_files = 'LYToolsKit/LYToolsKit.h' + + s.subspec 'Foundation' do |f| + f.source_files = 'LYToolsKit/Foundation/**/*.{h,m}' + f.pod_target_xcconfig = {'OTHER_LDFLAGS' => '-ObjC'} + end + + s.subspec 'UI' do |u| + u.source_files = 'LYToolsKit/UI/**/*.{h,m}' + u.pod_target_xcconfig = {'OTHER_LDFLAGS' => '-ObjC'} + end - s.source_files = 'LYToolsKit/Classes/**/*' - - # s.resource_bundles = { - # 'LYToolsKit' => ['LYToolsKit/Assets/*.png'] - # } + s.subspec 'Utility' do |ut| + ut.source_files = 'LYToolsKit/Utility/**/*.{h,m}' + ut.dependency "Masonry" + ut.dependency "LYToolsKit/UI" + end # s.public_header_files = 'Pod/Classes/**/*.h' # s.frameworks = 'UIKit', 'MapKit' diff --git a/LYToolsKit/Assets/.gitkeep b/LYToolsKit/Assets/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/LYToolsKit/Classes/.gitkeep b/LYToolsKit/Classes/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/LYToolsKit/Classes/ReplaceMe.m b/LYToolsKit/Classes/ReplaceMe.m deleted file mode 100644 index e69de29..0000000 diff --git a/LYToolsKit/Foundation/LYFoundation.h b/LYToolsKit/Foundation/LYFoundation.h new file mode 100644 index 0000000..2190301 --- /dev/null +++ b/LYToolsKit/Foundation/LYFoundation.h @@ -0,0 +1,41 @@ +// +// LYFoundation.h +// LYFoundation +// +// Created by 吴浪 on 2018/11/11. +// + +#ifndef LYFoundation_h +#define LYFoundation_h + +#pragma mark - UIMacro +#pragma mark - NSObject +#import + +#pragma mark - NSArray + +#pragma mark - NSAttributeString + +#pragma mark - NSDate +#import + +#pragma mark - NSDictionary + +#pragma mark - NSNotificationCenter + +#pragma mark - NSString +#import +#import +#import +#import + +#pragma mark - NSURL + +#pragma mark - NSURLRequest + +#pragma mark - NSURL + +#pragma mark - NSURL + + +#endif /* LYFoundation_h */ diff --git a/LYToolsKit/Foundation/NSDate/NSDate+LYString.h b/LYToolsKit/Foundation/NSDate/NSDate+LYString.h new file mode 100644 index 0000000..97bf19a --- /dev/null +++ b/LYToolsKit/Foundation/NSDate/NSDate+LYString.h @@ -0,0 +1,38 @@ +// +// NSDate+LYString.h +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-12. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSDate (LYString) + +/** 返回一个只有年月日的时间 */ +- (NSDate *)ly_dateWithYMD; +/** 获得与当前时间的差距 */ +- (NSDateComponents *)ly_deltaWithNow; +/** 时间转换格式 */ +- (NSDateFormatter *)ly_dateFormater; +/** 获取当前时间戳字符串 */ +- (NSString *)ly_currentTimeString; + +@end + + +@interface NSDate (LYJudge) + +/** 是否为今天 */ +- (BOOL)ly_isToday; +/** 是否为昨天 */ +- (BOOL)ly_isYesterday; +/** 是否为今年 */ +- (BOOL)ly_isThisYear; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSDate/NSDate+LYString.m b/LYToolsKit/Foundation/NSDate/NSDate+LYString.m new file mode 100644 index 0000000..1cc14a6 --- /dev/null +++ b/LYToolsKit/Foundation/NSDate/NSDate+LYString.m @@ -0,0 +1,81 @@ +// +// NSDate+LYString.m +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-12. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// + +#import "NSDate+LYString.h" + +@implementation NSDate (LYString) + +- (NSDate *)ly_dateWithYMD { + NSDateFormatter *fmt = [[NSDateFormatter alloc] init]; + fmt.dateFormat = @"yyyy-MM-dd"; + NSString *selfStr = [fmt stringFromDate:self]; + return [fmt dateFromString:selfStr]; +} + +- (NSDateComponents *)ly_deltaWithNow { + NSCalendar *calendar = [NSCalendar currentCalendar]; + int unit = NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; + return [calendar components:unit fromDate:self toDate:[NSDate date] options:0]; +} + +- (NSDateFormatter *)ly_dateFormater { + NSString *formatKey = @"yyyy-MM-dd HH:mm:ss:SSS"; + NSDateFormatter *dateformatter = [[NSDateFormatter alloc] init]; + dateformatter.dateFormat = formatKey; + return dateformatter; +} + +- (NSString *)ly_currentTimeString { + NSString * newTimeStr = [self.ly_dateFormater stringFromDate:self]; + return newTimeStr; +} + +@end + + +@implementation NSDate (LYJudge) + +- (BOOL)ly_isToday { + NSCalendar *calendar = [NSCalendar currentCalendar]; + int unit = NSCalendarUnitDay | NSCalendarUnitMonth | NSCalendarUnitYear; + + // 1.获得当前时间的年月日 + NSDateComponents *nowCmps = [calendar components:unit fromDate:[NSDate date]]; + + // 2.获得self的年月日 + NSDateComponents *selfCmps = [calendar components:unit fromDate:self]; + return + (selfCmps.year == nowCmps.year) && + (selfCmps.month == nowCmps.month) && + (selfCmps.day == nowCmps.day); +} + +- (BOOL)ly_isYesterday { + NSDate *nowDate = [[NSDate date] ly_dateWithYMD]; + NSDate *selfDate = [self ly_dateWithYMD]; + + // 获得nowDate和selfDate的差距 + NSCalendar *calendar = [NSCalendar currentCalendar]; + NSDateComponents *cmps = [calendar components:NSCalendarUnitDay fromDate:selfDate toDate:nowDate options:0]; + return cmps.day == 1; +} + +- (BOOL)ly_isThisYear { + NSCalendar *calendar = [NSCalendar currentCalendar]; + int unit = NSCalendarUnitYear; + + // 1.获得当前时间的年月日 + NSDateComponents *nowCmps = [calendar components:unit fromDate:[NSDate date]]; + + // 2.获得self的年月日 + NSDateComponents *selfCmps = [calendar components:unit fromDate:self]; + + return nowCmps.year == selfCmps.year; +} + +@end diff --git a/LYToolsKit/Foundation/NSObject/NSObject+LYHook.h b/LYToolsKit/Foundation/NSObject/NSObject+LYHook.h new file mode 100644 index 0000000..8169803 --- /dev/null +++ b/LYToolsKit/Foundation/NSObject/NSObject+LYHook.h @@ -0,0 +1,34 @@ +// +// NSObject+LYHook.h +// LYFoundation +// +// Created by LY on 2017/10/18. +// Copyright © 2017年 LY. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSObject (LYHook) + +/** + hook类方法的实现 + + @param origSEL origSEL 需要hook的方法 + @param newSEL newSEL 新实现的方法 + @return return value 是否Hook成功 + */ ++ (BOOL)ly_hookOrigMethod:(SEL)origSEL newMethod:(SEL)newSEL; +/** + hook对象方法的实现 + + @param origSEL origSEL 需要hook的方法 + @param newSEL newSEL 新实现的方法 + @return return value 是否Hook成功 + */ +- (BOOL)ly_hookOrigMethod:(SEL)origSEL newMethod:(SEL)newSEL; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSObject/NSObject+LYHook.m b/LYToolsKit/Foundation/NSObject/NSObject+LYHook.m new file mode 100644 index 0000000..3c18b25 --- /dev/null +++ b/LYToolsKit/Foundation/NSObject/NSObject+LYHook.m @@ -0,0 +1,50 @@ +// +// NSObject+LYHook.m +// LYFoundation +// +// Created by LY on 2017/10/18. +// Copyright © 2017年 LY. All rights reserved. +// + +#import "NSObject+LYHook.h" +#import + +@implementation NSObject (LYHook) + ++ (BOOL)ly_hookOrigMethod:(SEL)origSEL newMethod:(SEL)newSEL { + Method originalMethod = class_getClassMethod(self, origSEL); + Method swizzledMethod = class_getClassMethod(self, newSEL); + + if (!originalMethod || !swizzledMethod) { + return NO; + } + + BOOL didAddMethod = class_addMethod(self, origSEL, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); + + if (didAddMethod) { + class_replaceMethod(self, newSEL, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } + return YES; +} + +- (BOOL)ly_hookOrigMethod:(SEL)origSEL newMethod:(SEL)newSEL { + Method originalMethod = class_getInstanceMethod(self.class, origSEL); + Method swizzledMethod = class_getInstanceMethod(self.class, newSEL); + + if (!originalMethod || !swizzledMethod) { + return NO; + } + + BOOL didAddMethod = class_addMethod(self.class, origSEL, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); + + if (didAddMethod) { + class_replaceMethod(self.class, newSEL, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } + return YES; +} + +@end diff --git a/LYToolsKit/Foundation/NSString/NSString+LYJS.h b/LYToolsKit/Foundation/NSString/NSString+LYJS.h new file mode 100644 index 0000000..422d557 --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYJS.h @@ -0,0 +1,40 @@ +// +// NSString+LYJS.h +// shuaidanbao +// +// Created by 吴浪 on 15/11/17. +// Copyright © 2015年 sdb. All rights reserved. +// 用于导出常用javascript,做一些简单的页面处理 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSString (LYJS) + +/** + 禁止点击Web页面的静态链接 + + @param disable disable 是否禁止 + @return return value js脚本 + */ ++ (instancetype)ly_jsForbidLink:(BOOL)disable; +/** 禁止Web页面复制粘贴 */ ++ (instancetype)ly_jsForbidCopy; +/** 禁止Web页面长按弹出菜单与放大镜 */ ++ (instancetype)ly_jsForbidMenu; +/** Web页面滚动到顶部 */ ++ (instancetype)ly_jsScrollToTop; +/** + 获取cookie + + @param name cookie name + @return cookie + */ ++ (instancetype)ly_cookieValueWithName:(NSString *)name; +/** Web User Agent */ ++ (instancetype)ly_userAgentWeb; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSString/NSString+LYJS.m b/LYToolsKit/Foundation/NSString/NSString+LYJS.m new file mode 100644 index 0000000..880c07e --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYJS.m @@ -0,0 +1,77 @@ +// +// NSString+LYJS.m +// shuaidanbao +// +// Created by 吴浪 on 15/11/17. +// Copyright © 2015年 sdb. All rights reserved. +// + +#import "NSString+LYJS.h" + +@implementation NSString (LYJS) + +- (instancetype)ly_jsLump { + if (self.length) { + NSString *js = [self copy]; + NSString *lump = [NSString stringWithFormat:@" \ + ;(function(window, document, undefined) { \ + %@ \ + })(window, document);", js]; + return lump; + } else { + return nil; + } +} + ++ (instancetype)ly_jsForbidLink:(BOOL)disable { + NSString *enable; + if (disable) { + enable = @"false"; + }else { + enable = @"true"; + } + NSString *js = [NSString stringWithFormat:@"function doLinkAll(action) { var aLabels = document.getElementsByTagName('a'); for (var i = 0; i < aLabels.length; i++) { if (action) { if (aLabels[i].rel) { aLabels[i].setAttribute('href', aLabels[i].ref); } } else { aLabels[i].setAttribute('rel', aLabels[i].href); aLabels[i].removeAttribute('href'); } } } doLinkAll(%@);", enable]; + return [js ly_jsLump]; +} + ++ (instancetype)ly_jsForbidCopy { + NSString *js = @"document.documentElement.style.webkitUserSelect='none';"; + return [js ly_jsLump]; +} + ++ (instancetype)ly_jsForbidMenu { + // 禁止选择CSS + // CSS选中样式取消 + NSString *js = @"var style = document.getElementById('LY_style_user'); \ + var style = style || document.createElement('style'); \ + style.type = 'text/css'; \ + style.id = 'LY_style_user'; \ + var cssContent=document.createTextNode('body{-webkit-user-select:none;-webkit-user-drag:none;-webkit-touch-callout:none;}'); \ + style.appendChild(cssContent); \ + document.body.appendChild(style);"; + return [js ly_jsLump]; +} + ++ (instancetype)ly_jsScrollToTop { + NSString *js = @"window.scrollTo(0, 0);"; + return [js ly_jsLump]; +} + ++ (instancetype)ly_cookieValueWithName:(NSString *)name { + NSString *jsString = [NSString stringWithFormat: + @"function ly_GetCookie(name) {" + "var arr,reg=new RegExp('(^| )'+name+'=([^;]*)(;|$)');" + "if(arr=document.cookie.match(reg)) {" + "return unescape(arr[2]);" + "} else {" + "return null;" + "}" + "};ly_GetCookie('%@');", name]; + return jsString; +} + ++ (instancetype)ly_userAgentWeb { + return @"navigator.userAgent"; +} + +@end diff --git a/LYToolsKit/Foundation/NSString/NSString+LYJudge.h b/LYToolsKit/Foundation/NSString/NSString+LYJudge.h new file mode 100644 index 0000000..d38ab2e --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYJudge.h @@ -0,0 +1,22 @@ +// +// NSString+LYJudge.h +// LYToolsKit +// +// Created by 吴浪 on 2018/11/12. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSString (LYJudge) + +/** 判断整形 */ +- (BOOL)ly_isPureInt; +/** 判断浮点形 */ +- (BOOL)ly_isPureFloat; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSString/NSString+LYJudge.m b/LYToolsKit/Foundation/NSString/NSString+LYJudge.m new file mode 100644 index 0000000..a989c22 --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYJudge.m @@ -0,0 +1,26 @@ +// +// NSString+LYJudge.m +// LYToolsKit +// +// Created by 吴浪 on 2018/11/12. +// + +#import "NSString+LYJudge.h" + +@implementation NSString (LYJudge) + +- (BOOL)ly_isPureInt { + NSScanner *scan = [NSScanner scannerWithString:self]; + scan.charactersToBeSkipped = nil; + int val; + return ([scan scanInt:&val] && [scan isAtEnd]); +} + +- (BOOL)ly_isPureFloat { + NSScanner *scan = [NSScanner scannerWithString:self]; + scan.charactersToBeSkipped = nil; + float val; + return ([scan scanFloat:&val] && [scan isAtEnd]); +} + +@end diff --git a/LYToolsKit/Foundation/NSString/NSString+LYURL.h b/LYToolsKit/Foundation/NSString/NSString+LYURL.h new file mode 100644 index 0000000..0587b94 --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYURL.h @@ -0,0 +1,59 @@ +// +// NSString+LYURL.h +// LYToolsKit +// +// Created by 吴浪 on 2018/11/12. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const kLYURLScheme; +extern NSString *const kLYURLHost; +extern NSString *const kLYURLPort; +extern NSString *const kLYURLParams; +extern NSString *const kLYURLQuerys; +extern NSString *const kLYURLPath; +extern NSString *const kLYURLFragment; + +@interface NSString (LYURL) + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdocumentation" +/** + 解析URL + 格式如:http://host.name:8888/test/page/?keyA=valueA&keyB=valueB#top + URL中的 参数表 + @param kLYURLScheme 如 http + @param kLYURLHost 如 host.name + @param kLYURLPort 如 8888 + @param kLYURLParams 如 {keyA:valueA, keyB:valueB} + @param kLYURLQuerys 如 [{keyA:valueA}, {keyB:valueB}],含重复 + @param kLYURLPath 如 /test/page + @param kLYURLFragment 如 top + @return NSDictionary + */ +- (NSDictionary *)ly_paramsFromURLString; +#pragma clang diagnostic pop + +/** + URL地址Reserved Characters与Unreserved Characters之外的字符做百分号编码。 + 编码范围: + 1. UTF-8编码 + 2. !*'();:@&=+$,/?%#[ ]除外字符 + */ +- (instancetype)ly_stringAllAddingPercentEncoding; +/** 处理字符串中的中文、空格、《》()【】 */ +- (instancetype)ly_stringAddingPercentEscapesChineseSpace; +/** + 根据 string构建 URL实例 + + @param string string URL String + @return return value URL实例 + */ ++ (NSURL *)ly_URLWithString:(NSString *)string; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSString/NSString+LYURL.m b/LYToolsKit/Foundation/NSString/NSString+LYURL.m new file mode 100644 index 0000000..14fe21e --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYURL.m @@ -0,0 +1,92 @@ +// +// NSString+LYURL.m +// LYToolsKit +// +// Created by 吴浪 on 2018/11/12. +// + +#import "NSString+LYURL.h" + +NSString *const kLYURLScheme = @"SCHEME"; +NSString *const kLYURLHost = @"HOST"; +NSString *const kLYURLPort = @"PORT"; +NSString *const kLYURLParams = @"PARAMS"; +NSString *const kLYURLQuerys = @"QUERYS"; +NSString *const kLYURLPath = @"PATH"; +NSString *const kLYURLFragment = @"FRAGMENT"; + +@implementation NSString (LYURL) + ++ (NSURL *)ly_URLWithString:(NSString *)string { + NSURL *url; + if (string && [string isKindOfClass:[NSString class]] && string.length) { + url = [NSURL URLWithString:string]; + } else { + url = nil; + } + return url; +} + +- (NSDictionary *)ly_paramsFromURLString { + NSString *urlStr = [self ly_stringAddingPercentEscapesChineseSpace]; + if (urlStr.length) { + NSURLComponents *urlComponent = [NSURLComponents componentsWithString:urlStr]; + + NSMutableDictionary *params = [NSMutableDictionary dictionary]; + params[kLYURLScheme] = urlComponent.scheme; + params[kLYURLHost] = urlComponent.host; + params[kLYURLPort] = urlComponent.port; + params[kLYURLPath] = urlComponent.path; + params[kLYURLFragment] = urlComponent.fragment; + + __block NSMutableDictionary *paramDict = [NSMutableDictionary dictionary]; + __block NSMutableArray *queryArray = [NSMutableArray array]; + [urlComponent.queryItems enumerateObjectsUsingBlock:^(NSURLQueryItem * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + dict[obj.name] = obj.value; + [queryArray addObject:dict]; + [paramDict addEntriesFromDictionary:dict]; + }]; + params[kLYURLParams] = paramDict; + params[kLYURLQuerys] = queryArray; + + return [params copy]; + } + + return nil; +} + +- (instancetype)ly_stringAllAddingPercentEncoding { + return [self stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"!*'();:@&=+$,/?%#[ ]"].invertedSet]; +} + +- (instancetype)ly_stringAddingPercentEscapesChineseSpace { + if (!self.length) { + return self; + } + + NSString *regex = @".*[\u4e00-\u9fa5《》()【】].*"; + NSPredicate *pre = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; + + __block NSString *urlStr = [self copy]; + BOOL isIllegal = [pre evaluateWithObject:urlStr]; + if (isIllegal) { + __block NSMutableDictionary *keyValueDict = [NSMutableDictionary dictionary]; + NSString *regex = @"[\u4e00-\u9fa5《》()【】]"; + NSRegularExpression *regular = [NSRegularExpression regularExpressionWithPattern:regex options:NSRegularExpressionCaseInsensitive error:NULL]; + [regular enumerateMatchesInString:urlStr options:NSMatchingReportProgress range:NSMakeRange(0, urlStr.length) usingBlock:^(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL * _Nonnull stop) { + if (result) { + NSString *kv = [urlStr substringWithRange:result.range]; + keyValueDict[kv] = [kv stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; + } + }]; + + [keyValueDict enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { + urlStr = [urlStr stringByReplacingOccurrencesOfString:key withString:obj]; + }]; + } + + return [urlStr stringByReplacingOccurrencesOfString:@" " withString:@""]; +} + +@end diff --git a/LYToolsKit/Foundation/NSString/NSString+LYUnits.h b/LYToolsKit/Foundation/NSString/NSString+LYUnits.h new file mode 100755 index 0000000..57b4b3d --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYUnits.h @@ -0,0 +1,20 @@ +// +// NSString+LYUnits.h +// shuaidanbao +// +// Created by 吴浪 on 15/9/11. +// Copyright (c) 2015年 sdb. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface NSString (LYUnits) + +/** 数据大小转换KB、MB、GB */ ++ (instancetype)ly_fileSizeToString:(unsigned long long)fileSize; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Foundation/NSString/NSString+LYUnits.m b/LYToolsKit/Foundation/NSString/NSString+LYUnits.m new file mode 100755 index 0000000..70be2ff --- /dev/null +++ b/LYToolsKit/Foundation/NSString/NSString+LYUnits.m @@ -0,0 +1,31 @@ +// +// NSString+LYUnits.m +// shuaidanbao +// +// Created by 吴浪 on 15/9/11. +// Copyright (c) 2015年 sdb. All rights reserved. +// + +#import "NSString+LYUnits.h" + +@implementation NSString (LYUnits) + ++ (instancetype)ly_fileSizeToString:(unsigned long long)fileSize { + NSInteger KB = 1024; + NSInteger MB = pow(KB, 2); + NSInteger GB = pow(KB, 3); + + if (fileSize < 10) { + return @"0 B"; + }else if (fileSize < KB) { + return [NSString stringWithFormat:@"%.1f B", (CGFloat)fileSize]; + }else if (fileSize < MB) { + return [NSString stringWithFormat:@"%.1f KB", ((CGFloat)fileSize) / KB]; + }else if (fileSize < GB) { + return [NSString stringWithFormat:@"%.1f MB", ((CGFloat)fileSize) / MB]; + }else { + return [NSString stringWithFormat:@"%.1f GB", ((CGFloat)fileSize) / GB]; + } +} + +@end diff --git a/LYToolsKit/LYToolsKit.h b/LYToolsKit/LYToolsKit.h new file mode 100644 index 0000000..18a691a --- /dev/null +++ b/LYToolsKit/LYToolsKit.h @@ -0,0 +1,15 @@ +// +// LYToolsKit.h +// Pods +// +// Created by 吴浪 on 2018/11/12. +// + +#ifndef LYToolsKit_h +#define LYToolsKit_h + +#import +#import +#import + +#endif /* LYToolsKit_h */ diff --git a/LYToolsKit/UI/LYUI.h b/LYToolsKit/UI/LYUI.h new file mode 100644 index 0000000..040aacb --- /dev/null +++ b/LYToolsKit/UI/LYUI.h @@ -0,0 +1,47 @@ +// +/// LYUI.h +/// LYUI +// +/// Created by ly on 17/3/9. +/// Copyright © 2017年 LY. All rights reserved. +// + +#ifndef LYUI_h +#define LYUI_h + +#pragma mark - UIMacro +#import + +#pragma mark - UIView +#import +#import +#import + +#pragma mark - UIView_LYExt +#import +#import +#import +#import +#import +#import + +#pragma mark - UIButton +#import + +#pragma mark - UILabel + +#pragma mark - UIAlertController +#import + +#pragma mark - UIImage +#import +#import +#import + +#pragma mark - UIDevice +#import + +#pragma mark - UIColor +#import + +#endif /* LYUI_h */ diff --git a/LYToolsKit/UI/Macro/LYUIMacro.h b/LYToolsKit/UI/Macro/LYUIMacro.h new file mode 100644 index 0000000..9117324 --- /dev/null +++ b/LYToolsKit/UI/Macro/LYUIMacro.h @@ -0,0 +1,20 @@ +// +// LYUIMacro.h +// LYUI +// +// Created by 吴浪 on 2018/11/11. +// + +#ifndef LYUIMacro_h +#define LYUIMacro_h + +#ifdef __OBJC__ + +#pragma mark - System Component Size +#define kScreenBounds ([UIScreen mainScreen].bounds) +#define kScreenWidth ([UIScreen mainScreen].bounds.size.width) +#define kScreenHeight ([UIScreen mainScreen].bounds.size.height) + +#endif + +#endif /* LYUIMacro_h */ diff --git a/LYToolsKit/UI/UI/Reachability/LYReachability.h b/LYToolsKit/UI/UI/Reachability/LYReachability.h new file mode 100644 index 0000000..2708944 --- /dev/null +++ b/LYToolsKit/UI/UI/Reachability/LYReachability.h @@ -0,0 +1,64 @@ +/* + Copyright (C) 2016 Apple Inc. All Rights Reserved. + See LICENSE.txt for this sample’s licensing information + + Abstract: + Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + */ + +#import +#import +#import + + +typedef enum : NSInteger { + LYNetworkStatusNotReachable = 0, + LYNetworkStatusReachableViaWiFi, + LYNetworkStatusReachableViaWWAN +} LYNetworkStatus; + +#pragma mark IPv6 Support +//Reachability fully support IPv6. For full details, see ReadMe.md. + + +extern NSString *kLYReachabilityChangedNotification; + + +@interface LYReachability : NSObject + +/*! + * Use to check the reachability of a given host name. + */ ++ (instancetype)reachabilityWithHostName:(NSString *)hostName; + +/*! + * Use to check the reachability of a given IP address. + */ ++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress; + +/*! + * Checks whether the default route is available. Should be used by applications that do not connect to a particular host. + */ ++ (instancetype)reachabilityForInternetConnection; + + +#pragma mark reachabilityForLocalWiFi +//reachabilityForLocalWiFi has been removed from the sample. See ReadMe.md for more information. +//+ (instancetype)reachabilityForLocalWiFi; + +/*! + * Start listening for reachability notifications on the current run loop. + */ +- (BOOL)startNotifier; +- (void)stopNotifier; + +- (LYNetworkStatus)currentReachabilityStatus; + +/*! + * WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand. + */ +- (BOOL)connectionRequired; + +@end + + diff --git a/LYToolsKit/UI/UI/Reachability/LYReachability.m b/LYToolsKit/UI/UI/Reachability/LYReachability.m new file mode 100644 index 0000000..0e36fdf --- /dev/null +++ b/LYToolsKit/UI/UI/Reachability/LYReachability.m @@ -0,0 +1,242 @@ +/* + Copyright (C) 2016 Apple Inc. All Rights Reserved. + See LICENSE.txt for this sample’s licensing information + + Abstract: + Basic demonstration of how to use the SystemConfiguration Reachablity APIs. + */ + +#import +#import +#import +#import +#import + +#import + +#import "LYReachability.h" + +#pragma mark IPv6 Support +//Reachability fully support IPv6. For full details, see ReadMe.md. + + +NSString *kLYReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification"; + + +#pragma mark - Supporting functions + +#define kShouldPrintReachabilityFlags 1 + +static void PrintReachabilityFlags(SCNetworkReachabilityFlags flags, const char* comment) +{ +#if kShouldPrintReachabilityFlags + + NSLog(@"Reachability Flag Status: %c%c %c%c%c%c%c%c%c %s\n", + (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-', + (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', + + (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', + (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', + (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', + (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', + (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', + comment + ); +#endif +} + + +static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* info) +{ +#pragma unused (target, flags) + NSCAssert(info != NULL, @"info was NULL in ReachabilityCallback"); + NSCAssert([(__bridge NSObject*) info isKindOfClass: [LYReachability class]], @"info was wrong class in ReachabilityCallback"); + + LYReachability* noteObject = (__bridge LYReachability *)info; + // Post a notification to notify the client that the network reachability changed. + [[NSNotificationCenter defaultCenter] postNotificationName: kLYReachabilityChangedNotification object: noteObject]; +} + + +#pragma mark - Reachability implementation + +@implementation LYReachability +{ + SCNetworkReachabilityRef _reachabilityRef; +} + ++ (instancetype)reachabilityWithHostName:(NSString *)hostName +{ + LYReachability* returnValue = NULL; + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, [hostName UTF8String]); + if (reachability != NULL) + { + returnValue= [[self alloc] init]; + if (returnValue != NULL) + { + returnValue->_reachabilityRef = reachability; + } + else { + CFRelease(reachability); + } + } + return returnValue; +} + + ++ (instancetype)reachabilityWithAddress:(const struct sockaddr *)hostAddress +{ + SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, hostAddress); + + LYReachability* returnValue = NULL; + + if (reachability != NULL) + { + returnValue = [[self alloc] init]; + if (returnValue != NULL) + { + returnValue->_reachabilityRef = reachability; + } + else { + CFRelease(reachability); + } + } + return returnValue; +} + + ++ (instancetype)reachabilityForInternetConnection +{ + struct sockaddr_in zeroAddress; + bzero(&zeroAddress, sizeof(zeroAddress)); + zeroAddress.sin_len = sizeof(zeroAddress); + zeroAddress.sin_family = AF_INET; + + return [self reachabilityWithAddress: (const struct sockaddr *) &zeroAddress]; +} + +#pragma mark reachabilityForLocalWiFi +//reachabilityForLocalWiFi has been removed from the sample. See ReadMe.md for more information. +//+ (instancetype)reachabilityForLocalWiFi + + + +#pragma mark - Start and stop notifier + +- (BOOL)startNotifier +{ + BOOL returnValue = NO; + SCNetworkReachabilityContext context = {0, (__bridge void *)(self), NULL, NULL, NULL}; + + if (SCNetworkReachabilitySetCallback(_reachabilityRef, ReachabilityCallback, &context)) + { + if (SCNetworkReachabilityScheduleWithRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)) + { + returnValue = YES; + } + } + + return returnValue; +} + + +- (void)stopNotifier +{ + if (_reachabilityRef != NULL) + { + SCNetworkReachabilityUnscheduleFromRunLoop(_reachabilityRef, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode); + } +} + + +- (void)dealloc +{ + [self stopNotifier]; + if (_reachabilityRef != NULL) + { + CFRelease(_reachabilityRef); + } +} + + +#pragma mark - Network Flag Handling + +- (LYNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags +{ + PrintReachabilityFlags(flags, "networkStatusForFlags"); + if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) + { + // The target host is not reachable. + return LYNetworkStatusNotReachable; + } + + LYNetworkStatus returnValue = LYNetworkStatusNotReachable; + + if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) + { + /* + If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi... + */ + returnValue = LYNetworkStatusReachableViaWiFi; + } + + if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) || + (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0)) + { + /* + ... and the connection is on-demand (or on-traffic) if the calling application is using the CFSocketStream or higher APIs... + */ + + if ((flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) + { + /* + ... and no [user] intervention is needed... + */ + returnValue = LYNetworkStatusReachableViaWiFi; + } + } + + if ((flags & kSCNetworkReachabilityFlagsIsWWAN) == kSCNetworkReachabilityFlagsIsWWAN) + { + /* + ... but WWAN connections are OK if the calling application is using the CFNetwork APIs. + */ + returnValue = LYNetworkStatusReachableViaWWAN; + } + + return returnValue; +} + + +- (BOOL)connectionRequired +{ + NSAssert(_reachabilityRef != NULL, @"connectionRequired called with NULL reachabilityRef"); + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) + { + return (flags & kSCNetworkReachabilityFlagsConnectionRequired); + } + + return NO; +} + + +- (LYNetworkStatus)currentReachabilityStatus +{ + NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef"); + LYNetworkStatus returnValue = LYNetworkStatusNotReachable; + SCNetworkReachabilityFlags flags; + + if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags)) + { + returnValue = [self networkStatusForFlags:flags]; + } + + return returnValue; +} + + +@end diff --git a/LYToolsKit/UI/UI/UIAlert/LYAlertController.h b/LYToolsKit/UI/UI/UIAlert/LYAlertController.h new file mode 100644 index 0000000..ee8408b --- /dev/null +++ b/LYToolsKit/UI/UI/UIAlert/LYAlertController.h @@ -0,0 +1,114 @@ +// +// LYAlertController.h +// LYUI +// +// Created by 吴浪 on 2017/3/17. +// Copyright © 2017年 LY. All rights reserved. +// + +#import + +/** +示例:self(UIViewController对象) +[self ly_showAlertWithTitle:@"温馨提示" message:@"使用实例" appearanceProcess:^(LYAlertController *alertMaker) { + alertMaker + .addActionCancelTitle(@"取消") + .addActionDefaultTitle(@"确定"); +} actionsBlock:^(NSInteger index, UIAlertAction *action, LYAlertController *alertMaker) { + if (0 == index) { + //取消 + } else if (1 == index) { + //确定 + } else { + //未知 + } +}]; +*/ + +NS_ASSUME_NONNULL_BEGIN + +@class LYAlertController; + +/** + alert按钮执行回调 + + @param index 按钮index(根据添加action的顺序) + @param action UIAlertAction对象 + @param alertMaker LYAlertController对象 + */ +typedef void (^LYAlertActionBlock)(NSInteger index, UIAlertAction *action, LYAlertController *alertMaker); + +/** + alertAction 配置链 + + @param title 标题 + @return LYAlertController对象 + */ +typedef LYAlertController *_Nonnull(^LYAlertActionTitle)(NSString *title); +#pragma mark - I.LYAlertController +@interface LYAlertController : UIAlertController +/** + * 设置toast模式展示时间:如果alert未添加任何按钮,将会以toast样式展开,这里设置展示时间,默认1.5s + */ +@property (nonatomic, assign) NSTimeInterval toastStyleDuration; +@property (nonatomic, copy) void (^toastStyleDidDismiss)(void); /** toastStyle关闭后 */ +@property (nonatomic, assign) BOOL gnh_AlertAnimated; /** 弹框展示与消失动画,默认YES */ +@property (nonatomic, copy) void (^alertDidShow)(void); /** alert弹出后 */ +/** + 链式构造alert视图按钮,添加alertAction按钮,默认样式 + + @return 链式 block + */ +- (LYAlertActionTitle)addActionDefaultTitle; + +/** + 链式构造alert视图按钮,添加alertAction按钮,取消样式,(注意:一个alert只能添加一次该样式) + + @return 链式 block + */ +- (LYAlertActionTitle)addActionCancelTitle; + +/** + 链式构造alert视图按钮,添加alertAction按钮,警告样式 + + @return 链式 block + */ +- (LYAlertActionTitle)addActionDestructiveTitle; +@end + +#pragma mark - II.LYAlertController扩展使用LYAlertController + +/** alert构造 + + @param alertMaker LYAlertController对象 + */ +typedef void (^LYAlertAppearanceProcess)(LYAlertController *alertMaker); + +@interface UIViewController (LYAlertController) + +/** alert弹框 + + @param title title + @param message message + @param appearanceProcess alert配置过程 + @param actionsBlock alert点击响应回调 + */ +- (void)ly_showAlertWithTitle:(nullable NSString *)title + message:(nullable NSString *)message + appearanceProcess:(nullable LYAlertAppearanceProcess)appearanceProcess + actionsBlock:(nullable LYAlertActionBlock)actionsBlock; +/** sheet弹框 + + @param title title + @param message message + @param appearanceProcess alert配置过程 + @param actionsBlock alert点击响应回调 + */ +- (void)ly_showSheetWithTitle:(nullable NSString *)title + message:(nullable NSString *)message + appearanceProcess:(nullable LYAlertAppearanceProcess)appearanceProcess + actionsBlock:(nullable LYAlertActionBlock)actionsBlock; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIAlert/LYAlertController.m b/LYToolsKit/UI/UI/UIAlert/LYAlertController.m new file mode 100644 index 0000000..cabfe08 --- /dev/null +++ b/LYToolsKit/UI/UI/UIAlert/LYAlertController.m @@ -0,0 +1,147 @@ +// +// LYAlertController.m +// LYUI +// +// Created by 吴浪 on 2017/3/17. +// Copyright © 2017年 LY. All rights reserved. +// + +#import "LYAlertController.h" + +static NSTimeInterval const kShowDurationDefault = 1.5f; //toast默认展示时间 +#pragma mark - I.LYAlertActionModel + +@interface LYAlertActionModel : NSObject +@property (nonatomic, copy) NSString *title; +@property (nonatomic, assign) UIAlertActionStyle style; +@end +@implementation LYAlertActionModel +- (instancetype)init { + if (self = [super init]) { + self.title = @""; + self.style = UIAlertActionStyleDefault; + } + return self; +} +@end + +/** 配置AlertAction */ +typedef void (^LYAlertActionsConfig)(LYAlertActionBlock actionBlock); +@interface LYAlertController () +@property (nonatomic, strong) NSMutableArray * ly_alertActionArray; +@end + +@implementation LYAlertController + +- (void)viewDidLoad { + [super viewDidLoad]; +} + ++ (instancetype)ly_alertControllerWithTitle:(NSString *)title message:(NSString *)message preferredStyle:(UIAlertControllerStyle)preferredStyle { + LYAlertController *alertAC = [self alertControllerWithTitle:title message:message preferredStyle:preferredStyle]; + alertAC.gnh_AlertAnimated = YES; + alertAC.toastStyleDuration = kShowDurationDefault; + return alertAC; +} + +- (LYAlertActionTitle)addActionDefaultTitle { + return ^(NSString *title) { + LYAlertActionModel *model = [[LYAlertActionModel alloc] init]; + model.title = title; + model.style = UIAlertActionStyleDefault; + [self.ly_alertActionArray addObject:model]; + return self; + }; +} + +- (LYAlertActionTitle)addActionCancelTitle { + //该block返回值不是本类属性,只是局部变量,不会造成循环引用 + return ^(NSString *title) { + LYAlertActionModel *model = [[LYAlertActionModel alloc] init]; + model.title = title; + model.style = UIAlertActionStyleCancel; + [self.ly_alertActionArray addObject:model]; + return self; + }; +} + +- (LYAlertActionTitle)addActionDestructiveTitle { + return ^(NSString *title) { + LYAlertActionModel *model = [[LYAlertActionModel alloc] init]; + model.title = title; + model.style = UIAlertActionStyleDestructive; + [self.ly_alertActionArray addObject:model]; + return self; + }; +} + +- (NSMutableArray *)ly_alertActionArray { + if (_ly_alertActionArray == nil) { + _ly_alertActionArray = [NSMutableArray array]; + } + return _ly_alertActionArray; +} + +- (LYAlertActionsConfig)alertActionsConfig { + return ^(LYAlertActionBlock actionBlock) { + if (self.ly_alertActionArray.count > 0) { + __weak typeof(self) weakself = self; + [self.ly_alertActionArray enumerateObjectsUsingBlock:^(LYAlertActionModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + if (obj.title) { + UIAlertAction *alertAction = [UIAlertAction actionWithTitle:obj.title style:obj.style handler:^(UIAlertAction * _Nonnull action) { + if (actionBlock) { + __strong typeof(weakself) strongSelf = weakself; + actionBlock(idx, action, strongSelf); + } + }]; + [self addAction:alertAction]; + } + }]; + } else { + NSTimeInterval duration = self.toastStyleDuration; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self dismissViewControllerAnimated:self.gnh_AlertAnimated completion:^{ + if (self.toastStyleDidDismiss) { + self.toastStyleDidDismiss(); + } + }]; + }); + } + }; +} + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +@end + +#pragma mark - III.LYAlertController扩展使用LYAlertController +@implementation UIViewController (LYAlertController) + +- (void)ly_showPreferredStyle:(UIAlertControllerStyle)preferredStyle title:(NSString *)title message:(NSString *)message appearanceProcess:(LYAlertAppearanceProcess)appearanceProcess actionsBlock:(LYAlertActionBlock)actionsBlock { + LYAlertController *alertAC = [LYAlertController ly_alertControllerWithTitle:title message:message preferredStyle:preferredStyle]; + + //配置alert action + if (appearanceProcess) { + appearanceProcess(alertAC); + } + //配置action 响应 + alertAC.alertActionsConfig(actionsBlock); + //弹出视图 + [self presentViewController:alertAC animated:alertAC.gnh_AlertAnimated completion:^{ + if (alertAC.alertDidShow) { + alertAC.alertDidShow(); + } + }]; +} + +- (void)ly_showAlertWithTitle:(NSString *)title message:(NSString *)message appearanceProcess:(LYAlertAppearanceProcess)appearanceProcess actionsBlock:(LYAlertActionBlock)actionsBlock { + [self ly_showPreferredStyle:UIAlertControllerStyleAlert title:title message:message appearanceProcess:appearanceProcess actionsBlock:actionsBlock]; +} + +- (void)ly_showSheetWithTitle:(NSString *)title message:(NSString *)message appearanceProcess:(LYAlertAppearanceProcess)appearanceProcess actionsBlock:(LYAlertActionBlock)actionsBlock { + [self ly_showPreferredStyle:UIAlertControllerStyleActionSheet title:title message:message appearanceProcess:appearanceProcess actionsBlock:actionsBlock]; +} +@end diff --git a/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.h b/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.h new file mode 100644 index 0000000..7208fec --- /dev/null +++ b/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.h @@ -0,0 +1,19 @@ +// +// UIButton+LYDelay.h +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIButton (LYDelay) + +@property (nonatomic, assign) NSTimeInterval ly_clickTimeInterval;/**< 点击时间间隔,默认:0.5s */ +@property (nonatomic, assign) BOOL ly_enabledClickInterval;/**< 启用点击间隔,默认:NO */ + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.m b/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.m new file mode 100644 index 0000000..681b5d7 --- /dev/null +++ b/LYToolsKit/UI/UI/UIButton/UIButton+LYDelay.m @@ -0,0 +1,90 @@ +// +// UIButton+LYDelay.m +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import "UIButton+LYDelay.h" +#import + +static NSTimeInterval const kDefaultClickTimeInterval = 0.5; /** 按钮默认点击时间间隔 */ +static NSString *const kClickTimeInterval = @"clickTimeInterval"; +static NSString *const kIsIgnoreEvent = @"isIgnoreEvent"; +static NSString *const kEnabledClickInterval = @"enabledClickInterval"; + +@interface UIButton () +@property (nonatomic, assign) BOOL isIgnoreEvent; +@end +@implementation UIButton (LYDelay) + +- (void)setLy_clickTimeInterval:(NSTimeInterval)clickTimeInterval { + objc_setAssociatedObject(self, (__bridge const void *)(kClickTimeInterval), @(clickTimeInterval), OBJC_ASSOCIATION_ASSIGN); +} + +- (NSTimeInterval)ly_clickTimeInterval { + NSTimeInterval durationTime = [objc_getAssociatedObject(self, (__bridge const void *)(kClickTimeInterval)) doubleValue]; + return durationTime > 0?: kDefaultClickTimeInterval; +} + +- (void)setIsIgnoreEvent:(BOOL)isIgnoreEvent { + objc_setAssociatedObject(self, (__bridge const void *)(kIsIgnoreEvent), @(isIgnoreEvent), OBJC_ASSOCIATION_ASSIGN); +} + +- (BOOL)isIgnoreEvent { + return [objc_getAssociatedObject(self, (__bridge const void *)(kIsIgnoreEvent)) boolValue]; +} + +- (void)setLy_enabledClickInterval:(BOOL)enabledClickInterval { + objc_setAssociatedObject(self, (__bridge const void * _Nonnull)(kEnabledClickInterval), @(enabledClickInterval), OBJC_ASSOCIATION_ASSIGN); +} + +- (BOOL)ly_enabledClickInterval { + return [objc_getAssociatedObject(self, (__bridge const void * _Nonnull)(kEnabledClickInterval)) boolValue]; +} + +- (void)my_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event { + if (!self.ly_enabledClickInterval || [self filterSpecifiedButtonType:self]) { + [self my_sendAction:action to:target forEvent:event]; + } else { + if (self.isIgnoreEvent) { + return; + } else { + self.isIgnoreEvent = YES; + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(self.ly_clickTimeInterval * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + self.isIgnoreEvent = NO; + }); + [self my_sendAction:action to:target forEvent:event]; + } + } +} + +- (BOOL)filterSpecifiedButtonType:(UIButton *)btn { + NSArray *filterButtons = @[@"CAMFlipButton", @"CUShutterButton"]; + __block BOOL isFilter = NO; + [filterButtons enumerateObjectsUsingBlock:^(NSString * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + Class cls = NSClassFromString(obj); + if (cls && [obj isKindOfClass:cls]) { + isFilter = YES; + *stop = YES; + } + }]; + return isFilter; +} + ++ (void)load { + SEL originalSelector = @selector(sendAction:to:forEvent:); + SEL swizzledSelector = @selector(my_sendAction:to:forEvent:); + + Method originalMethod = class_getInstanceMethod(self, originalSelector); + Method swizzledMethod = class_getInstanceMethod(self, swizzledSelector); + + BOOL addMyMethod = class_addMethod(self, originalSelector, method_getImplementation(swizzledMethod), method_getTypeEncoding(swizzledMethod)); + if (addMyMethod) { + class_replaceMethod(self, swizzledSelector, method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod)); + } else { + method_exchangeImplementations(originalMethod, swizzledMethod); + } +} + +@end diff --git a/LYToolsKit/UI/UI/UIColor/UIColor+LYString.h b/LYToolsKit/UI/UI/UIColor/UIColor+LYString.h new file mode 100644 index 0000000..efd322f --- /dev/null +++ b/LYToolsKit/UI/UI/UIColor/UIColor+LYString.h @@ -0,0 +1,40 @@ +// +// UIColor+LYHex.h +// LYUI +// +// Created by 吴浪 on 16/5/12. +// Copyright © 2016年 dingli. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIColor (LYString) + +@property (nonatomic, readonly) CGColorSpaceModel ly_spaceModel; +@property (nonatomic, readonly, getter=isLy_canProvideRGBComponents) BOOL ly_canProvideRGBComponents; +@property (nonatomic, readonly) CGFloat ly_red; // Only valid if canProvideRGBComponents is YES +@property (nonatomic, readonly) CGFloat ly_green; // Only valid if canProvideRGBComponents is YES +@property (nonatomic, readonly) CGFloat ly_blue; // Only valid if canProvideRGBComponents is YES +@property (nonatomic, readonly) CGFloat ly_white; // Only valid if colorSpaceModel == kCGColorSpaceModelMonochrome +@property (nonatomic, readonly) CGFloat ly_alpha; +@property (nonatomic, readonly) UInt32 ly_rgbHex; + +/** {r, g, b, a} */ +- (NSString *)ly_stringFromColor; +/** 16进制值 */ +- (NSString *)ly_hexStringFromColor; + +@end + + +@interface UIColor (LYHex) + +/** 将16进制颜色值如#000000转换成UIColor */ ++ (instancetype)ly_colorWithHexString:(NSString *)hex; ++ (instancetype)ly_colorWithHexString:(NSString *)hex alpha:(CGFloat)alpha; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIColor/UIColor+LYString.m b/LYToolsKit/UI/UI/UIColor/UIColor+LYString.m new file mode 100644 index 0000000..c1f35cc --- /dev/null +++ b/LYToolsKit/UI/UI/UIColor/UIColor+LYString.m @@ -0,0 +1,169 @@ +// +// UIColor+LYHex.m +// LYUI +// +// Created by 吴浪 on 16/5/12. +// Copyright © 2016年 dingli. All rights reserved. +// + +#import "UIColor+LYString.h" + +@implementation UIColor (LYString) + +- (CGColorSpaceModel)ly_spaceModel { + return CGColorSpaceGetModel(CGColorGetColorSpace(self.CGColor)); +} + +- (BOOL)isLy_canProvideRGBComponents { + switch (self.ly_spaceModel) { + case kCGColorSpaceModelRGB: + case kCGColorSpaceModelMonochrome: + return YES; + default: + return NO; + } +} + +- (BOOL)ly_red:(CGFloat *)red green:(CGFloat *)green blue:(CGFloat *)blue alpha:(CGFloat *)alpha { + const CGFloat *components = CGColorGetComponents(self.CGColor); + + CGFloat r,g,b,a; + + switch (self.ly_spaceModel) { + case kCGColorSpaceModelMonochrome: + r = g = b = components[0]; + a = components[1]; + break; + case kCGColorSpaceModelRGB: + r = components[0]; + g = components[1]; + b = components[2]; + a = components[3]; + break; + default: // We don't know how to handle this model + return NO; + } + + if (red) *red = r; + if (green) *green = g; + if (blue) *blue = b; + if (alpha) *alpha = a; + + return YES; +} + +- (CGFloat)ly_red { + NSAssert(self.isLy_canProvideRGBComponents, @"Must be an RGB color to use -red"); + const CGFloat *c = CGColorGetComponents(self.CGColor); + return c[0]; +} + +- (CGFloat)ly_green { + NSAssert(self.isLy_canProvideRGBComponents, @"Must be an RGB color to use -green"); + const CGFloat *c = CGColorGetComponents(self.CGColor); + if (self.ly_spaceModel == kCGColorSpaceModelMonochrome) return c[0]; + return c[1]; +} + +- (CGFloat)ly_blue { + NSAssert(self.isLy_canProvideRGBComponents, @"Must be an RGB color to use -blue"); + const CGFloat *c = CGColorGetComponents(self.CGColor); + if (self.ly_spaceModel == kCGColorSpaceModelMonochrome) return c[0]; + return c[2]; +} + +- (CGFloat)ly_white { + NSAssert(self.ly_spaceModel == kCGColorSpaceModelMonochrome, @"Must be a Monochrome color to use -white"); + const CGFloat *c = CGColorGetComponents(self.CGColor); + return c[0]; +} + +- (CGFloat)ly_alpha { + return CGColorGetAlpha(self.CGColor); +} + +- (UInt32)ly_rgbHex { + NSAssert(self.isLy_canProvideRGBComponents, @"Must be a RGB color to use rgbHex"); + + CGFloat r,g,b,a; + if (![self ly_red:&r green:&g blue:&b alpha:&a]) return 0; + + r = MIN(MAX(self.ly_red, 0.0f), 1.0f); + g = MIN(MAX(self.ly_green, 0.0f), 1.0f); + b = MIN(MAX(self.ly_blue, 0.0f), 1.0f); + + return (((int)roundf(r * 255)) << 16) + | (((int)roundf(g * 255)) << 8) + | (((int)roundf(b * 255))); +} + +- (NSString *)ly_stringFromColor { + NSAssert(self.isLy_canProvideRGBComponents, @"Must be an RGB color to use -stringFromColor"); + NSString *result; + switch (self.ly_spaceModel) { + case kCGColorSpaceModelRGB: + result = [NSString stringWithFormat:@"{%0.3f, %0.3f, %0.3f, %0.3f}", self.ly_red, self.ly_green, self.ly_blue, self.ly_alpha]; + break; + case kCGColorSpaceModelMonochrome: + result = [NSString stringWithFormat:@"{%0.3f, %0.3f}", self.ly_white, self.ly_alpha]; + break; + default: + result = nil; + } + return result; +} + +- (NSString *)ly_hexStringFromColor { + return [NSString stringWithFormat:@"%0.6lX", (long)self.ly_rgbHex]; +} + +@end + +@implementation UIColor (LYHex) ++ (instancetype)ly_colorWithHexString:(NSString *)hex { + return [self ly_colorWithHexString:hex alpha:1.0]; +} + ++ (instancetype)ly_colorWithHexString:(NSString *)hex alpha:(CGFloat)alpha { + NSString *cString = [[hex stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; + + // String should be 6 or 8 characters + if ([cString length] < 6) { + return [UIColor clearColor]; + } + // strip 0X if it appears + if ([cString hasPrefix:@"0X"] || [cString hasPrefix:@"0x"]) { + cString = [cString substringFromIndex:2]; + } + if ([cString hasPrefix:@"#"]) { + cString = [cString substringFromIndex:1]; + } + if ([cString length] != 6) { + return [UIColor clearColor]; + } + // Separate into r, g, b substrings + NSRange range; + range.location = 0; + range.length = 2; + NSString *rString = [cString substringWithRange:range]; + + range.location = 2; + NSString *gString = [cString substringWithRange:range]; + + range.location = 4; + NSString *bString = [cString substringWithRange:range]; + + // Scan values + unsigned int r, g, b; + [[NSScanner scannerWithString:rString] scanHexInt:&r]; + [[NSScanner scannerWithString:gString] scanHexInt:&g]; + [[NSScanner scannerWithString:bString] scanHexInt:&b]; + + return [UIColor colorWithRed:((CGFloat) r / 255.0f) + green:((CGFloat) g / 255.0f) + blue:((CGFloat) b / 255.0f) + alpha:alpha]; + +} + +@end diff --git a/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.h b/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.h new file mode 100644 index 0000000..c37ef05 --- /dev/null +++ b/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.h @@ -0,0 +1,50 @@ +// +// UIDevice+LYHardware.h +// LYUI +// +// Created by 吴浪 on 2018/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, LYNetworkType) { + LYNetworkTypeUnknown, + LYNetworkTypeNoNetwork, + LYNetworkTypeWiFi, + LYNetworkTypeWWAN,/**< 通过GPRS连接 */ + LYNetworkTypeWWAN2G, + LYNetworkTypeWWANGPRS, + LYNetworkTypeWWANEDGE,/**< 2.75G EDGE */ + LYNetworkTypeWWAN3G, + LYNetworkTypeWWANHSDPA,/**< 3.5G HSDPA */ + LYNetworkTypeWWANHSUPA,/**< 3.5G HSUPA */ + LYNetworkTypeWWANHRPD,/**< 3.75G HRPD */ + LYNetworkTypeWWAN4G, +}; + +@interface UIDevice (LYHardware) + +/** Hardware type */ ++ (NSString *)ly_hwMchine; +/** ‘刘海’屏幕 */ ++ (BOOL)ly_hasFringeScreen; + ++ (NSUInteger)ly_cpuFrequency; ++ (NSUInteger)ly_busFrequency; ++ (NSUInteger)ly_cpuCount; ++ (NSUInteger)ly_totalMemory; ++ (NSUInteger)ly_userMemory; ++ (NSUInteger)ly_maxSocketBufferSize; + ++ (NSUInteger)ly_totalDiskSpace; ++ (NSUInteger)ly_freeDiskSpace; + ++ (NSString *)ly_macAddress; + ++ (LYNetworkType)ly_networkType; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.m b/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.m new file mode 100644 index 0000000..3319ac7 --- /dev/null +++ b/LYToolsKit/UI/UI/UIDevice/UIDevice+LYHardware.m @@ -0,0 +1,167 @@ +// +// UIDevice+LYHardware.m +// LYUI +// +// Created by 吴浪 on 2018/11/9. +// + +#import "UIDevice+LYHardware.h" +#import "LYReachability.h" +#import +#import +#include +#include +@import CoreTelephony; + +@implementation UIDevice (LYHardware) + ++ (NSString *)ly_hwMchine { + struct utsname systemInfo; + uname(&systemInfo); + return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; +} + ++ (BOOL)ly_hasFringeScreen { + if (@available(iOS 11.0, *)) { + return !UIEdgeInsetsEqualToEdgeInsets([[UIApplication sharedApplication].windows.firstObject safeAreaInsets], UIEdgeInsetsZero); + } else { + return NO; + } +} + + ++ (NSUInteger)ly_sysInfo:(uint)typeSpecific { + size_t size = sizeof(int); + int result; + int mib[2] = {CTL_HW, typeSpecific}; + sysctl(mib, 2, &result, &size, NULL, 0); + return (NSUInteger)result; +} + ++ (NSUInteger)ly_cpuFrequency { + return [self ly_sysInfo:HW_CPU_FREQ]; +} + ++ (NSUInteger)ly_busFrequency { + return [self ly_sysInfo:HW_BUS_FREQ]; +} + ++ (NSUInteger)ly_cpuCount { + return [self ly_sysInfo:HW_NCPU]; +} + ++ (NSUInteger)ly_totalMemory { + return [self ly_sysInfo:HW_PHYSMEM]; +} + ++ (NSUInteger)ly_userMemory { + return [self ly_sysInfo:HW_USERMEM]; + +} + ++ (NSUInteger)ly_maxSocketBufferSize { + return [self ly_sysInfo:KIPC_MAXSOCKBUF]; +} + + ++ (NSUInteger)ly_totalDiskSpace { + NSDictionary *fAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:NULL]; + return [[fAttributes objectForKey:NSFileSystemSize] unsignedIntegerValue]; +} + ++ (NSUInteger)ly_freeDiskSpace { + NSDictionary *fAttributes = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:NULL]; + return [[fAttributes objectForKey:NSFileSystemFreeSize] unsignedIntegerValue]; +} + + ++ (NSString *)ly_macAddress { + int mib[6]; + size_t len; + char *buf; + unsigned char *ptr; + struct if_msghdr *ifm; + struct sockaddr_dl *sdl; + + mib[0] = CTL_NET; + mib[1] = AF_ROUTE; + mib[2] = 0; + mib[3] = AF_LINK; + mib[4] = NET_RT_IFLIST; + + if ((mib[5] = if_nametoindex("en0")) == 0) { + printf("Error: if_nametoindex error\n"); + return NULL; + } + + if (sysctl(mib, 6, NULL, &len, NULL, 0) < 0) { + printf("Error: sysctl, take 1\n"); + return NULL; + } + + if ((buf = malloc(len)) == NULL) { + printf("Error: Memory allocation error\n"); + return NULL; + } + + if (sysctl(mib, 6, buf, &len, NULL, 0) < 0) { + printf("Error: sysctl, take 2\n"); + free(buf); // Thanks, Remy "Psy" Demerest + return NULL; + } + + ifm = (struct if_msghdr *)buf; + sdl = (struct sockaddr_dl *)(ifm + 1); + ptr = (unsigned char *)LLADDR(sdl); + NSString *outstring = [NSString stringWithFormat:@"%02X:%02X:%02X:%02X:%02X:%02X", *ptr, *(ptr+1), *(ptr+2), *(ptr+3), *(ptr+4), *(ptr+5)]; + + free(buf); + return outstring; +} + ++ (LYNetworkType)ly_networkType { + LYNetworkType networkType; + LYReachability *reach = [LYReachability reachabilityWithHostName:@"www.apple.com"]; + switch ([reach currentReachabilityStatus]) { + case LYNetworkStatusNotReachable: + networkType = LYNetworkTypeNoNetwork; + break; + case LYNetworkStatusReachableViaWiFi: + networkType = LYNetworkTypeWiFi; + break; + case LYNetworkStatusReachableViaWWAN: + { + CTTelephonyNetworkInfo *info = [[CTTelephonyNetworkInfo alloc] init]; + NSString *currentStatus = info.currentRadioAccessTechnology; + if ([currentStatus isEqualToString:CTRadioAccessTechnologyGPRS]) { + networkType = LYNetworkTypeWWANGPRS; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyEdge]) { + networkType = LYNetworkTypeWWANEDGE; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyWCDMA] || + [currentStatus isEqualToString:CTRadioAccessTechnologyCDMAEVDORev0] || + [currentStatus isEqualToString:CTRadioAccessTechnologyCDMAEVDORevA] || + [currentStatus isEqualToString:CTRadioAccessTechnologyCDMAEVDORevB]) { + networkType = LYNetworkTypeWWAN3G; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyHSDPA]) { + networkType = LYNetworkTypeWWANHSDPA; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyHSUPA]) { + networkType = LYNetworkTypeWWANHSUPA; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyCDMA1x]) { + networkType = LYNetworkTypeWWAN2G; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyeHRPD]) { + networkType = LYNetworkTypeWWANHRPD; + } else if ([currentStatus isEqualToString:CTRadioAccessTechnologyLTE]) { + networkType = LYNetworkTypeWWAN4G; + } else { + networkType = LYNetworkTypeWWAN; + } + } + break; + default: + networkType = LYNetworkTypeUnknown; + break; + } + return networkType; +} + +@end diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.h b/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.h new file mode 100644 index 0000000..ca06e24 --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.h @@ -0,0 +1,24 @@ +// +// UIImage+LYBase64.h +// LYUI +// +// Created by 吴浪 on 16/5/6. +// Copyright © 2016年 dingli. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImage (LYBase64) + +/** 通过base64字符串创建一张图片(同步获取) */ ++ (nullable instancetype)ly_imageWithBase64:(NSString *)base64; +/** 通过base64字符串创建一张图片(异步获取) */ ++ (void)ly_imageWithBase64:(NSString *)base64 completion:(void (^)(UIImage * _Nullable image))completion; +/** 图片转化为base64字符串 */ +- (nullable NSString *)ly_base64; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.m b/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.m new file mode 100644 index 0000000..d5299ff --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYBase64.m @@ -0,0 +1,43 @@ +// +// UIImage+LYBase64.m +// LYUI +// +// Created by 吴浪 on 16/5/6. +// Copyright © 2016年 dingli. All rights reserved. +// + +#import "UIImage+LYBase64.h" + +@implementation UIImage (LYBase64) + ++ (instancetype)ly_imageWithBase64:(NSString *)base64 { + UIImage *image = nil; + if (base64.length) { + NSData *decodeImageData = [[NSData alloc] initWithBase64EncodedString:base64 options:NSDataBase64DecodingIgnoreUnknownCharacters]; + if (decodeImageData) { + image = [self imageWithData:decodeImageData]; + } + }else { + NSLog(@"base64字符串为空"); + } + return image; +} + ++ (void)ly_imageWithBase64:(NSString *)base64 completion:(void (^)(UIImage * _Nullable))completion { + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + UIImage *image = [self ly_imageWithBase64:base64]; + if (completion) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(image); + }); + } + }); +} + +- (NSString *)ly_base64 { + NSData *data = UIImageJPEGRepresentation(self, 1.0f); + NSString *encodeImageStr = [data base64EncodedStringWithOptions:0]; + return encodeImageStr; +} + +@end diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.h b/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.h new file mode 100644 index 0000000..1aa852a --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.h @@ -0,0 +1,52 @@ +// +// UIImage+LYImage.h +// LYUI +// +// Created by 吴浪 on 2018/11/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSUInteger, LYImageWaterPlace) { + LYImageWaterPlaceCenter, + LYImageWaterPlaceLeftTop, + LYImageWaterPlaceLeftBottom, + LYImageWaterPlaceRightTop, + LYImageWaterPlaceRightBottom, +}; +@interface UIImage (LYImage) + +/** + 图片打水印 + + @param logoImage logoImage 水印标识 + @param place place 水印位置 + @param scale scale 水印放缩大小 + @param margin margin 水印距离边缘值 + @return return value 有水印的图片 + */ +- (instancetype)ly_waterImageWithLogoImage:(UIImage *)logoImage + logoPlace:(LYImageWaterPlace)place + logoScale:(CGFloat)scale + logoMargin:(CGFloat)margin; +/** 获取图片的主色调 */ +- (UIColor *)ly_mostColor; +/** 获取App启动图片 */ ++ (instancetype)ly_theLaunchImage; + +@end + + +@interface UIImage (LYQRCode) + +/** 识别二维码 */ +- (NSString *)ly_readQRCode; + +/** 生成二维码 */ ++ (instancetype)ly_QRCodeWithString:(NSString *)string; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.m b/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.m new file mode 100644 index 0000000..10bab6a --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYImage.m @@ -0,0 +1,166 @@ +// +// UIImage+LYImage.m +// LYUI +// +// Created by 吴浪 on 2018/11/9. +// + +#import "UIImage+LYImage.h" + +@implementation UIImage (LYImage) + +- (instancetype)ly_waterImageWithLogoImage:(UIImage *)logoImage logoPlace:(LYImageWaterPlace)place logoScale:(CGFloat)scale logoMargin:(CGFloat)margin { + //创建一个基于位图的上下文 + UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0); + //背景 + [self drawInRect:CGRectMake(0, 0, self.size.width, self.size.height)]; + //绘制水印 + CGFloat logoW = logoImage.size.width * (scale ?: 1); + CGFloat logoH = logoImage.size.height * (scale ?: 1); + CGFloat logoX, logoY; + switch (place) { + case LYImageWaterPlaceCenter: + logoX = (self.size.width - logoW) * 0.5; + logoY = (self.size.height - logoH) * 0.5; + break; + case LYImageWaterPlaceLeftTop: + logoX = margin; + logoY = margin; + break; + case LYImageWaterPlaceLeftBottom: + logoX = margin; + logoY = self.size.height - logoH - margin; + break; + case LYImageWaterPlaceRightTop: + logoX = self.size.width - logoW - margin; + logoY = margin; + break; + case LYImageWaterPlaceRightBottom: + default: + logoX = self.size.width - logoW - margin; + logoY = self.size.height - logoH - margin; + break; + } + [logoImage drawInRect:CGRectMake(logoX, logoY, logoW, logoH)]; + //取得位图图形上下中的图片 + UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); + //结束上下文 + UIGraphicsEndImageContext(); + + return newImage; +} + +- (UIColor *)ly_mostColor { + int bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast; + //缩小图片,加快计算速度, 但越小误差越大 + CGSize thumbSize = CGSizeMake(50.0, 50.0); + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef context = CGBitmapContextCreate(NULL, thumbSize.width, thumbSize.height, 8, thumbSize.width * 4, colorSpace, bitmapInfo); + CGRect drawRect = CGRectMake(0, 0, thumbSize.width, thumbSize.height); + CGContextDrawImage(context, drawRect, self.CGImage); + CGColorSpaceRelease(colorSpace); + //取每个点的像素值 + unsigned char *data = CGBitmapContextGetData(context); + if (data == NULL) { + return nil; + } + NSCountedSet *cls = [NSCountedSet setWithCapacity:thumbSize.width * thumbSize.height]; + for (int x = 0; x < thumbSize.width; x++) { + for (int y = 0; y< thumbSize.height; y++) { + int offset = 4 * (x * y); + + int red = data[offset]; + int green = data[offset + 1]; + int blue = data[offset + 2]; + int alpha = data[offset + 3]; + + NSArray *clr = @[@(red), @(green), @(blue), @(alpha)]; + [cls addObject:clr]; + } + } + CGContextRelease(context); + + __block NSArray *maxColor = nil; + __block NSUInteger maxCount = 0; + //找到出现次数最多的那个颜色 + [cls enumerateObjectsUsingBlock:^(id _Nonnull obj, BOOL * _Nonnull stop) { + NSUInteger tmpCount = [cls countForObject:obj]; + if (tmpCount > maxCount) { + maxCount = tmpCount; + maxColor = obj; + } + }]; + + if (!maxColor) { + return nil; + } + + return [UIColor colorWithRed:[maxColor[0] intValue] / 255.0 green:[maxColor[1] intValue] / 255.0 blue:[maxColor[2] intValue] / 255.0 alpha:[maxColor[3] intValue] / 255.0]; +} + ++ (NSString *)ly_theLaunchImageName { + CGSize viewSize = [UIScreen mainScreen].bounds.size; + NSString *viewOrientation; + if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortraitUpsideDown || [UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationPortrait) { + viewOrientation = @"Portrait"; + } else { + viewOrientation = @"Landscape"; + } + __block NSString *launchImage = nil; + NSArray *imagesDict = [[NSBundle mainBundle] infoDictionary][@"UILaunchImages"]; + [imagesDict enumerateObjectsUsingBlock:^(NSDictionary * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { + CGSize imageSize = CGSizeFromString(obj[@"UILaunchImageSize"]); + if (CGSizeEqualToSize(imageSize, viewSize) && [viewOrientation isEqualToString:obj[@"UILaunchImageOrientation"]]) { + launchImage = obj[@"UILaunchImageName"]; + *stop = YES; + } + }]; + + return launchImage; +} + ++ (instancetype)ly_theLaunchImage { + NSString *imageName = [self ly_theLaunchImageName]; + UIImage *image; + if (imageName) { + image = [UIImage imageNamed:imageName]; + } else { + image = nil; + } + return image; +} + +@end + + +@implementation UIImage (LYQRCode) + +- (NSString *)ly_readQRCode { + CIContext *context = [CIContext contextWithOptions:nil]; + CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:context options:@{CIDetectorAccuracy:CIDetectorAccuracyHigh}]; + NSArray *features = [detector featuresInImage:self.CIImage]; + + NSString *result; + if (features.count) { + CIQRCodeFeature *feature = [features firstObject]; + result = feature.messageString; + } else { + result = nil; + } + return result; +} + ++ (instancetype)ly_QRCodeWithString:(NSString *)string { + CIFilter *filter = [CIFilter filterWithName:@"CIQRCodeGenerator"]; + [filter setDefaults]; + + NSData *data = [string?:@"" dataUsingEncoding:NSUTF8StringEncoding]; + [filter setValue:data forKey:@"inputMessage"]; + CIImage *image = [filter outputImage]; + CGAffineTransform transform = CGAffineTransformMakeScale(5.0f, 5.0f); + image = [image imageByApplyingTransform: transform]; + UIImage *newImage = [UIImage imageWithCIImage:image scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp]; + return newImage; +} + +@end diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.h b/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.h new file mode 100644 index 0000000..a51b439 --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.h @@ -0,0 +1,137 @@ +// +// UIImage+LYResize.h +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImage (LYAlpha) + +/** 图像是否有 alpha 通道 */ +- (BOOL)ly_hasAlpha; +/** 返回给定图像的副本, 如果图像没有alpha通道, 则添加alpha通道 */ +- (instancetype)ly_imageWithAlpha; +/** + 透明边框图像 + + @param borderSize 边框大小 + @return 图像 + */ +- (instancetype)ly_transparentBorderImage:(NSUInteger)borderSize; + +@end + + +@interface UIImage (LYResize) + +/** 裁剪 */ +- (instancetype)ly_croppedImage:(CGRect)bounds; +/** + 缩略图, 图片 wdith = thumbnailSize + borderSize * 2 + + @param thumbnailSize 缩略图图像 + @param borderSize 透明边框 + @param cornerRadius 圆角 + @param quality 质量 + @return 图片 + */ +- (instancetype)ly_thumbnailImage:(NSInteger)thumbnailSize + transparentBorder:(NSUInteger)borderSize + cornerRadius:(NSUInteger)cornerRadius + interpolationQuality:(CGInterpolationQuality)quality; +/** + 调整图像大小 + + @param newSize newSize 新的大小 + @param quality quality 质量 + @return 新的图像 + */ +- (instancetype)ly_resizedImage:(CGSize)newSize + interpolationQuality:(CGInterpolationQuality)quality; +/** + 调整图像大小 + + @param contentMode contentMode 图像内容模式 + @param size size 图像大小 + @param quality quality 质量 + @return return value 新的图像 + */ +- (instancetype)ly_resizedImageWithContentMode:(UIViewContentMode)contentMode + size:(CGSize)size + interpolationQuality:(CGInterpolationQuality)quality; +/** + 调整图像宽、高在指定范围内 + + @param imgLength imgLength 范围数值 + @return return value 新图像 + */ +- (instancetype)ly_scaleImageWithImgLength:(CGFloat)imgLength; + +/** 修复图像方向 */ +- (instancetype)ly_fixOrientation; + +@end + + +@interface UIImage (LYRoundedCorner) + +/** + 裁剪图像 + + @param cornerSize cornerSize 圆角 + @param borderSize borderSize 边框 + @return return value 图像 + */ +- (instancetype)ly_roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize; + +@end + + +typedef NS_ENUM(NSUInteger, LYStretchableImageStyle) { + LYStretchableImageStyleCenter, + LYStretchableImageStyleLeftTop, + LYStretchableImageStyleLeftBottom, + LYStretchableImageStyleRightTop, + LYStretchableImageStyleRightBottom, +}; + +@interface UIImage (LYStretchable) + +/** 返回一张可自由拉伸的图片,以中心点为扩展点 */ +- (instancetype)ly_stretchableImageByStyle:(LYStretchableImageStyle)style; + +@end + + +@interface UIImage (LYCompress) + +/** 压缩图片到指定字节范围 */ +- (NSData *)ly_compressImageToByte:(NSInteger)maxLength; + +@end + + +@interface UIImage (LYTintColor) + +/** + 纯色图片改变颜色 + + @param color 颜色 + @return image + */ +- (instancetype)ly_imagePureChangeColor:(UIColor *)color; +/** + 非纯色图片改变颜色 + + @param color 颜色 + @return image + */ +- (instancetype)ly_imageGradientChangeColor:(UIColor *)color; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.m b/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.m new file mode 100644 index 0000000..e8ff3b6 --- /dev/null +++ b/LYToolsKit/UI/UI/UIImage/UIImage+LYResize.m @@ -0,0 +1,614 @@ +// +// UIImage+LYResize.m +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import "UIImage+LYResize.h" + +@implementation UIImage (LYAlpha) + +// Returns true if the image has an alpha layer +- (BOOL)ly_hasAlpha { + CGImageAlphaInfo alpha = CGImageGetAlphaInfo(self.CGImage); + return (alpha == kCGImageAlphaFirst || + alpha == kCGImageAlphaLast || + alpha == kCGImageAlphaPremultipliedFirst || + alpha == kCGImageAlphaPremultipliedLast); +} + +// Returns a copy of the given image, adding an alpha channel if it doesn't already have one +- (instancetype)ly_imageWithAlpha { + if ([self ly_hasAlpha]) { + return self; + } + + CGFloat scale = MAX(self.scale, 1.0f); + CGImageRef imageRef = self.CGImage; + size_t width = CGImageGetWidth(imageRef)*scale; + size_t height = CGImageGetHeight(imageRef)*scale; + + // The bitsPerComponent and bitmapInfo values are hard-coded to prevent an "unsupported parameter combination" error + CGContextRef offscreenContext = CGBitmapContextCreate(NULL, + width, + height, + 8, + 0, + CGImageGetColorSpace(imageRef), + kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); + + // Draw the image into the context and retrieve the new image, which will now have an alpha layer + CGContextDrawImage(offscreenContext, CGRectMake(0, 0, width, height), imageRef); + CGImageRef imageRefWithAlpha = CGBitmapContextCreateImage(offscreenContext); + UIImage *imageWithAlpha = [UIImage imageWithCGImage:imageRefWithAlpha scale:self.scale orientation:UIImageOrientationUp]; + + // Clean up + CGContextRelease(offscreenContext); + CGImageRelease(imageRefWithAlpha); + + return imageWithAlpha; +} + +// Returns a copy of the image with a transparent border of the given size added around its edges. +// If the image has no alpha layer, one will be added to it. +- (instancetype)ly_transparentBorderImage:(NSUInteger)borderSize { + // If the image does not have an alpha layer, add one + UIImage *image = [self ly_imageWithAlpha]; + CGFloat scale = MAX(self.scale, 1.0f); + NSUInteger scaledBorderSize = borderSize * scale; + CGRect newRect = CGRectMake(0, 0, image.size.width * scale + scaledBorderSize * 2, image.size.height * scale + scaledBorderSize * 2); + + // Build a context that's the same dimensions as the new size + CGContextRef bitmap = CGBitmapContextCreate(NULL, + newRect.size.width, + newRect.size.height, + CGImageGetBitsPerComponent(self.CGImage), + 0, + CGImageGetColorSpace(self.CGImage), + CGImageGetBitmapInfo(self.CGImage)); + + // Draw the image in the center of the context, leaving a gap around the edges + CGRect imageLocation = CGRectMake(scaledBorderSize, scaledBorderSize, image.size.width*scale, image.size.height*scale); + CGContextDrawImage(bitmap, imageLocation, self.CGImage); + CGImageRef borderImageRef = CGBitmapContextCreateImage(bitmap); + + // Create a mask to make the border transparent, and combine it with the image + CGImageRef maskImageRef = [self ly_newBorderMask:scaledBorderSize size:newRect.size].CGImage; + CGImageRef transparentBorderImageRef = CGImageCreateWithMask(borderImageRef, maskImageRef); + UIImage *transparentBorderImage = [UIImage imageWithCGImage:transparentBorderImageRef scale:self.scale orientation:UIImageOrientationUp]; + + // Clean up + CGContextRelease(bitmap); + CGImageRelease(borderImageRef); + CGImageRelease(transparentBorderImageRef); + + return transparentBorderImage; +} + +// Creates a mask that makes the outer edges transparent and everything else opaque +// The size must include the entire mask (opaque part + transparent border) +// The caller is responsible for releasing the returned reference by calling CGImageRelease +- (instancetype)ly_newBorderMask:(NSUInteger)borderSize size:(CGSize)size { + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceGray(); + + // Build a context that's the same dimensions as the new size + CGContextRef maskContext = CGBitmapContextCreate(NULL, + size.width, + size.height, + 8, // 8-bit grayscale + 0, + colorSpace, + kCGBitmapByteOrderDefault | kCGImageAlphaNone); + + // Start with a mask that's entirely transparent + CGContextSetFillColorWithColor(maskContext, [UIColor colorWithWhite:0 alpha:1].CGColor); + CGContextFillRect(maskContext, CGRectMake(0, 0, size.width, size.height)); + + // Make the inner part (within the border) opaque + CGContextSetFillColorWithColor(maskContext, [UIColor colorWithWhite:1 alpha:1].CGColor); + CGContextFillRect(maskContext, CGRectMake(borderSize, borderSize, size.width - borderSize * 2, size.height - borderSize * 2)); + + // Get an image of the context + CGImageRef maskImageRef = CGBitmapContextCreateImage(maskContext); + + // Clean up + CGContextRelease(maskContext); + CGColorSpaceRelease(colorSpace); + + UIImage *maskImage = [UIImage imageWithCGImage:maskImageRef]; + CGImageRelease(maskImageRef); + return maskImage; +} + +@end + +@implementation UIImage (LYResize) + +- (instancetype)ly_croppedImage:(CGRect)bounds { + CGFloat scale = MAX(self.scale, 1.0f); + CGRect scaledBounds = CGRectMake(bounds.origin.x * scale, bounds.origin.y * scale, bounds.size.width * scale, bounds.size.height * scale); + CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], scaledBounds); + UIImage *croppedImage = [UIImage imageWithCGImage:imageRef scale:self.scale orientation:UIImageOrientationUp]; + CGImageRelease(imageRef); + return croppedImage; +} + +// Returns a copy of this image that is squared to the thumbnail size. +// If transparentBorder is non-zero, a transparent border of the given size will be added around the edges of the thumbnail. (Adding a transparent border of at least one pixel in size has the side-effect of antialiasing the edges of the image when rotating it using Core Animation.) +- (instancetype)ly_thumbnailImage:(NSInteger)thumbnailSize + transparentBorder:(NSUInteger)borderSize + cornerRadius:(NSUInteger)cornerRadius + interpolationQuality:(CGInterpolationQuality)quality { + UIImage *resizedImage = [self ly_resizedImageWithContentMode:UIViewContentModeScaleAspectFill + size:CGSizeMake(thumbnailSize, thumbnailSize) + interpolationQuality:quality]; + + + // Crop out any part of the image that's larger than the thumbnail size + // The cropped rect must be centered on the resized image + // Round the origin points so that the size isn't altered when CGRectIntegral is later invoked + CGRect cropRect = CGRectMake(round((resizedImage.size.width - thumbnailSize) * 0.5), + round((resizedImage.size.height - thumbnailSize) * 0.5), + thumbnailSize, + thumbnailSize); + UIImage *croppedImage = [resizedImage ly_croppedImage:cropRect]; + + UIImage *transparentBorderImage = borderSize ? [croppedImage ly_transparentBorderImage:borderSize] : croppedImage; + + return [transparentBorderImage ly_roundedCornerImage:cornerRadius borderSize:borderSize]; +} + +// Returns a rescaled copy of the image, taking into account its orientation +// The image will be scaled disproportionately if necessary to fit the bounds specified by the parameter +- (instancetype)ly_resizedImage:(CGSize)newSize interpolationQuality:(CGInterpolationQuality)quality { + BOOL drawTransposed; + switch (self.imageOrientation) + { + case UIImageOrientationLeft: + case UIImageOrientationLeftMirrored: + case UIImageOrientationRight: + case UIImageOrientationRightMirrored: + drawTransposed = YES; + break; + default: + drawTransposed = NO; + } + + CGAffineTransform transform = [self ly_transformForOrientation:newSize]; + + return [self ly_resizedImage:newSize transform:transform drawTransposed:drawTransposed interpolationQuality:quality]; +} + +// Resizes the image according to the given content mode, taking into account the image's orientation +- (instancetype)ly_resizedImageWithContentMode:(UIViewContentMode)contentMode + size:(CGSize)size + interpolationQuality:(CGInterpolationQuality)quality { + CGFloat horizontalRatio = size.width / self.size.width; + CGFloat verticalRatio = size.height / self.size.height; + CGFloat ratio; + + switch (contentMode) { + case UIViewContentModeScaleAspectFill: + ratio = MAX(horizontalRatio, verticalRatio); + break; + + case UIViewContentModeScaleAspectFit: + ratio = MIN(horizontalRatio, verticalRatio); + break; + + default: + return self; + } + CGSize newSize = CGSizeMake(self.size.width * ratio, self.size.height * ratio); + + return [self ly_resizedImage:newSize interpolationQuality:quality]; +} + +#pragma mark - +#pragma mark Private helper methods +// Returns a copy of the image that has been transformed using the given affine transform and scaled to the new size +// The new image's orientation will be UIImageOrientationUp, regardless of the current image's orientation +// If the new size is not integral, it will be rounded up +- (instancetype)ly_resizedImage:(CGSize)newSize + transform:(CGAffineTransform)transform + drawTransposed:(BOOL)transpose + interpolationQuality:(CGInterpolationQuality)quality { + CGFloat scale = MAX(1.0f, self.scale); + CGRect newRect = CGRectIntegral(CGRectMake(0.0, 0.0, newSize.width * scale, newSize.height * scale)); + CGRect transposedRect = CGRectMake(0.0, 0.0, newRect.size.height, newRect.size.width); + CGImageRef imageRef = self.CGImage; + + // Fix for a colorspace / transparency issue that affects some types of + // images. See here: http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/comment-page-2/#comment-39951 + + CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); + CGContextRef bitmap = CGBitmapContextCreate( + NULL, + newRect.size.width, + newRect.size.height, + 8, /* bits per channel */ + (newRect.size.width * 4), /* 4 channels per pixel * numPixels/row */ + colorSpace, + 1 + ); + CGColorSpaceRelease(colorSpace); + + // Rotate and/or flip the image if required by its orientation + CGContextConcatCTM(bitmap, transform); + + // Set the quality level to use when rescaling + CGContextSetInterpolationQuality(bitmap, quality); + + // Draw into the context; this scales the image + CGContextDrawImage(bitmap, transpose ? transposedRect : newRect, imageRef); + + // Get the resized image from the context and a UIImage + CGImageRef newImageRef = CGBitmapContextCreateImage(bitmap); + UIImage *newImage = [UIImage imageWithCGImage:newImageRef scale:self.scale orientation:UIImageOrientationUp]; + + // Clean up + CGContextRelease(bitmap); + CGImageRelease(newImageRef); + + return newImage; +} + +- (instancetype)ly_fixOrientation { + CGImageRef imgRef = self.CGImage; + + CGFloat width = CGImageGetWidth(imgRef); + CGFloat height = CGImageGetHeight(imgRef); + + CGAffineTransform transform = CGAffineTransformIdentity; + CGRect bounds = CGRectMake(0, 0, width, height); + + CGFloat scaleRatio = bounds.size.width / width; + CGSize imageSize = CGSizeMake(CGImageGetWidth(imgRef), CGImageGetHeight(imgRef)); + CGFloat boundHeight; + UIImageOrientation orient = self.imageOrientation; + switch(orient) { + + case UIImageOrientationUp: //EXIF = 1 + transform = CGAffineTransformIdentity; + break; + + case UIImageOrientationUpMirrored: //EXIF = 2 + transform = CGAffineTransformMakeTranslation(imageSize.width, 0.0); + transform = CGAffineTransformScale(transform, -1.0, 1.0); + break; + + case UIImageOrientationDown: //EXIF = 3 + transform = CGAffineTransformMakeTranslation(imageSize.width, imageSize.height); + transform = CGAffineTransformRotate(transform, M_PI); + break; + + case UIImageOrientationDownMirrored: //EXIF = 4 + transform = CGAffineTransformMakeTranslation(0.0, imageSize.height); + transform = CGAffineTransformScale(transform, 1.0, -1.0); + break; + + case UIImageOrientationLeftMirrored: //EXIF = 5 + boundHeight = bounds.size.height; + bounds.size.height = bounds.size.width; + bounds.size.width = boundHeight; + transform = CGAffineTransformMakeTranslation(imageSize.height, imageSize.width); + transform = CGAffineTransformScale(transform, -1.0, 1.0); + transform = CGAffineTransformRotate(transform, 3.0 * M_PI / 2.0); + break; + + case UIImageOrientationLeft: //EXIF = 6 + boundHeight = bounds.size.height; + bounds.size.height = bounds.size.width; + bounds.size.width = boundHeight; + transform = CGAffineTransformMakeTranslation(0.0, imageSize.width); + transform = CGAffineTransformRotate(transform, 3.0 * M_PI / 2.0); + break; + + case UIImageOrientationRightMirrored: //EXIF = 7 + boundHeight = bounds.size.height; + bounds.size.height = bounds.size.width; + bounds.size.width = boundHeight; + transform = CGAffineTransformMakeScale(-1.0, 1.0); + transform = CGAffineTransformRotate(transform, M_PI / 2.0); + break; + + case UIImageOrientationRight: //EXIF = 8 + boundHeight = bounds.size.height; + bounds.size.height = bounds.size.width; + bounds.size.width = boundHeight; + transform = CGAffineTransformMakeTranslation(imageSize.height, 0.0); + transform = CGAffineTransformRotate(transform, M_PI / 2.0); + break; + + default: + return nil; + + } + + UIGraphicsBeginImageContext(bounds.size); + + CGContextRef context = UIGraphicsGetCurrentContext(); + + if (orient == UIImageOrientationRight || orient == UIImageOrientationLeft) { + CGContextScaleCTM(context, -scaleRatio, scaleRatio); + CGContextTranslateCTM(context, -height, 0); + } + else { + CGContextScaleCTM(context, scaleRatio, -scaleRatio); + CGContextTranslateCTM(context, 0, -height); + } + + CGContextConcatCTM(context, transform); + + CGContextDrawImage(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, width, height), imgRef); + UIImage *imageCopy = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + return imageCopy; +} + +// Returns an affine transform that takes into account the image orientation when drawing a scaled image +- (CGAffineTransform)ly_transformForOrientation:(CGSize)newSize { + CGAffineTransform transform = CGAffineTransformIdentity; + + switch (self.imageOrientation) { + case UIImageOrientationDown: // EXIF = 3 + case UIImageOrientationDownMirrored: // EXIF = 4 + transform = CGAffineTransformTranslate(transform, newSize.width, newSize.height); + transform = CGAffineTransformRotate(transform, M_PI); + break; + + case UIImageOrientationLeft: // EXIF = 6 + case UIImageOrientationLeftMirrored: // EXIF = 5 + transform = CGAffineTransformTranslate(transform, newSize.width, 0); + transform = CGAffineTransformRotate(transform, M_PI_2); + break; + + case UIImageOrientationRight: // EXIF = 8 + case UIImageOrientationRightMirrored: // EXIF = 7 + transform = CGAffineTransformTranslate(transform, 0, newSize.height); + transform = CGAffineTransformRotate(transform, -M_PI_2); + break; + default: + break; + } + + switch (self.imageOrientation) { + case UIImageOrientationUpMirrored: // EXIF = 2 + case UIImageOrientationDownMirrored: // EXIF = 4 + transform = CGAffineTransformTranslate(transform, newSize.width, 0); + transform = CGAffineTransformScale(transform, -1, 1); + break; + + case UIImageOrientationLeftMirrored: // EXIF = 5 + case UIImageOrientationRightMirrored: // EXIF = 7 + transform = CGAffineTransformTranslate(transform, newSize.height, 0); + transform = CGAffineTransformScale(transform, -1, 1); + break; + default: + break; + } + + return transform; +} + +/** 返回一张该图片宽、高都在imgLength范围内的新图片 */ +- (instancetype)ly_scaleImageWithImgLength:(CGFloat)imgLength { + CGFloat newWidth = 0.0f; + CGFloat newHeight = 0.0f; + CGFloat width = self.size.width; + CGFloat height = self.size.height; + + if (width > imgLength || height > imgLength){ + if (width > height) { + newWidth = imgLength; + newHeight = newWidth * height / width; + }else if(height > width){ + newHeight = imgLength; + newWidth = newHeight * width / height; + }else{ + newWidth = imgLength; + newHeight = imgLength; + } + }else { + return self; + } + + return [self ly_resizedImage:CGSizeMake(newWidth, newHeight) interpolationQuality:kCGInterpolationDefault]; +} + +@end + +@implementation UIImage (LYRoundedCorner) + +// Creates a copy of this image with rounded corners +// If borderSize is non-zero, a transparent border of the given size will also be added +// Original author: Björn Sållarp. Used with permission. See: http://blog.sallarp.com/iphone-uiimage-round-corners/ +- (instancetype)ly_roundedCornerImage:(NSInteger)cornerSize borderSize:(NSInteger)borderSize { + // If the image does not have an alpha layer, add one + UIImage *image = [self ly_imageWithAlpha]; + + CGFloat scale = MAX(self.scale,1.0f); + NSUInteger scaledBorderSize = borderSize * scale; + + // Build a context that's the same dimensions as the new size + CGContextRef context = CGBitmapContextCreate(NULL, + image.size.width*scale, + image.size.height*scale, + CGImageGetBitsPerComponent(image.CGImage), + 0, + CGImageGetColorSpace(image.CGImage), + CGImageGetBitmapInfo(image.CGImage)); + + // Create a clipping path with rounded corners + + CGContextBeginPath(context); + [self ly_addRoundedRectToPath:CGRectMake(scaledBorderSize, scaledBorderSize, image.size.width*scale - scaledBorderSize * 2, image.size.height*scale - scaledBorderSize * 2) + context:context + ovalWidth:cornerSize*scale + ovalHeight:cornerSize*scale]; + CGContextClosePath(context); + CGContextClip(context); + + // Draw the image to the context; the clipping path will make anything outside the rounded rect transparent + CGContextDrawImage(context, CGRectMake(0, 0, image.size.width*scale, image.size.height*scale), image.CGImage); + + // Create a CGImage from the context + CGImageRef clippedImage = CGBitmapContextCreateImage(context); + CGContextRelease(context); + + // Create a UIImage from the CGImage + UIImage *roundedImage = [UIImage imageWithCGImage:clippedImage scale:self.scale orientation:UIImageOrientationUp]; + + CGImageRelease(clippedImage); + + return roundedImage; +} + +#pragma mark - +#pragma mark Private helper methods + +// Adds a rectangular path to the given context and rounds its corners by the given extents +// Original author: Björn Sållarp. Used with permission. See: http://blog.sallarp.com/iphone-uiimage-round-corners/ +- (void)ly_addRoundedRectToPath:(CGRect)rect context:(CGContextRef)context ovalWidth:(CGFloat)ovalWidth ovalHeight:(CGFloat)ovalHeight { + if (ovalWidth == 0 || ovalHeight == 0) { + CGContextAddRect(context, rect); + return; + } + CGContextSaveGState(context); + CGContextTranslateCTM(context, CGRectGetMinX(rect), CGRectGetMinY(rect)); + CGContextScaleCTM(context, ovalWidth, ovalHeight); + CGFloat fw = CGRectGetWidth(rect) / ovalWidth; + CGFloat fh = CGRectGetHeight(rect) / ovalHeight; + CGContextMoveToPoint(context, fw, fh/2); + CGContextAddArcToPoint(context, fw, fh, fw/2, fh, 1); + CGContextAddArcToPoint(context, 0, fh, 0, fh/2, 1); + CGContextAddArcToPoint(context, 0, 0, fw/2, 0, 1); + CGContextAddArcToPoint(context, fw, 0, fw, fh/2, 1); + CGContextClosePath(context); + CGContextRestoreGState(context); +} + +@end + +@implementation UIImage (LYStretchable) + +- (instancetype)ly_stretchableImageByStyle:(LYStretchableImageStyle)style { + CGFloat top; + CGFloat bottom; + CGFloat left; + CGFloat right; + switch (style) { + case LYStretchableImageStyleLeftTop: + top = 0; + bottom = self.size.height - 0.5; + left = 0; + right = self.size.width - 0.5; + break; + case LYStretchableImageStyleLeftBottom: + top = self.size.height - 0.5; + bottom = 0; + left = 0; + right = self.size.width - 0.5; + break; + case LYStretchableImageStyleRightTop: + top = 0; + bottom = self.size.height - 0.5; + left = self.size.width - 0.5; + right = 0; + break; + case LYStretchableImageStyleRightBottom: + top = self.size.height - 0.5;; + bottom = 0; + left = self.size.width - 0.5; + right = 0; + break; + case LYStretchableImageStyleCenter: + default: + top = (self.size.height - 0.5) * 0.5; + bottom = top; + left = (self.size.width - 0.5) * 0.5; + right = left; + break; + } + return [self ly_stretchableImageCapInsets:UIEdgeInsetsMake(top, left, bottom, right)]; +} + +- (instancetype)ly_stretchableImageCapInsets:(UIEdgeInsets)capInsets { + return [self resizableImageWithCapInsets:capInsets resizingMode:UIImageResizingModeStretch]; +} + +@end + + +@implementation UIImage (LYCompress) + +- (NSData *)ly_compressImageToByte:(NSInteger)maxLength { + CGFloat compress = 1; + NSData *data = UIImageJPEGRepresentation(self, compress); + if (data.length < maxLength) { + return data; + } + + CGFloat min = 0; + CGFloat max = 1; + for (NSInteger i = 0; i < 6; i++) { + compress = (max + min) * 0.5; + data = UIImageJPEGRepresentation(self, compress); + if (data.length < maxLength * 0.9) { + min = compress; + } else if (data.length > maxLength) { + max = compress; + } else { + break; + } + } + if (data.length < maxLength) { + return data; + } + + NSUInteger lastDataLength = 0; + UIImage *resultImage = [UIImage imageWithData:data]; + while (data.length > maxLength && data.length != lastDataLength) { + lastDataLength = data.length; + CGFloat ratio = (CGFloat)maxLength / data.length; + CGSize size = CGSizeMake(resultImage.size.width * sqrtf(ratio), resultImage.size.height * sqrtf(ratio)); + UIGraphicsBeginImageContext(size); + [resultImage drawInRect:CGRectMake(0, 0, size.width, size.height)]; + resultImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + data = UIImageJPEGRepresentation(resultImage, compress); + } + return data; +} + +@end + +@implementation UIImage (LYTintColor) + +- (instancetype)ly_imagePureChangeColor:(UIColor *)color { + return [self ly_imageWithChangeColor:color blendMode:kCGBlendModeDestinationIn]; +} + +- (instancetype)ly_imageGradientChangeColor:(UIColor *)color { + return [self ly_imageWithChangeColor:color blendMode:kCGBlendModeOverlay]; +} + +- (instancetype)ly_imageWithChangeColor:(UIColor *)color blendMode:(CGBlendMode)blendMode { + UIGraphicsBeginImageContextWithOptions(self.size, NO, 0.0); + [color setFill]; + CGRect bounds = CGRectMake(0.0, 0.0, self.size.width, self.size.height); + UIRectFill(bounds); + + [self drawInRect:bounds blendMode:blendMode alpha:1.0]; + if (blendMode != kCGBlendModeDestinationIn) { + [self drawInRect:bounds blendMode:kCGBlendModeDestinationIn alpha:1.0]; + } + + UIImage *tintImage = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return tintImage; +} + +@end diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYCut.h b/LYToolsKit/UI/UI/UIView/UIView+LYCut.h new file mode 100755 index 0000000..5cbaf5c --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYCut.h @@ -0,0 +1,28 @@ +// +// UIView+LYCut.h +// shuaidanbao +// +// Created by 吴浪 on 15/12/28. +// Copyright © 2015年 sdb. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView (LYCut) + +/** 裁剪View的某几个角 */ +- (instancetype)ly_cutWithCornerRadius:(CGFloat)radius rectCorner:(UIRectCorner)rectCorner; + +@end + + +@interface UIView (LYScreenshot) + +/** 视图截屏 */ +- (UIImage *)ly_captureScreenshot; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYCut.m b/LYToolsKit/UI/UI/UIView/UIView+LYCut.m new file mode 100755 index 0000000..4d55d17 --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYCut.m @@ -0,0 +1,40 @@ +// +// UIView+LY.m +// shuaidanbao +// +// Created by 吴浪 on 15/12/28. +// Copyright © 2015年 sdb. All rights reserved. +// + +#import "UIView+LYCut.h" + +@implementation UIView (LYCut) + +- (instancetype)ly_cutWithCornerRadius:(CGFloat)radius rectCorner:(UIRectCorner)rectCorner { + UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:rectCorner cornerRadii:CGSizeMake(radius, radius)]; + CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init]; + maskLayer.frame = self.bounds; + maskLayer.path = maskPath.CGPath; + self.layer.mask = maskLayer; + return self; +} + +@end + + +@implementation UIView (LYScreenshot) + +/** 视图截屏 */ +- (UIImage *)ly_captureScreenshot { + //开启位图图形上下文 + UIGraphicsBeginImageContextWithOptions(self.frame.size, NO, 0.0); + //屏幕截屏 + [self.layer renderInContext:UIGraphicsGetCurrentContext()]; + //取图 + UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); + //结束上下文 + UIGraphicsEndImageContext(); + return image; +} + +@end diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.h b/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.h new file mode 100644 index 0000000..398696c --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.h @@ -0,0 +1,19 @@ +// +// UIView+EnlargeTouchArea.h +// LYUI +// +// Created by ly on 2018/1/12. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView (LYEnlargeTouchArea) + +/** 扩展点击区域(正值缩小,负值扩大) */ +- (void)ly_enlargeEdgeWithTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.m b/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.m new file mode 100644 index 0000000..1f678bf --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYEnlargeTouchArea.m @@ -0,0 +1,46 @@ +// +// UIView+LYEnlargeTouchArea.m +// LYUI +// +// Created by ly on 2018/1/12. +// + +#import "UIView+LYEnlargeTouchArea.h" +#import + +@implementation UIView (LYEnlargeTouchArea) + +static char topKey; +static char rightKey; +static char bottomKey; +static char leftKey; + +- (void)ly_enlargeEdgeWithTop:(CGFloat)top left:(CGFloat)left bottom:(CGFloat)bottom right:(CGFloat)right { + objc_setAssociatedObject(self, &topKey, [NSNumber numberWithFloat:top], OBJC_ASSOCIATION_COPY_NONATOMIC); + objc_setAssociatedObject(self, &rightKey, [NSNumber numberWithFloat:right], OBJC_ASSOCIATION_COPY_NONATOMIC); + objc_setAssociatedObject(self, &bottomKey, [NSNumber numberWithFloat:bottom], OBJC_ASSOCIATION_COPY_NONATOMIC); + objc_setAssociatedObject(self, &leftKey, [NSNumber numberWithFloat:left], OBJC_ASSOCIATION_COPY_NONATOMIC); +} + +- (CGRect)enlargedRect { + CGFloat top = [objc_getAssociatedObject(self, &topKey) floatValue]; + CGFloat right = [objc_getAssociatedObject(self, &rightKey) floatValue]; + CGFloat bottom = [objc_getAssociatedObject(self, &bottomKey) floatValue]; + CGFloat left = [objc_getAssociatedObject(self, &leftKey) floatValue]; + UIEdgeInsets edge = UIEdgeInsetsMake(top, left, bottom, right); + + if (UIEdgeInsetsEqualToEdgeInsets(edge, UIEdgeInsetsZero)) { + return self.bounds; + } else { + return CGRectMake(CGRectGetMinX(self.bounds) + edge.left, + CGRectGetMinY(self.bounds) + edge.top, + self.bounds.size.width - (edge.left + edge.right), + self.bounds.size.height - (edge.top + edge.bottom)); + } +} + +- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event { + return CGRectContainsPoint([self enlargedRect], point); +} + +@end diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYTouch.h b/LYToolsKit/UI/UI/UIView/UIView+LYTouch.h new file mode 100644 index 0000000..1669a74 --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYTouch.h @@ -0,0 +1,22 @@ +// +// UIView+LYTouch.h +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void(^LYSingleTappedActionBlock)(UIView *view); +typedef void(^LYSingleTappedGestureConfig)(UITapGestureRecognizer *tap); + +@interface UIView (LYTouch) + +- (void)ly_singleTapped:(LYSingleTappedActionBlock)block; +- (void)ly_singleTappedGesture:(nullable LYSingleTappedGestureConfig)config block:(LYSingleTappedActionBlock)block; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIView/UIView+LYTouch.m b/LYToolsKit/UI/UI/UIView/UIView+LYTouch.m new file mode 100644 index 0000000..d888bd6 --- /dev/null +++ b/LYToolsKit/UI/UI/UIView/UIView+LYTouch.m @@ -0,0 +1,37 @@ +// +// UIView+LYTouch.m +// LYUI +// +// Created by 吴浪 on 2018/11/8. +// + +#import "UIView+LYTouch.h" +#import + +static NSString *const kSingleTap = @"singleTap"; + +@implementation UIView (LYTouch) + +- (void)ly_singleTapped:(LYSingleTappedActionBlock)block { + [self ly_singleTappedGesture:nil block:block]; +} + +- (void)ly_singleTappedGesture:(LYSingleTappedGestureConfig)config block:(LYSingleTappedActionBlock)block { + UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(ly_singleTap:)]; + if (config) { + config(tapGesture); + } + [self addGestureRecognizer:tapGesture]; + + objc_setAssociatedObject(self, (__bridge const void * _Nonnull)(kSingleTap), [block copy], OBJC_ASSOCIATION_COPY_NONATOMIC); + self.userInteractionEnabled = YES; +} + +- (void)ly_singleTap:(UITapGestureRecognizer *)tap { + LYSingleTappedActionBlock block = objc_getAssociatedObject(self, (__bridge const void * _Nonnull)(kSingleTap)); + if (block) { + block(self); + } +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.h new file mode 100644 index 0000000..686b28c --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.h @@ -0,0 +1,58 @@ +// +// UIButton+LYExt.h +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIButton (LYExt) + +/** 快速创建 + * @param nImageName 默认状态图片名 + * @param sImageName 选择状态图片名 + * @param font 字体 + * @param target 回调对象 + * @param selector 回调方法 + * @return 返回Button对象 + */ ++ (instancetype)ly_ButtonWithNormalImageName:(nullable NSString *)nImageName + selecteImageName:(nullable NSString *)sImageName + font:(nullable UIFont *)font + target:(nullable id)target + selector:(nullable SEL)selector; +/** 快速创建 + * @param nImageName 默认状态图片名 + * @param sImageName 选择状态图片名 + * @param target 回调对象 + * @param selector 回调方法 + * @return 返回Button对象 + */ ++ (instancetype)ly_ButtonWithNormalImageName:(nullable NSString *)nImageName + selecteImageName:(nullable NSString *)sImageName + target:(nullable id)target + selector:(nullable SEL)selector; + +/** + 快速创建 + + @param title 默认状态title + @param titleColor 默认状态titleColor + @param font 字体 + @param target 回调对象 + @param selector 回调方法 + @return button对象 + */ ++ (instancetype)ly_ButtonWithTitle:(nullable NSString *)title + titleColor:(nullable UIColor *)titleColor + font:(nullable UIFont *)font + target:(nullable id)target + selector:(nullable SEL)selector; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.m new file mode 100644 index 0000000..96ebe5d --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIButton+LYExt.m @@ -0,0 +1,36 @@ +// +// UIButton+LYExt.m +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import "UIButton+LYExt.h" + +@implementation UIButton (LYExt) + ++ (instancetype)ly_ButtonWithNormalImageName:(NSString *)nImageName selecteImageName:(NSString *)sImageName font:(UIFont *)font target:(id)target selector:(SEL)selector { + UIImage *nImage = nImageName.length ? [UIImage imageNamed:nImageName] : nil; + UIImage *sImage = sImageName.length ? [UIImage imageNamed:sImageName] : nil; + + UIButton *btn = [self buttonWithType:UIButtonTypeCustom]; + btn.titleLabel.font = font; + [btn setImage:nImage forState:UIControlStateNormal]; + [btn setImage:sImage forState:UIControlStateSelected]; + [btn addTarget:target action:selector forControlEvents:UIControlEventTouchUpInside]; + return btn; +} + ++ (instancetype)ly_ButtonWithNormalImageName:(NSString *)nImageName selecteImageName:(NSString *)sImageName target:(id)target selector:(SEL)selector { + return [self ly_ButtonWithNormalImageName:nImageName selecteImageName:sImageName font:nil target:target selector:selector]; +} + ++ (instancetype)ly_ButtonWithTitle:(NSString *)title titleColor:(UIColor *)titleColor font:(UIFont *)font target:(id)target selector:(SEL)selector { + UIButton *btn = [self ly_ButtonWithNormalImageName:nil selecteImageName:nil font:(UIFont *)font target:target selector:selector]; + [btn setTitle:title forState:UIControlStateNormal]; + [btn setTitleColor:titleColor forState:UIControlStateNormal]; + return btn; +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.h new file mode 100644 index 0000000..0d80733 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.h @@ -0,0 +1,25 @@ +// +// UIImageView+LYExt.h +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIImageView (LYExt) + +/** 快速创建 + * + * @param imageNamed 图片名 + * + * @return 返回ImageView对象 + */ ++ (instancetype)ly_ImageViewWithImageNamed:(nullable NSString *)imageNamed; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.m new file mode 100644 index 0000000..4a9295e --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIImageView+LYExt.m @@ -0,0 +1,19 @@ +// +// UIImageView+LYExt.m +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import "UIImageView+LYExt.h" + +@implementation UIImageView (LYExt) + ++ (instancetype)ly_ImageViewWithImageNamed:(NSString *)imageNamed { + UIImage *image = imageNamed.length ? [UIImage imageNamed:imageNamed] : nil; + UIImageView *imageView = [[self alloc] initWithImage:image] ; + return imageView; +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.h new file mode 100644 index 0000000..021cd8f --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.h @@ -0,0 +1,29 @@ +// +// UILabel+LYExt.h +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UILabel (LYExt) + +/** 快速创建 + * + * @param title title + * @param font 字体大小 + * @param titleColor 字体颜色 + * + * @return 返回Label对象 + */ ++ (instancetype)ly_LabelWithTitle:(nullable NSString *)title + font:(nullable UIFont *)font + titleColor:(nullable UIColor *)titleColor; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.m new file mode 100644 index 0000000..077c7e0 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UILabel+LYExt.m @@ -0,0 +1,21 @@ +// +// UILabel+LYExt.m +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import "UILabel+LYExt.h" + +@implementation UILabel (LYExt) + ++ (instancetype)ly_LabelWithTitle:(NSString *)title font:(UIFont *)font titleColor:(UIColor *)titleColor { + UILabel *label = [[self alloc] init]; + label.textColor = titleColor; + label.font = font; + label.text = title; + return label; +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.h new file mode 100644 index 0000000..f30cf80 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.h @@ -0,0 +1,26 @@ +// +// UITextField+LYExt.h +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UITextField (LYExt) + +/** 快速创建 + * + * @param placeholder 占位符 + * @param font 字体大小 + * + * @return 返回TextField对象 + */ ++ (instancetype)ly_TextFieldWithPlaceholder:(nullable NSString *)placeholder font:(nullable UIFont *)font; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.m new file mode 100644 index 0000000..a27908c --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UITextField+LYExt.m @@ -0,0 +1,20 @@ +// +// UITextField+LYExt.m +// Tools +// +// Created by 吴浪 on 16/3/11. +// Copyright © 2016年 吴浪. All rights reserved. +// + +#import "UITextField+LYExt.h" + +@implementation UITextField (LYExt) + ++ (instancetype)ly_TextFieldWithPlaceholder:(NSString *)placeholder font:(UIFont *)font { + UITextField *textField = [[self alloc] init]; + textField.placeholder = placeholder; + textField.font = font; + return textField; +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.h new file mode 100644 index 0000000..1d89b2a --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.h @@ -0,0 +1,27 @@ +// +// UITextView+LYExt.h +// LYUI +// +// Created by 吴浪 on 16/7/5. +// Copyright © 2016年 LY. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UITextView (LYExt) +/** 快速创建 + * @param text 文本 + * @param font 字体大小 + * @param delegate 代理 + * @return 返回TextView对象 + */ ++ (instancetype)ly_TextViewWithText:(nullable NSString *)text + font:(nullable UIFont *)font + textColor:(nullable UIColor *)textColor + delegate:(nullable id)delegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.m new file mode 100644 index 0000000..f8da6b8 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UITextView+LYExt.m @@ -0,0 +1,22 @@ +// +// UITextView+LYExt.m +// LYUI +// +// Created by 吴浪 on 16/7/5. +// Copyright © 2016年 LY. All rights reserved. +// + +#import "UITextView+LYExt.h" + +@implementation UITextView (LYExt) + ++ (instancetype)ly_TextViewWithText:(NSString *)text font:(UIFont *)font textColor:(UIColor *)textColor delegate:(id)delegate { + UITextView *textView = [[self alloc] init]; + textView.text = text; + textView.textColor = textColor; + textView.delegate = delegate; + textView.font = font; + return textView; +} + +@end diff --git a/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.h b/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.h new file mode 100644 index 0000000..aedd6e0 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.h @@ -0,0 +1,39 @@ +// +// UIView+LYExt.m +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-11. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView (LYExt) + +// getter方法:获取距离self所在坐标系中,x轴或y轴距离 +// setter方法:只有在self的frame确定的情况下使用 +@property (assign, nonatomic) CGFloat top; +@property (assign, nonatomic) CGFloat bottom; +@property (assign, nonatomic) CGFloat left; +@property (assign, nonatomic) CGFloat right; + +// 简化UIView的frame属性设置 +@property (nonatomic, assign) CGFloat x; +@property (nonatomic, assign) CGFloat y; +@property (nonatomic, assign) CGFloat centerX; +@property (nonatomic, assign) CGFloat centerY; + +@property (nonatomic, assign) CGFloat width; +@property (nonatomic, assign) CGFloat height; + +@property (nonatomic, assign) CGSize size; +@property (nonatomic, assign) CGPoint origin; + +/** 快速创建 */ ++ (instancetype)ly_ViewWithColor:(nullable UIColor *)color; + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.m b/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.m new file mode 100644 index 0000000..d4f8d57 --- /dev/null +++ b/LYToolsKit/UI/UI/UIViewExt/UIView+LYExt.m @@ -0,0 +1,142 @@ +// +// UIView+LYExt.m +// +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-11. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// + +#import "UIView+LYExt.h" + +@implementation UIView (LYExt) +#pragma mark - 快速访问UIView的Frame +- (void)setX:(CGFloat)x { + CGRect frame = self.frame; + frame.origin.x = x; + self.frame = frame; +} + +- (CGFloat)x { + return self.frame.origin.x; +} + +- (void)setY:(CGFloat)y { + CGRect frame = self.frame; + frame.origin.y = y; + self.frame = frame; +} + +- (CGFloat)y { + return self.frame.origin.y; +} + +- (void)setCenterX:(CGFloat)centerX { + CGPoint center = self.center; + center.x = centerX; + self.center = center; +} + +- (CGFloat)centerX { + return self.center.x; +} + +- (void)setCenterY:(CGFloat)centerY { + CGPoint center = self.center; + center.y = centerY; + self.center = center; +} + +- (CGFloat)centerY { + return self.center.y; +} + +- (void)setWidth:(CGFloat)width { + CGRect frame = self.frame; + frame.size.width = width; + self.frame = frame; +} + +- (CGFloat)width { + return self.frame.size.width; +} + +- (void)setHeight:(CGFloat)height { + CGRect frame = self.frame; + frame.size.height = height; + self.frame = frame; +} + +- (CGFloat)height { + return self.frame.size.height; +} + +- (void)setSize:(CGSize)size { + CGRect frame = self.frame; + frame.size = size; + self.frame = frame; +} + +- (CGSize)size { + return self.frame.size; +} + +- (void)setOrigin:(CGPoint)origin { + CGRect frame = self.frame; + frame.origin = origin; + self.frame = frame; +} + +- (CGPoint)origin { + return self.frame.origin; +} + +- (CGFloat)top { + return CGRectGetMinY(self.frame); +} + +- (void)setTop:(CGFloat)top { + CGRect frame = self.frame; + frame.origin.y = top; + self.frame = frame; +} + +- (CGFloat)left { + return CGRectGetMinX(self.frame); +} + +- (void)setLeft:(CGFloat)left { + CGRect frame = self.frame; + frame.origin.x = left; + self.frame = frame; +} + +- (CGFloat)bottom { + return CGRectGetMaxY(self.frame); +} + +- (void)setBottom:(CGFloat)bottom { + CGRect frame = self.frame; + frame.origin.y = bottom - frame.size.height; + self.frame = frame; +} + +- (CGFloat)right { + return CGRectGetMaxX(self.frame); +} + +- (void)setRight:(CGFloat)right { + CGRect frame = self.frame; + frame.origin.x = right - frame.size.width; + self.frame = frame; +} + + +#pragma mark - 快速创建View ++ (instancetype)ly_ViewWithColor:(UIColor *)color{ + UIView *view = [[self alloc] init]; + view.backgroundColor = color; + return view; +} + +@end diff --git a/LYToolsKit/Utility/LYUtility.h b/LYToolsKit/Utility/LYUtility.h new file mode 100644 index 0000000..5e34d6d --- /dev/null +++ b/LYToolsKit/Utility/LYUtility.h @@ -0,0 +1,20 @@ +// +// LYUtility.h +// LYUtility +// +// Created by 吴浪 on 2018/11/11. +// + +#ifndef LYUtility_h +#define LYUtility_h + +#pragma mark - UIView +#import + +#pragma mark - UILable +#import + +#pragma mark - UIApplication +#import + +#endif /* LYUtility_h */ diff --git a/LYToolsKit/Utility/UIApplication/LYTouchTrace.h b/LYToolsKit/Utility/UIApplication/LYTouchTrace.h new file mode 100755 index 0000000..18ab497 --- /dev/null +++ b/LYToolsKit/Utility/UIApplication/LYTouchTrace.h @@ -0,0 +1,29 @@ +// +// LYTouchTrace.h +// +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-11. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// 显示操作轴迹 + +/** + * 使用方法 + * 1、在int main(int argc, char * argv[])方法里添加如下: + return UIApplicationMain(argc, argv, NSStringFromClass([LYTouchTrace class]), NSStringFromClass([AppDelegate class])); + * 2、在- (BOOL)application: didFinishLaunchingWithOptions:方法里添加如下: + LYTouchTrace *touchApplication = (LYTouchTrace *)application; + touchApplication.alwaysShowTouches = YES; + * + */ + +#import + +@interface LYTouchTrace : UIApplication +@property (nonatomic, assign) CGFloat touchHue; +@property (nonatomic, assign) BOOL showTouches; +@property (nonatomic, assign) BOOL alwaysShowTouches; /**< 默认YES */ +@property (nonatomic, assign) BOOL showTouchesWhenKeyboardShown; +@property (nonatomic, copy) NSString *touchImageName; + +@end diff --git a/LYToolsKit/Utility/UIApplication/LYTouchTrace.m b/LYToolsKit/Utility/UIApplication/LYTouchTrace.m new file mode 100755 index 0000000..ff13ee8 --- /dev/null +++ b/LYToolsKit/Utility/UIApplication/LYTouchTrace.m @@ -0,0 +1,283 @@ +// +// LYTouchTrace.m +// +// 茗玥古城 +// +// Created by 似水灵修 on 13-11-11. +// Copyright (c) 2013年 MingYueGuCheng. All rights reserved. +// + +#import "LYTouchTrace.h" +#import +#import + +@interface LYTouchTrace () +- (void)updateTouches:(NSSet *)touches; +- (void)applicationDidFinishLaunching:(NSNotification *)notification; +- (void)screenDidConnectNotification:(NSNotification *)notification; +- (void)screenDidDisonnectNotification:(NSNotification *)notification; +- (void)keyboardDidShowNotification:(NSNotification *)notification; +- (void)keyboardDidHideNotification:(NSNotification *)notification; +- (BOOL)hasMirroredScreen; +- (void)keyWindowChanged:(UIWindow *)window; +- (void)bringTouchViewToFront; + +@end + +// The LYTouchposeFingerView is used to render a finger touches on the screen. +@interface LYTouchposeFingerView : UIView + +@property (nonatomic, strong) UIImageView *touchImageView; + +- (id)initWithPoint:(CGPoint)point hue:(CGFloat)hue imageName:(NSString *)imageName; + +@end + +@implementation LYTouchposeFingerView +#pragma mark - UIView + +- (id)initWithFrame:(CGRect)frame { + return [self initWithPoint:(CGPoint){-frame.size.width, -frame.size.height} hue:0.0f imageName:nil]; +} + +#pragma mark - LYTouchposeFingerView + +- (id)initWithPoint:(CGPoint)point hue:(CGFloat)hue imageName:(NSString *)imageName { + const CGFloat kFingerRadius = 14.50f; + + if ((self = [super initWithFrame:CGRectMake(point.x-kFingerRadius, point.y-kFingerRadius, 2*kFingerRadius, 2*kFingerRadius)])) { + + if (imageName.length > 0) { + if (_touchImageView == nil) { + _touchImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]]; + }else { + } + + [self addSubview:_touchImageView]; + }else { + self.opaque = NO; //Result = Source + Destination * (1 - SourceAlpha), opaque = YES SourceAlpha = 1, + self.layer.borderColor = [UIColor colorWithHue:hue saturation:0.5f brightness:0.5f alpha:0.6f].CGColor; + self.layer.cornerRadius = kFingerRadius; + self.layer.borderWidth = 2.0f; + self.layer.backgroundColor = [UIColor colorWithHue:hue saturation:0.5f brightness:0.5f alpha:0.4f].CGColor; + } + + self.userInteractionEnabled = NO; + } + return self; +} + +@end + +IMP SwizzleMethod(Class c, SEL sel, IMP newImplementation) +{ + Method method = class_getInstanceMethod(c, sel); + IMP originalImplementation = method_getImplementation(method); + if (!class_addMethod(c, sel, newImplementation, method_getTypeEncoding(method))) + method_setImplementation(method, newImplementation); + return originalImplementation; +} + +static void (*UIWindow_orig_becomeKeyWindow)(UIWindow *, SEL); + +// This method replaces -[UIWindow becomeKeyWindow] (but calls the original -becomeKeyWindow). This +// is used to move the overlay to the current key window. +static void UIWindow_new_becomeKeyWindow(UIWindow *window, SEL _cmd) +{ + LYTouchTrace *application = (LYTouchTrace *)[UIApplication sharedApplication]; + [application keyWindowChanged:window]; + (*UIWindow_orig_becomeKeyWindow)(window, _cmd); +} + +static void (*UIWindow_orig_didAddSubview)(UIWindow *, SEL, UIView *); + +// This method replaces -[UIWindow didAddSubview:] (but calls the original -didAddSubview:). This is +// used to keep the overlay view the top-most view of the window. +static void UIWindow_new_didAddSubview(UIWindow *window, SEL _cmd, UIView *view) +{ + if (![view isKindOfClass:[LYTouchposeFingerView class]]) + { + LYTouchTrace *application = (LYTouchTrace *)[UIApplication sharedApplication]; + [application bringTouchViewToFront]; + } + (*UIWindow_orig_didAddSubview)(window, _cmd, view); +} + + +@implementation LYTouchTrace +{ + // Dictionary of touches being displayed. Keys are UITouch pointers and values are UIView pointers. + __block CFMutableDictionaryRef _touchDictionary; + UIView *_touchView; + CGFloat _touchHue; + BOOL _showTouches; + BOOL _alwaysShowTouches; + BOOL _showTouchesWhenKeyboardShown; +} + +#pragma mark - NSObject + ++ (NSUInteger)majorSystemVersion { + NSArray *versionComponents = [[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."]; + return [[versionComponents objectAtIndex:0] integerValue]; +} + +- (id)init { + if ((self = [super init])) { + _touchDictionary = CFDictionaryCreateMutable(NULL, 10, NULL, NULL); + _touchHue = 0.55f; + _alwaysShowTouches = YES; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidFinishLaunching:) name:UIApplicationDidFinishLaunchingNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidConnectNotification:) name:UIScreenDidConnectNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(screenDidDisonnectNotification:) name:UIScreenDidDisconnectNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShowNotification:) name:UIKeyboardDidShowNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHideNotification:) name:UIKeyboardDidHideNotification object:nil]; + + // In my experience, the keyboard performance is crippled when showing touches on a + // device running iOS < 5, so by default, disable touches when the keyboard is + // present. + _showTouchesWhenKeyboardShown = [[self class] majorSystemVersion] >= 5; + } + return self; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; + CFRelease(_touchDictionary); +} + + +#pragma mark - UIApplication + +- (void)sendEvent:(UIEvent *)event +{ + [super sendEvent:event]; + if (_showTouches) + [self updateTouches:[event allTouches]]; +} + +#pragma mark - LYTouchTrace +- (void)removeTouchesActiveTouches:(NSSet *)activeTouches { + CFIndex count = CFDictionaryGetCount(_touchDictionary); + const void **keys = alloca(sizeof(UITouch *) * count); + const void **values = alloca(sizeof(UIView *) * count); + CFDictionaryGetKeysAndValues(_touchDictionary, keys, values); + + for (CFIndex i = 0; i < count; ++i) { + UITouch *touch = (__bridge UITouch *)(keys[i]); + if (activeTouches == nil || ![activeTouches containsObject:touch]) { + UIView *view = (__bridge UIView *)(values[i]); + CFDictionaryRemoveValue(_touchDictionary, (__bridge const void *)(touch)); + [UIView animateWithDuration:0.5f animations:^{ + view.alpha = 0.0f; + } completion:^(BOOL completed){ + [view removeFromSuperview]; + }]; + } + } +} + +- (void)updateTouches:(NSSet *)touches { + [touches enumerateObjectsUsingBlock:^(UITouch *_Nonnull touch, BOOL * _Nonnull stop) { + CGPoint point = [touch locationInView:self->_touchView]; + UIView *fingerView = (UIView *)CFDictionaryGetValue(self->_touchDictionary, (__bridge const void *)(touch)); + if (touch.phase == UITouchPhaseCancelled || touch.phase == UITouchPhaseEnded) { + // Note that there seems to be a bug in iOS: we won't observe all UITouches + // in the UITouchPhaseEnded phase, resulting in some finger views being left + // on the screen when they shouldn't be. See + // https://discussions.apple.com/thread/1507669?start=0&tstart=0 for other's + // comments about this issue. No workaround is implemented here. + + if (fingerView != NULL) { + // Remove the touch from the + CFDictionaryRemoveValue(self->_touchDictionary, (__bridge const void *)(touch)); + [UIView animateWithDuration:0.5f animations:^{ + fingerView.alpha = 0.0f; + } completion:^(BOOL completed){ + [fingerView removeFromSuperview]; + }]; + } + } else { + if (fingerView == NULL) { + if (touch.window) { + fingerView = [[LYTouchposeFingerView alloc] initWithPoint:point hue:self->_touchHue imageName:self->_touchImageName]; + [self->_touchView addSubview:fingerView]; + CFDictionarySetValue(self->_touchDictionary, (__bridge const void *)(touch), (__bridge const void *)(fingerView)); + } + } else { + fingerView.center = point; + } + } + }]; + + [self removeTouchesActiveTouches:touches]; +} + +- (void)applicationDidFinishLaunching:(NSNotification *)notification { + // We intercept calls to -becomeKeyWindow and -didAddSubview of UIWindow to manage the + // overlay view QTouchposeTouchesView and ensure it remains the top-most window. + UIWindow_orig_didAddSubview = (void (*)(UIWindow *, SEL, UIView *))SwizzleMethod([UIWindow class], @selector(didAddSubview:), (IMP)UIWindow_new_didAddSubview); + UIWindow_orig_becomeKeyWindow = (void (*)(UIWindow *, SEL))SwizzleMethod([UIWindow class], @selector(becomeKeyWindow), (IMP)UIWindow_new_becomeKeyWindow); + + self.showTouches = _alwaysShowTouches || [self hasMirroredScreen]; +} + +- (void)screenDidConnectNotification:(NSNotification *)notification { + self.showTouches = _alwaysShowTouches || [self hasMirroredScreen]; +} + +- (void)screenDidDisonnectNotification:(NSNotification *)notification { + self.showTouches = _alwaysShowTouches || [self hasMirroredScreen]; +} + +- (void)keyboardDidShowNotification:(NSNotification *)notification { + self.showTouches = _showTouchesWhenKeyboardShown && (_alwaysShowTouches || [self hasMirroredScreen]); +} + +- (void)keyboardDidHideNotification:(NSNotification *)notification { + self.showTouches = _alwaysShowTouches || [self hasMirroredScreen]; +} + +- (void)keyWindowChanged:(UIWindow *)window { + if (_touchView) + [window addSubview:_touchView]; +} + +- (void)bringTouchViewToFront { + if (_touchView) + [_touchView.window bringSubviewToFront:_touchView]; +} + +- (BOOL)hasMirroredScreen { + __block BOOL hasMirroredScreen = NO; + NSArray *screens = [UIScreen screens]; + [screens enumerateObjectsUsingBlock:^(UIScreen *_Nonnull screen, NSUInteger idx, BOOL * _Nonnull stop) { + if (screen.mirroredScreen != nil) { + hasMirroredScreen = YES; + *stop = YES; + } + }]; + + return hasMirroredScreen; +} + +- (void)setShowTouches:(BOOL)showTouches { + if (showTouches) { + if (_touchView == nil && self.keyWindow) + { + UIWindow *window = self.keyWindow; + _touchView = [[LYTouchposeFingerView alloc] initWithFrame:window.bounds]; + [window addSubview:_touchView]; + } + }else { + [self removeTouchesActiveTouches:nil]; + if (_touchView) { + [_touchView removeFromSuperview]; + _touchView = nil; + } + } + _showTouches = showTouches; +} + +@end diff --git a/LYToolsKit/Utility/UILabel/UICountingLabel.h b/LYToolsKit/Utility/UILabel/UICountingLabel.h new file mode 100755 index 0000000..f19219e --- /dev/null +++ b/LYToolsKit/Utility/UILabel/UICountingLabel.h @@ -0,0 +1,36 @@ +#import +#import + +typedef NS_ENUM(NSInteger, UILabelCountingMethod) { + UILabelCountingMethodEaseInOut, + UILabelCountingMethodEaseIn, + UILabelCountingMethodEaseOut, + UILabelCountingMethodLinear +}; + +typedef NSString* (^UICountingLabelFormatBlock)(CGFloat value); +typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(CGFloat value); + +@interface UICountingLabel : UILabel + +@property (nonatomic, strong) NSString *format; +@property (nonatomic, assign) UILabelCountingMethod method; +@property (nonatomic, assign) NSTimeInterval animationDuration; + +@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock; +@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock; +@property (nonatomic, copy) void (^completionBlock)(void); + +-(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue; +-(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue withDuration:(NSTimeInterval)duration; + +-(void)countFromCurrentValueTo:(CGFloat)endValue; +-(void)countFromCurrentValueTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration; + +-(void)countFromZeroTo:(CGFloat)endValue; +-(void)countFromZeroTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration; + +- (CGFloat)currentValue; + +@end + diff --git a/LYToolsKit/Utility/UILabel/UICountingLabel.m b/LYToolsKit/Utility/UILabel/UICountingLabel.m new file mode 100755 index 0000000..fcf08c0 --- /dev/null +++ b/LYToolsKit/Utility/UILabel/UICountingLabel.m @@ -0,0 +1,263 @@ +#import + +#import "UICountingLabel.h" + +#if !__has_feature(objc_arc) +#error UICountingLabel is ARC only. Either turn on ARC for the project or use -fobjc-arc flag +#endif + +#pragma mark - UILabelCounter + +static CGFloat kLabelCounterRate = 3.0; + +@protocol UILabelCounter + +-(CGFloat)update:(CGFloat)t; + +@end + +@interface UILabelCounterLinear : NSObject + +@end + +@interface UILabelCounterEaseIn : NSObject + +@end + +@interface UILabelCounterEaseOut : NSObject + +@end + +@interface UILabelCounterEaseInOut : NSObject + +@end + +@implementation UILabelCounterLinear + +-(CGFloat)update:(CGFloat)t +{ + return t; +} + +@end + +@implementation UILabelCounterEaseIn + +-(CGFloat)update:(CGFloat)t +{ + return powf(t, kLabelCounterRate); +} + +@end + +@implementation UILabelCounterEaseOut + +-(CGFloat)update:(CGFloat)t{ + return 1.0-powf((1.0-t), kLabelCounterRate); +} + +@end + +@implementation UILabelCounterEaseInOut + +-(CGFloat) update: (CGFloat) t +{ + int sign =1; + int r = (int) kLabelCounterRate; + if (r % 2 == 0) + sign = -1; + t *= 2; + if (t < 1) + return 0.5f * powf(t, kLabelCounterRate); + else + return sign * 0.5f * (powf(t-2, kLabelCounterRate) + sign * 2); +} + +@end + +#pragma mark - UICountingLabel + +@interface UICountingLabel () + +@property CGFloat startingValue; +@property CGFloat destinationValue; +@property NSTimeInterval progress; +@property NSTimeInterval lastUpdate; +@property NSTimeInterval totalTime; +@property CGFloat easingRate; + +@property (nonatomic, strong) CADisplayLink *timer; +@property (nonatomic, strong) id counter; + +@end + +@implementation UICountingLabel + +-(void)countFrom:(CGFloat)value to:(CGFloat)endValue { + + if (self.animationDuration == 0.0f) { + self.animationDuration = 2.0f; + } + + [self countFrom:value to:endValue withDuration:self.animationDuration]; +} + +-(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue withDuration:(NSTimeInterval)duration { + + self.startingValue = startValue; + self.destinationValue = endValue; + + // remove any (possible) old timers + [self.timer invalidate]; + self.timer = nil; + + if (duration == 0.0) { + // No animation + [self setTextValue:endValue]; + [self runCompletionBlock]; + return; + } + + self.easingRate = 3.0f; + self.progress = 0; + self.totalTime = duration; + self.lastUpdate = [NSDate timeIntervalSinceReferenceDate]; + + if(self.format == nil) + self.format = @"%d"; + + switch(self.method) + { + case UILabelCountingMethodLinear: + self.counter = [[UILabelCounterLinear alloc] init]; + break; + case UILabelCountingMethodEaseIn: + self.counter = [[UILabelCounterEaseIn alloc] init]; + break; + case UILabelCountingMethodEaseOut: + self.counter = [[UILabelCounterEaseOut alloc] init]; + break; + case UILabelCountingMethodEaseInOut: + self.counter = [[UILabelCounterEaseInOut alloc] init]; + break; + } + + CADisplayLink *timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(updateValue:)]; + timer.frameInterval = 2; + [timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode]; + [timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:UITrackingRunLoopMode]; + self.timer = timer; +} + +- (void)countFromCurrentValueTo:(CGFloat)endValue { + [self countFrom:[self currentValue] to:endValue]; +} + +- (void)countFromCurrentValueTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration { + [self countFrom:[self currentValue] to:endValue withDuration:duration]; +} + +- (void)countFromZeroTo:(CGFloat)endValue { + [self countFrom:0.0f to:endValue]; +} + +- (void)countFromZeroTo:(CGFloat)endValue withDuration:(NSTimeInterval)duration { + [self countFrom:0.0f to:endValue withDuration:duration]; +} + +- (void)updateValue:(NSTimer *)timer { + + // update progress + NSTimeInterval now = [NSDate timeIntervalSinceReferenceDate]; + self.progress += now - self.lastUpdate; + self.lastUpdate = now; + + if (self.progress >= self.totalTime) { + [self.timer invalidate]; + self.timer = nil; + self.progress = self.totalTime; + } + + [self setTextValue:[self currentValue]]; + + if (self.progress == self.totalTime) { + [self runCompletionBlock]; + } +} + +- (void)setTextValue:(CGFloat)value +{ + if (self.attributedFormatBlock != nil) { + self.attributedText = self.attributedFormatBlock(value); + } + else if(self.formatBlock != nil) + { + self.text = self.formatBlock(value); + } + else + { + // check if counting with ints - cast to int + if([self.format rangeOfString:@"%(.*)d" options:NSRegularExpressionSearch].location != NSNotFound || [self.format rangeOfString:@"%(.*)i"].location != NSNotFound ) + { +// self.text = [NSString stringWithFormat:self.format,(int)value]; + self.text = [self countNumAndChangeformat:(int)value]; + } + else + { +// self.text = [NSString stringWithFormat:self.format,value]; + self.text = [self countNumAndChangeformat:value]; + } + } +} + +- (void)setFormat:(NSString *)format { + _format = format; + // update label with new format + [self setTextValue:self.currentValue]; +} + +- (NSString *)countNumAndChangeformat:(int)tmpNum { + + NSString *num = [NSString stringWithFormat:@"%d", tmpNum]; + + int count = 0; + long long int a = num.longLongValue; + while (a != 0) { + count++; + a /= 10; + } + NSMutableString *string = [NSMutableString stringWithString:num]; + NSMutableString *newstring = [NSMutableString string]; + while (count > 3) { + count -= 3; + NSRange rang = NSMakeRange(string.length - 3, 3); + NSString *str = [string substringWithRange:rang]; + [newstring insertString:str atIndex:0]; + [newstring insertString:@"," atIndex:0]; + [string deleteCharactersInRange:rang]; + } + [newstring insertString:string atIndex:0]; + return newstring; +} + + +- (void)runCompletionBlock { + + if (self.completionBlock) { + self.completionBlock(); + self.completionBlock = nil; + } +} + +- (CGFloat)currentValue { + + if (self.progress >= self.totalTime) { + return self.destinationValue; + } + + CGFloat percent = self.progress / self.totalTime; + CGFloat updateVal = [self.counter update:percent]; + return self.startingValue + (updateVal * (self.destinationValue - self.startingValue)); +} + +@end diff --git a/LYToolsKit/Utility/UIView/LYCoverView.h b/LYToolsKit/Utility/UIView/LYCoverView.h new file mode 100644 index 0000000..130a3bc --- /dev/null +++ b/LYToolsKit/Utility/UIView/LYCoverView.h @@ -0,0 +1,31 @@ +// +// LYCoverView.h +// LYUI +// +// Created by 吴浪 on 16/6/7. +// Copyright © 2016年 LY. All rights reserved. +// 遮罩层 + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface LYCoverView : UIView + +/** 遮罩层 + + @param view 需要被展示的视图,默认:居中,可通过Masonry修改位置 + @param inView view展示在inView中 + @return 遮罩层 + */ ++ (instancetype)showView:(UIView *)view inView:(UIView *)inView; +/** 取消遮罩层 */ +- (void)disMiss; + +@property (nonatomic, strong) UIColor *coverColor; /**< 遮罩层颜色 */ +@property (nonatomic, assign) BOOL touchDisMiss; /**< 触摸阴影层消失,默认=YES */ +@property (nonatomic, copy) void (^touchDidDisMiss)(void); /**< touchDisMiss=YES 时有效 */ + +@end + +NS_ASSUME_NONNULL_END diff --git a/LYToolsKit/Utility/UIView/LYCoverView.m b/LYToolsKit/Utility/UIView/LYCoverView.m new file mode 100644 index 0000000..9d69abf --- /dev/null +++ b/LYToolsKit/Utility/UIView/LYCoverView.m @@ -0,0 +1,81 @@ +// +// LYCoverView.m +// LYUI +// +// Created by 吴浪 on 16/6/7. +// Copyright © 2016年 LY. All rights reserved. +// + +#import "LYCoverView.h" +#import "UIView+LYExt.h" + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wmissing-noescape" +#import +#pragma clang diagnostic pop + +@interface LYCoverView () +@property (nonatomic, weak) UIView *contentView; +@end + +@implementation LYCoverView + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + _touchDisMiss = YES; + + UIView *contentView = [UIView ly_ViewWithColor:[UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5]]; + UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction)]; + [contentView addGestureRecognizer:tap]; + [self addSubview:contentView]; + _contentView = contentView; + [_contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + } + return self; +} + +- (void)setCoverColor:(UIColor *)coverColor { + _coverColor = coverColor; + self.contentView.backgroundColor = _coverColor; +} + ++ (instancetype)showView:(UIView *)view inView:(UIView *)inView { + if (inView) { + LYCoverView *coverView = [self ly_ViewWithColor:[UIColor clearColor]]; + if (view) { + [coverView addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(coverView); + }]; + } + + [inView addSubview:coverView]; + [coverView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(inView); + make.size.equalTo(inView); + }]; + return coverView; + } else { + NSAssert(inView, @"inView is nil"); + return nil; + } +} + +- (void)tapAction { + if (self.touchDisMiss) { + [self disMiss]; + if (self.touchDidDisMiss) { + self.touchDidDisMiss(); + } + } +} + +- (void)disMiss { + if (self.superview) { + [self removeFromSuperview]; + } +} + +@end