├── .github
├── FUNDING.yml
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
├── .gitignore
├── .travis.yml
├── Example
├── LCActionSheet.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── LCActionSheet-Example.xcscheme
├── LCActionSheet.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── LCActionSheet
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ ├── Contents.json
│ │ └── ratchet.imageset
│ │ │ ├── Contents.json
│ │ │ └── ratchet@3x.png
│ ├── LCActionSheet-Info.plist
│ ├── LCActionSheet-Prefix.pch
│ ├── LCAppDelegate.h
│ ├── LCAppDelegate.m
│ ├── LCViewController.h
│ ├── LCViewController.m
│ ├── en.lproj
│ │ └── InfoPlist.strings
│ └── main.m
├── Podfile
├── Podfile.lock
├── Pods
│ ├── Local Podspecs
│ │ └── LCActionSheet.podspec.json
│ ├── Manifest.lock
│ ├── Masonry
│ │ ├── LICENSE
│ │ ├── Masonry
│ │ │ ├── MASCompositeConstraint.h
│ │ │ ├── MASCompositeConstraint.m
│ │ │ ├── MASConstraint+Private.h
│ │ │ ├── MASConstraint.h
│ │ │ ├── MASConstraint.m
│ │ │ ├── MASConstraintMaker.h
│ │ │ ├── MASConstraintMaker.m
│ │ │ ├── MASLayoutConstraint.h
│ │ │ ├── MASLayoutConstraint.m
│ │ │ ├── MASUtilities.h
│ │ │ ├── MASViewAttribute.h
│ │ │ ├── MASViewAttribute.m
│ │ │ ├── MASViewConstraint.h
│ │ │ ├── MASViewConstraint.m
│ │ │ ├── Masonry.h
│ │ │ ├── NSArray+MASAdditions.h
│ │ │ ├── NSArray+MASAdditions.m
│ │ │ ├── NSArray+MASShorthandAdditions.h
│ │ │ ├── NSLayoutConstraint+MASDebugAdditions.h
│ │ │ ├── NSLayoutConstraint+MASDebugAdditions.m
│ │ │ ├── View+MASAdditions.h
│ │ │ ├── View+MASAdditions.m
│ │ │ ├── View+MASShorthandAdditions.h
│ │ │ ├── ViewController+MASAdditions.h
│ │ │ └── ViewController+MASAdditions.m
│ │ └── README.md
│ ├── Pods.xcodeproj
│ │ └── project.pbxproj
│ ├── Reveal-SDK
│ │ └── RevealServer-21
│ │ │ ├── LICENSE.md
│ │ │ └── iOS
│ │ │ └── RevealServer.framework
│ │ │ ├── Headers
│ │ │ └── RevealServer.h
│ │ │ ├── Info.plist
│ │ │ ├── Modules
│ │ │ └── module.modulemap
│ │ │ ├── RevealServer
│ │ │ ├── Scripts
│ │ │ └── copy_and_codesign_revealserver.sh
│ │ │ └── _CodeSignature
│ │ │ └── CodeResources
│ └── Target Support Files
│ │ ├── LCActionSheet
│ │ ├── LCActionSheet-Info.plist
│ │ ├── LCActionSheet-dummy.m
│ │ ├── LCActionSheet-prefix.pch
│ │ ├── LCActionSheet-umbrella.h
│ │ ├── LCActionSheet.modulemap
│ │ └── LCActionSheet.xcconfig
│ │ ├── Masonry
│ │ ├── Masonry-Info.plist
│ │ ├── Masonry-dummy.m
│ │ ├── Masonry-prefix.pch
│ │ ├── Masonry-umbrella.h
│ │ ├── Masonry.modulemap
│ │ └── Masonry.xcconfig
│ │ ├── Pods-LCActionSheet_Example
│ │ ├── Pods-LCActionSheet_Example-Info.plist
│ │ ├── Pods-LCActionSheet_Example-acknowledgements.markdown
│ │ ├── Pods-LCActionSheet_Example-acknowledgements.plist
│ │ ├── Pods-LCActionSheet_Example-dummy.m
│ │ ├── Pods-LCActionSheet_Example-frameworks.sh
│ │ ├── Pods-LCActionSheet_Example-umbrella.h
│ │ ├── Pods-LCActionSheet_Example.debug.xcconfig
│ │ ├── Pods-LCActionSheet_Example.modulemap
│ │ └── Pods-LCActionSheet_Example.release.xcconfig
│ │ ├── Pods-LCActionSheet_Tests
│ │ ├── Pods-LCActionSheet_Tests-Info.plist
│ │ ├── Pods-LCActionSheet_Tests-acknowledgements.markdown
│ │ ├── Pods-LCActionSheet_Tests-acknowledgements.plist
│ │ ├── Pods-LCActionSheet_Tests-dummy.m
│ │ ├── Pods-LCActionSheet_Tests-umbrella.h
│ │ ├── Pods-LCActionSheet_Tests.debug.xcconfig
│ │ ├── Pods-LCActionSheet_Tests.modulemap
│ │ └── Pods-LCActionSheet_Tests.release.xcconfig
│ │ └── Reveal-SDK
│ │ └── Reveal-SDK.xcconfig
└── Tests
│ ├── Tests-Info.plist
│ ├── Tests-Prefix.pch
│ ├── Tests.m
│ └── en.lproj
│ └── InfoPlist.strings
├── LCActionSheet.podspec
├── LCActionSheet
├── Assets
│ └── .gitkeep
└── Classes
│ ├── .gitkeep
│ ├── LCActionSheet.h
│ ├── LCActionSheet.m
│ ├── LCActionSheetCell.h
│ ├── LCActionSheetCell.m
│ ├── LCActionSheetConfig.h
│ ├── LCActionSheetConfig.m
│ ├── LCActionSheetViewController.h
│ ├── LCActionSheetViewController.m
│ ├── UIDevice+LCActionSheet.h
│ ├── UIDevice+LCActionSheet.m
│ ├── UIImage+LCActionSheet.h
│ └── UIImage+LCActionSheet.m
├── LICENSE
├── Preview
├── LCActionSheetDemo01.png
├── LCActionSheetDemo02.png
├── LCActionSheetDemo03.png
├── LCActionSheetDemoGif01.gif
├── LCActionSheetDemoGif02.gif
└── LCActionSheetDemoGif03.webp
├── README.md
├── README_zh-CN.md
├── _Pods.xcodeproj
└── _config.yml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: ['https://paypal.me/LeoDaxia'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xcuserstate
23 |
24 | ## Obj-C/Swift specific
25 | *.hmap
26 | *.ipa
27 | *.dSYM.zip
28 | *.dSYM
29 |
30 | ## Playgrounds
31 | timeline.xctimeline
32 | playground.xcworkspace
33 |
34 | # Swift Package Manager
35 | #
36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
37 | # Packages/
38 | .build/
39 |
40 | # CocoaPods
41 | #
42 | # We recommend against adding the Pods directory to your .gitignore. However
43 | # you should judge for yourself, the pros and cons are mentioned at:
44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
45 | #
46 | # Pods/
47 |
48 | # Carthage
49 | #
50 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
51 | # Carthage/Checkouts
52 |
53 | Carthage/Build
54 |
55 | # fastlane
56 | #
57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
58 | # screenshots whenever they are needed.
59 | # For more information about the recommended setup visit:
60 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
61 |
62 | fastlane/report.xml
63 | fastlane/Preview.html
64 | fastlane/screenshots
65 | fastlane/test_output
66 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # references:
2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/
3 | # * https://github.com/supermarin/xcpretty#usage
4 |
5 | osx_image: xcode10.2
6 | language: objective-c
7 | # cache: cocoapods
8 | # podfile: Example/Podfile
9 | # before_install:
10 | # - gem install cocoapods # Since Travis is not always on latest version
11 | # - pod install --project-directory=Example
12 | script:
13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/LCActionSheet.xcworkspace -scheme LCActionSheet-Example -sdk iphonesimulator12.2 ONLY_ACTIVE_ARCH=NO | xcpretty
14 | - pod lib lint
15 |
--------------------------------------------------------------------------------
/Example/LCActionSheet.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Example/LCActionSheet.xcodeproj/xcshareddata/xcschemes/LCActionSheet-Example.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
42 |
43 |
49 |
50 |
51 |
52 |
53 |
54 |
64 |
66 |
72 |
73 |
74 |
75 |
76 |
77 |
83 |
85 |
91 |
92 |
93 |
94 |
96 |
97 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/Example/LCActionSheet.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Example/LCActionSheet.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
41 |
55 |
69 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
99 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Example/LCActionSheet/Images.xcassets/ratchet.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "scale" : "2x"
10 | },
11 | {
12 | "idiom" : "universal",
13 | "filename" : "ratchet@3x.png",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Example/LCActionSheet/Images.xcassets/ratchet.imageset/ratchet@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Example/LCActionSheet/Images.xcassets/ratchet.imageset/ratchet@3x.png
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCActionSheet-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${PRODUCT_NAME}
9 | CFBundleExecutable
10 | ${EXECUTABLE_NAME}
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${PRODUCT_NAME}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1.0
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCActionSheet-Prefix.pch:
--------------------------------------------------------------------------------
1 | //
2 | // Prefix header
3 | //
4 | // The contents of this file are implicitly included at the beginning of every source file.
5 | //
6 |
7 | #import
8 |
9 | #ifndef __IPHONE_5_0
10 | #warning "This project uses features only available in iOS SDK 5.0 and later."
11 | #endif
12 |
13 | #ifdef __OBJC__
14 | @import UIKit;
15 | @import Foundation;
16 | #endif
17 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCAppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCAppDelegate.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 03/12/2019.
6 | // Copyright (c) 2019 Leo. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface LCAppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCAppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCAppDelegate.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 03/12/2019.
6 | // Copyright (c) 2019 Leo. All rights reserved.
7 | //
8 |
9 | #import "LCAppDelegate.h"
10 |
11 | @implementation LCAppDelegate
12 |
13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
14 | {
15 | // Override point for customization after application launch.
16 | return YES;
17 | }
18 |
19 | - (void)applicationWillResignActive:(UIApplication *)application
20 | {
21 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
22 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
23 | }
24 |
25 | - (void)applicationDidEnterBackground:(UIApplication *)application
26 | {
27 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
29 | }
30 |
31 | - (void)applicationWillEnterForeground:(UIApplication *)application
32 | {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | - (void)applicationDidBecomeActive:(UIApplication *)application
37 | {
38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
39 | }
40 |
41 | - (void)applicationWillTerminate:(UIApplication *)application
42 | {
43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCViewController.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 03/12/2019.
6 | // Copyright (c) 2019 Leo. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 |
11 | @interface LCViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/LCViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCViewController.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 03/12/2019.
6 | // Copyright (c) 2019 Leo. All rights reserved.
7 | //
8 |
9 | #import "LCViewController.h"
10 | #import
11 | #import
12 | #import
13 |
14 | #define KEY_WINDOW [UIApplication sharedApplication].keyWindow
15 |
16 | @interface LCViewController ()
17 |
18 | @end
19 |
20 | @implementation LCViewController
21 |
22 | //- (BOOL)prefersStatusBarHidden {
23 | // return YES;
24 | //}
25 |
26 | - (UIStatusBarStyle)preferredStatusBarStyle {
27 | return UIStatusBarStyleLightContent;
28 | }
29 |
30 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
31 | [self.view endEditing:YES];
32 | }
33 |
34 | - (void)viewDidLoad {
35 | [super viewDidLoad];
36 |
37 | UITextField *textField = [[UITextField alloc] init];
38 | textField.leftViewMode = UITextFieldViewModeAlways;
39 | textField.leftView = ({
40 | UIView *view = [[UIView alloc] init];
41 | view.frame = CGRectMake(0, 0, 8.0, 0);
42 | view;
43 | });
44 | textField.placeholder = @"Tap screen to hide keyboard..";
45 | textField.backgroundColor = [UIColor whiteColor];
46 | textField.layer.cornerRadius = 4.0;
47 | textField.layer.shadowColor = [UIColor blackColor].CGColor;
48 | textField.layer.shadowRadius = 2;
49 | textField.layer.shadowOpacity = 0.3;
50 | textField.layer.shadowOffset = CGSizeMake(0, 1.2);
51 | [self.view addSubview:textField];
52 | [textField mas_makeConstraints:^(MASConstraintMaker *make) {
53 | make.left.equalTo(self.view).offset(10.0);
54 | make.right.equalTo(self.view).offset(-10.0);
55 | make.top.equalTo(self.view).offset(30.0 + ([[UIDevice currentDevice] lc_isX] ? 14.0 : 0));
56 | make.height.offset(44.0);
57 | }];
58 | }
59 |
60 | - (void)viewWillAppear:(BOOL)animated {
61 | [super viewWillAppear:animated];
62 |
63 | // [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
64 | // [UIApplication sharedApplication].statusBarHidden = YES;
65 | [self.navigationController setNavigationBarHidden:YES animated:NO];
66 |
67 | NSLog(@"App's keyWindow: %p", KEY_WINDOW);
68 | }
69 |
70 | - (IBAction)showDefaultActionSheet {
71 | LCActionSheet *actionSheet = [LCActionSheet sheetWithTitle:@""
72 | delegate:self
73 | cancelButtonTitle:@"Cancel"
74 | otherButtonTitles:@"Button 1", nil];
75 |
76 | // NSMutableIndexSet *indexSet = [[NSMutableIndexSet alloc] init];
77 | // [indexSet addIndex:1];
78 | // [indexSet addIndex:2];
79 | // actionSheet.destructiveButtonIndexSet = indexSet;
80 | // actionSheet.destructiveButtonColor = [UIColor blueColor];
81 | // actionSheet.destructiveButtonIndexSet = indexSet;
82 | // [actionSheet setButtonHeight:64];
83 | // [actionSheet setSeparatorColor:[UIColor clearColor]];
84 | // [actionSheet setTintColor:UIColor.blackColor];
85 | // [actionSheet setButtonColor:[UIColor whiteColor]];
86 | // [actionSheet setButtonBgColor:[UIColor blackColor]];
87 | // [actionSheet setDestructiveButtonColor:[UIColor blackColor]];
88 | // [actionSheet setCancelButtonColor:[UIColor blackColor]];
89 | //
90 | // [actionSheet setButtonFont:font];
91 | // [actionSheet setButtonCornerRadius:3];
92 |
93 | [actionSheet show];
94 | }
95 |
96 | - (IBAction)showCustomActionSheet {
97 | LCActionSheet *actionSheet = [[LCActionSheet alloc] initWithTitle:nil
98 | delegate:self
99 | cancelButtonTitle:@"Cancel"
100 | otherButtonTitles:@"Button 1", @"Button 2", @"Button 3", @"This is a very very very very very very long button title~", @"Button 5", nil];
101 | actionSheet.title = @"This is a very very very very very very very very very very very very very very very very very very very very very very very very very very very long title~";
102 | actionSheet.cancelButtonTitle = @"Close";
103 | [actionSheet appendButtonsWithTitles:@"Button 6", @"Button 7", nil];
104 | actionSheet.titleColor = [UIColor orangeColor];
105 | actionSheet.buttonColor = [UIColor greenColor];
106 | actionSheet.titleFont = [UIFont boldSystemFontOfSize:15.0f];
107 | actionSheet.buttonFont = [UIFont boldSystemFontOfSize:15.0f];
108 | actionSheet.buttonHeight = 60.0f;
109 | actionSheet.scrolling = YES;
110 | actionSheet.visibleButtonCount = 3.6f;
111 | actionSheet.darkViewNoTaped = YES;
112 | actionSheet.unBlur = YES;
113 |
114 | // V 2.1.0+ Use `destructiveButtonIndexSet` instead `redButtonIndexSet`.
115 | NSMutableIndexSet *indexSet = [[NSMutableIndexSet alloc] init];
116 | [indexSet addIndex:0];
117 | [indexSet addIndex:2];
118 | actionSheet.destructiveButtonIndexSet = indexSet;
119 | actionSheet.destructiveButtonColor = [UIColor blueColor];
120 |
121 | // V 2.7.0+
122 | actionSheet.titleEdgeInsets = UIEdgeInsetsMake(10, 20, 30, 40);
123 |
124 | // V 2.7.1+
125 | actionSheet.separatorColor = [UIColor orangeColor];
126 |
127 | // V 3.1.0+
128 | actionSheet.autoHideWhenDeviceRotated = YES;
129 |
130 | // V 3.2.4+
131 | actionSheet.numberOfTitleLines = 2;
132 |
133 | // // V 3.5.2+
134 | // actionSheet.disableAutoDismissAfterClicking = YES;
135 |
136 | [actionSheet show];
137 | }
138 |
139 | - (IBAction)showBlockActionSheet {
140 | // LCActionSheetConfig *config = LCActionSheetConfig.config;
141 | // config.buttonColor = [UIColor orangeColor];
142 |
143 | LCActionSheet *actionSheet = [LCActionSheet sheetWithTitle:@"Block LCActionSheet" cancelButtonTitle:@"Cancel" clicked:^(LCActionSheet *actionSheet, NSInteger buttonIndex) {
144 |
145 | NSLog(@"clickedButtonAtIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
146 |
147 | } otherButtonTitles:@"Button 1", @"Button 2", @"Button 3", @"Button 4", @"Button 5", @"Button 6", nil];
148 |
149 | // actionSheet.blurEffectStyle = UIBlurEffectStyleLight;
150 |
151 | actionSheet.scrolling = YES;
152 | actionSheet.visibleButtonCount = 3.6f;
153 |
154 | actionSheet.willPresentHandler = ^(LCActionSheet *actionSheet) {
155 | NSLog(@"willPresentActionSheet, keyWindow: %p", KEY_WINDOW);
156 | };
157 |
158 | actionSheet.didPresentHandler = ^(LCActionSheet *actionSheet) {
159 | NSLog(@"didPresentActionSheet, keyWindow: %p", KEY_WINDOW);
160 | };
161 |
162 | actionSheet.willDismissHandler = ^(LCActionSheet *actionSheet, NSInteger buttonIndex) {
163 | NSLog(@"willDismissWithButtonIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
164 | };
165 |
166 | actionSheet.didDismissHandler = ^(LCActionSheet *actionSheet, NSInteger buttonIndex) {
167 | NSLog(@"didDismissWithButtonIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
168 | };
169 |
170 | [actionSheet show];
171 |
172 |
173 | // Append buttons methods
174 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 2.0f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
175 | // [actionSheet appendButtonWithTitle:@"WoW" atIndex:7];
176 |
177 | NSMutableIndexSet *set = [[NSMutableIndexSet alloc] init];
178 | [set addIndex:1];
179 | [set addIndex:2];
180 | [actionSheet appendButtonsWithTitles:@[@"Hello", @"World"] atIndexes:set];
181 |
182 | // [actionSheet setButtonTitle:@"New Title" atIndex:1];
183 | });
184 | }
185 |
186 | - (IBAction)onChangeStyleAction {
187 | UIFont *font = [UIFont fontWithName:@"HelveticaNeue-Medium" size:16.0f];
188 |
189 | [LCActionSheetConfig.config setButtonHeight:64];
190 | [LCActionSheetConfig.config setSeparatorColor:[UIColor clearColor]];
191 | [LCActionSheetConfig.config setButtonColor:[UIColor whiteColor]];
192 | [LCActionSheetConfig.config setButtonBgColor:[UIColor blackColor]];
193 | [LCActionSheetConfig.config setButtonCornerRadius:3];
194 | [LCActionSheetConfig.config setCancelButtonColor:[UIColor blackColor]];
195 | // [LCActionSheetConfig.config setButtonEdgeInsets:UIEdgeInsetsMake(10, 20, 0, 20)];
196 | [LCActionSheetConfig.config setButtonFont:font];
197 |
198 | UILabel *label = [[UILabel alloc] init];
199 | label.backgroundColor = [UIColor lightGrayColor];
200 | label.alpha = 0;
201 | label.text = @"🤜🏻🤛🏻";
202 | label.textAlignment = NSTextAlignmentCenter;
203 | label.layer.cornerRadius = 8.0;
204 | label.layer.masksToBounds = YES;
205 | [self.view addSubview:label];
206 | [label mas_makeConstraints:^(MASConstraintMaker *make) {
207 | make.center.equalTo(self.view);
208 | make.size.mas_equalTo(CGSizeMake(150.0, 50.0));
209 | }];
210 |
211 | [UIView animateWithDuration:0.2 animations:^{
212 | label.alpha = 1.0;
213 | } completion:^(BOOL finished) {
214 | [UIView animateWithDuration:0.3 delay:2.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
215 | label.alpha = 0;
216 | } completion:^(BOOL finished) {
217 | [label removeFromSuperview];
218 | }];
219 | }];
220 | }
221 |
222 | #pragma mark - LCActionSheet Delegate
223 |
224 | - (void)actionSheet:(LCActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
225 | NSLog(@"clickedButtonAtIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
226 | }
227 |
228 | - (void)willPresentActionSheet:(LCActionSheet *)actionSheet {
229 | NSLog(@"willPresentActionSheet, keyWindow: %p", KEY_WINDOW);
230 | }
231 |
232 | - (void)didPresentActionSheet:(LCActionSheet *)actionSheet {
233 | NSLog(@"didPresentActionSheet, keyWindow: %p", KEY_WINDOW);
234 | }
235 |
236 | - (void)actionSheet:(LCActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex {
237 | NSLog(@"willDismissWithButtonIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
238 | }
239 |
240 | - (void)actionSheet:(LCActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex {
241 | NSLog(@"didDismissWithButtonIndex: %d, keyWindow: %p", (int)buttonIndex, KEY_WINDOW);
242 | }
243 |
244 | @end
245 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/Example/LCActionSheet/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 03/12/2019.
6 | // Copyright (c) 2019 Leo. All rights reserved.
7 | //
8 |
9 | @import UIKit;
10 | #import "LCAppDelegate.h"
11 |
12 | int main(int argc, char * argv[])
13 | {
14 | @autoreleasepool {
15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([LCAppDelegate class]));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Example/Podfile:
--------------------------------------------------------------------------------
1 | use_frameworks!
2 |
3 | platform :ios, '8.0'
4 |
5 | target 'LCActionSheet_Example' do
6 | pod 'LCActionSheet', :path => '../'
7 |
8 | pod 'Reveal-SDK', :configurations => ['Debug']
9 |
10 | target 'LCActionSheet_Tests' do
11 | inherit! :search_paths
12 |
13 |
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/Example/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - LCActionSheet (3.5.5):
3 | - Masonry (~> 1.1.0)
4 | - Masonry (1.1.0)
5 | - Reveal-SDK (21)
6 |
7 | DEPENDENCIES:
8 | - LCActionSheet (from `../`)
9 | - Reveal-SDK
10 |
11 | SPEC REPOS:
12 | https://github.com/cocoapods/specs.git:
13 | - Masonry
14 | - Reveal-SDK
15 |
16 | EXTERNAL SOURCES:
17 | LCActionSheet:
18 | :path: "../"
19 |
20 | SPEC CHECKSUMS:
21 | LCActionSheet: e2cfc47a2438c411336fe314dd0e760d8df3d95a
22 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
23 | Reveal-SDK: 3523e0eb7c562811c51bb71da6e523a6373702c8
24 |
25 | PODFILE CHECKSUM: d1c5359738e6459b34e6366aa6a8cd7fa303a04f
26 |
27 | COCOAPODS: 1.7.3
28 |
--------------------------------------------------------------------------------
/Example/Pods/Local Podspecs/LCActionSheet.podspec.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "LCActionSheet",
3 | "version": "3.5.5",
4 | "summary": "A simple, ornamental, but powerful action sheet! Support: https://LeoDev.me",
5 | "description": "A simple, ornamental, but powerful action sheet! Support: https://LeoDev.me\n一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。",
6 | "homepage": "https://github.com/iTofu/LCActionSheet",
7 | "license": {
8 | "type": "MIT",
9 | "file": "LICENSE"
10 | },
11 | "authors": {
12 | "Leo": "leodaxia@gmail.com"
13 | },
14 | "source": {
15 | "git": "https://github.com/iTofu/LCActionSheet.git",
16 | "tag": "3.5.5"
17 | },
18 | "social_media_url": "https://twitter.com/LeoDaxia",
19 | "swift_versions": "4.2",
20 | "platforms": {
21 | "ios": "8.0"
22 | },
23 | "source_files": "LCActionSheet/Classes/**/*",
24 | "dependencies": {
25 | "Masonry": [
26 | "~> 1.1.0"
27 | ]
28 | },
29 | "swift_version": "4.2"
30 | }
31 |
--------------------------------------------------------------------------------
/Example/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - LCActionSheet (3.5.5):
3 | - Masonry (~> 1.1.0)
4 | - Masonry (1.1.0)
5 | - Reveal-SDK (21)
6 |
7 | DEPENDENCIES:
8 | - LCActionSheet (from `../`)
9 | - Reveal-SDK
10 |
11 | SPEC REPOS:
12 | https://github.com/cocoapods/specs.git:
13 | - Masonry
14 | - Reveal-SDK
15 |
16 | EXTERNAL SOURCES:
17 | LCActionSheet:
18 | :path: "../"
19 |
20 | SPEC CHECKSUMS:
21 | LCActionSheet: e2cfc47a2438c411336fe314dd0e760d8df3d95a
22 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
23 | Reveal-SDK: 3523e0eb7c562811c51bb71da6e523a6373702c8
24 |
25 | PODFILE CHECKSUM: d1c5359738e6459b34e6366aa6a8cd7fa303a04f
26 |
27 | COCOAPODS: 1.7.3
28 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASCompositeConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | /**
13 | * A group of MASConstraint objects
14 | */
15 | @interface MASCompositeConstraint : MASConstraint
16 |
17 | /**
18 | * Creates a composite with a predefined array of children
19 | *
20 | * @param children child MASConstraints
21 | *
22 | * @return a composite constraint
23 | */
24 | - (id)initWithChildren:(NSArray *)children;
25 |
26 | @end
27 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASCompositeConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASCompositeConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASCompositeConstraint.h"
10 | #import "MASConstraint+Private.h"
11 |
12 | @interface MASCompositeConstraint ()
13 |
14 | @property (nonatomic, strong) id mas_key;
15 | @property (nonatomic, strong) NSMutableArray *childConstraints;
16 |
17 | @end
18 |
19 | @implementation MASCompositeConstraint
20 |
21 | - (id)initWithChildren:(NSArray *)children {
22 | self = [super init];
23 | if (!self) return nil;
24 |
25 | _childConstraints = [children mutableCopy];
26 | for (MASConstraint *constraint in _childConstraints) {
27 | constraint.delegate = self;
28 | }
29 |
30 | return self;
31 | }
32 |
33 | #pragma mark - MASConstraintDelegate
34 |
35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
36 | NSUInteger index = [self.childConstraints indexOfObject:constraint];
37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint];
39 | }
40 |
41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
42 | id strongDelegate = self.delegate;
43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
44 | newConstraint.delegate = self;
45 | [self.childConstraints addObject:newConstraint];
46 | return newConstraint;
47 | }
48 |
49 | #pragma mark - NSLayoutConstraint multiplier proxies
50 |
51 | - (MASConstraint * (^)(CGFloat))multipliedBy {
52 | return ^id(CGFloat multiplier) {
53 | for (MASConstraint *constraint in self.childConstraints) {
54 | constraint.multipliedBy(multiplier);
55 | }
56 | return self;
57 | };
58 | }
59 |
60 | - (MASConstraint * (^)(CGFloat))dividedBy {
61 | return ^id(CGFloat divider) {
62 | for (MASConstraint *constraint in self.childConstraints) {
63 | constraint.dividedBy(divider);
64 | }
65 | return self;
66 | };
67 | }
68 |
69 | #pragma mark - MASLayoutPriority proxy
70 |
71 | - (MASConstraint * (^)(MASLayoutPriority))priority {
72 | return ^id(MASLayoutPriority priority) {
73 | for (MASConstraint *constraint in self.childConstraints) {
74 | constraint.priority(priority);
75 | }
76 | return self;
77 | };
78 | }
79 |
80 | #pragma mark - NSLayoutRelation proxy
81 |
82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation {
83 | return ^id(id attr, NSLayoutRelation relation) {
84 | for (MASConstraint *constraint in self.childConstraints.copy) {
85 | constraint.equalToWithRelation(attr, relation);
86 | }
87 | return self;
88 | };
89 | }
90 |
91 | #pragma mark - attribute chaining
92 |
93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute];
95 | return self;
96 | }
97 |
98 | #pragma mark - Animator proxy
99 |
100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
101 |
102 | - (MASConstraint *)animator {
103 | for (MASConstraint *constraint in self.childConstraints) {
104 | [constraint animator];
105 | }
106 | return self;
107 | }
108 |
109 | #endif
110 |
111 | #pragma mark - debug helpers
112 |
113 | - (MASConstraint * (^)(id))key {
114 | return ^id(id key) {
115 | self.mas_key = key;
116 | int i = 0;
117 | for (MASConstraint *constraint in self.childConstraints) {
118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]);
119 | }
120 | return self;
121 | };
122 | }
123 |
124 | #pragma mark - NSLayoutConstraint constant setters
125 |
126 | - (void)setInsets:(MASEdgeInsets)insets {
127 | for (MASConstraint *constraint in self.childConstraints) {
128 | constraint.insets = insets;
129 | }
130 | }
131 |
132 | - (void)setInset:(CGFloat)inset {
133 | for (MASConstraint *constraint in self.childConstraints) {
134 | constraint.inset = inset;
135 | }
136 | }
137 |
138 | - (void)setOffset:(CGFloat)offset {
139 | for (MASConstraint *constraint in self.childConstraints) {
140 | constraint.offset = offset;
141 | }
142 | }
143 |
144 | - (void)setSizeOffset:(CGSize)sizeOffset {
145 | for (MASConstraint *constraint in self.childConstraints) {
146 | constraint.sizeOffset = sizeOffset;
147 | }
148 | }
149 |
150 | - (void)setCenterOffset:(CGPoint)centerOffset {
151 | for (MASConstraint *constraint in self.childConstraints) {
152 | constraint.centerOffset = centerOffset;
153 | }
154 | }
155 |
156 | #pragma mark - MASConstraint
157 |
158 | - (void)activate {
159 | for (MASConstraint *constraint in self.childConstraints) {
160 | [constraint activate];
161 | }
162 | }
163 |
164 | - (void)deactivate {
165 | for (MASConstraint *constraint in self.childConstraints) {
166 | [constraint deactivate];
167 | }
168 | }
169 |
170 | - (void)install {
171 | for (MASConstraint *constraint in self.childConstraints) {
172 | constraint.updateExisting = self.updateExisting;
173 | [constraint install];
174 | }
175 | }
176 |
177 | - (void)uninstall {
178 | for (MASConstraint *constraint in self.childConstraints) {
179 | [constraint uninstall];
180 | }
181 | }
182 |
183 | @end
184 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraint+Private.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint+Private.h
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 29/04/14.
6 | // Copyright (c) 2014 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 |
11 | @protocol MASConstraintDelegate;
12 |
13 |
14 | @interface MASConstraint ()
15 |
16 | /**
17 | * Whether or not to check for an existing constraint instead of adding constraint
18 | */
19 | @property (nonatomic, assign) BOOL updateExisting;
20 |
21 | /**
22 | * Usually MASConstraintMaker but could be a parent MASConstraint
23 | */
24 | @property (nonatomic, weak) id delegate;
25 |
26 | /**
27 | * Based on a provided value type, is equal to calling:
28 | * NSNumber - setOffset:
29 | * NSValue with CGPoint - setPointOffset:
30 | * NSValue with CGSize - setSizeOffset:
31 | * NSValue with MASEdgeInsets - setInsets:
32 | */
33 | - (void)setLayoutConstantWithValue:(NSValue *)value;
34 |
35 | @end
36 |
37 |
38 | @interface MASConstraint (Abstract)
39 |
40 | /**
41 | * Sets the constraint relation to given NSLayoutRelation
42 | * returns a block which accepts one of the following:
43 | * MASViewAttribute, UIView, NSValue, NSArray
44 | * see readme for more details.
45 | */
46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation;
47 |
48 | /**
49 | * Override to set a custom chaining behaviour
50 | */
51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
52 |
53 | @end
54 |
55 |
56 | @protocol MASConstraintDelegate
57 |
58 | /**
59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example
60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks
61 | */
62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint;
63 |
64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute;
65 |
66 | @end
67 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * Enables Constraints to be created with chainable syntax
13 | * Constraint can represent single NSLayoutConstraint (MASViewConstraint)
14 | * or a group of NSLayoutConstraints (MASComposisteConstraint)
15 | */
16 | @interface MASConstraint : NSObject
17 |
18 | // Chaining Support
19 |
20 | /**
21 | * Modifies the NSLayoutConstraint constant,
22 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
23 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
24 | */
25 | - (MASConstraint * (^)(MASEdgeInsets insets))insets;
26 |
27 | /**
28 | * Modifies the NSLayoutConstraint constant,
29 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
30 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
31 | */
32 | - (MASConstraint * (^)(CGFloat inset))inset;
33 |
34 | /**
35 | * Modifies the NSLayoutConstraint constant,
36 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
37 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight
38 | */
39 | - (MASConstraint * (^)(CGSize offset))sizeOffset;
40 |
41 | /**
42 | * Modifies the NSLayoutConstraint constant,
43 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
44 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
45 | */
46 | - (MASConstraint * (^)(CGPoint offset))centerOffset;
47 |
48 | /**
49 | * Modifies the NSLayoutConstraint constant
50 | */
51 | - (MASConstraint * (^)(CGFloat offset))offset;
52 |
53 | /**
54 | * Modifies the NSLayoutConstraint constant based on a value type
55 | */
56 | - (MASConstraint * (^)(NSValue *value))valueOffset;
57 |
58 | /**
59 | * Sets the NSLayoutConstraint multiplier property
60 | */
61 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy;
62 |
63 | /**
64 | * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy
65 | */
66 | - (MASConstraint * (^)(CGFloat divider))dividedBy;
67 |
68 | /**
69 | * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority
70 | */
71 | - (MASConstraint * (^)(MASLayoutPriority priority))priority;
72 |
73 | /**
74 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow
75 | */
76 | - (MASConstraint * (^)(void))priorityLow;
77 |
78 | /**
79 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium
80 | */
81 | - (MASConstraint * (^)(void))priorityMedium;
82 |
83 | /**
84 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh
85 | */
86 | - (MASConstraint * (^)(void))priorityHigh;
87 |
88 | /**
89 | * Sets the constraint relation to NSLayoutRelationEqual
90 | * returns a block which accepts one of the following:
91 | * MASViewAttribute, UIView, NSValue, NSArray
92 | * see readme for more details.
93 | */
94 | - (MASConstraint * (^)(id attr))equalTo;
95 |
96 | /**
97 | * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual
98 | * returns a block which accepts one of the following:
99 | * MASViewAttribute, UIView, NSValue, NSArray
100 | * see readme for more details.
101 | */
102 | - (MASConstraint * (^)(id attr))greaterThanOrEqualTo;
103 |
104 | /**
105 | * Sets the constraint relation to NSLayoutRelationLessThanOrEqual
106 | * returns a block which accepts one of the following:
107 | * MASViewAttribute, UIView, NSValue, NSArray
108 | * see readme for more details.
109 | */
110 | - (MASConstraint * (^)(id attr))lessThanOrEqualTo;
111 |
112 | /**
113 | * Optional semantic property which has no effect but improves the readability of constraint
114 | */
115 | - (MASConstraint *)with;
116 |
117 | /**
118 | * Optional semantic property which has no effect but improves the readability of constraint
119 | */
120 | - (MASConstraint *)and;
121 |
122 | /**
123 | * Creates a new MASCompositeConstraint with the called attribute and reciever
124 | */
125 | - (MASConstraint *)left;
126 | - (MASConstraint *)top;
127 | - (MASConstraint *)right;
128 | - (MASConstraint *)bottom;
129 | - (MASConstraint *)leading;
130 | - (MASConstraint *)trailing;
131 | - (MASConstraint *)width;
132 | - (MASConstraint *)height;
133 | - (MASConstraint *)centerX;
134 | - (MASConstraint *)centerY;
135 | - (MASConstraint *)baseline;
136 |
137 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
138 |
139 | - (MASConstraint *)firstBaseline;
140 | - (MASConstraint *)lastBaseline;
141 |
142 | #endif
143 |
144 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
145 |
146 | - (MASConstraint *)leftMargin;
147 | - (MASConstraint *)rightMargin;
148 | - (MASConstraint *)topMargin;
149 | - (MASConstraint *)bottomMargin;
150 | - (MASConstraint *)leadingMargin;
151 | - (MASConstraint *)trailingMargin;
152 | - (MASConstraint *)centerXWithinMargins;
153 | - (MASConstraint *)centerYWithinMargins;
154 |
155 | #endif
156 |
157 |
158 | /**
159 | * Sets the constraint debug name
160 | */
161 | - (MASConstraint * (^)(id key))key;
162 |
163 | // NSLayoutConstraint constant Setters
164 | // for use outside of mas_updateConstraints/mas_makeConstraints blocks
165 |
166 | /**
167 | * Modifies the NSLayoutConstraint constant,
168 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
169 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
170 | */
171 | - (void)setInsets:(MASEdgeInsets)insets;
172 |
173 | /**
174 | * Modifies the NSLayoutConstraint constant,
175 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
176 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight
177 | */
178 | - (void)setInset:(CGFloat)inset;
179 |
180 | /**
181 | * Modifies the NSLayoutConstraint constant,
182 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
183 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight
184 | */
185 | - (void)setSizeOffset:(CGSize)sizeOffset;
186 |
187 | /**
188 | * Modifies the NSLayoutConstraint constant,
189 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following
190 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY
191 | */
192 | - (void)setCenterOffset:(CGPoint)centerOffset;
193 |
194 | /**
195 | * Modifies the NSLayoutConstraint constant
196 | */
197 | - (void)setOffset:(CGFloat)offset;
198 |
199 |
200 | // NSLayoutConstraint Installation support
201 |
202 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
203 | /**
204 | * Whether or not to go through the animator proxy when modifying the constraint
205 | */
206 | @property (nonatomic, copy, readonly) MASConstraint *animator;
207 | #endif
208 |
209 | /**
210 | * Activates an NSLayoutConstraint if it's supported by an OS.
211 | * Invokes install otherwise.
212 | */
213 | - (void)activate;
214 |
215 | /**
216 | * Deactivates previously installed/activated NSLayoutConstraint.
217 | */
218 | - (void)deactivate;
219 |
220 | /**
221 | * Creates a NSLayoutConstraint and adds it to the appropriate view.
222 | */
223 | - (void)install;
224 |
225 | /**
226 | * Removes previously installed NSLayoutConstraint
227 | */
228 | - (void)uninstall;
229 |
230 | @end
231 |
232 |
233 | /**
234 | * Convenience auto-boxing macros for MASConstraint methods.
235 | *
236 | * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax.
237 | * A potential drawback of this is that the unprefixed macros will appear in global scope.
238 | */
239 | #define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__)))
240 | #define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
241 | #define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__)))
242 |
243 | #define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__)))
244 |
245 |
246 | #ifdef MAS_SHORTHAND_GLOBALS
247 |
248 | #define equalTo(...) mas_equalTo(__VA_ARGS__)
249 | #define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__)
250 | #define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__)
251 |
252 | #define offset(...) mas_offset(__VA_ARGS__)
253 |
254 | #endif
255 |
256 |
257 | @interface MASConstraint (AutoboxingSupport)
258 |
259 | /**
260 | * Aliases to corresponding relation methods (for shorthand macros)
261 | * Also needed to aid autocompletion
262 | */
263 | - (MASConstraint * (^)(id attr))mas_equalTo;
264 | - (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo;
265 | - (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo;
266 |
267 | /**
268 | * A dummy method to aid autocompletion
269 | */
270 | - (MASConstraint * (^)(id offset))mas_offset;
271 |
272 | @end
273 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraint.m
3 | // Masonry
4 | //
5 | // Created by Nick Tymchenko on 1/20/14.
6 | //
7 |
8 | #import "MASConstraint.h"
9 | #import "MASConstraint+Private.h"
10 |
11 | #define MASMethodNotImplemented() \
12 | @throw [NSException exceptionWithName:NSInternalInconsistencyException \
13 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \
14 | userInfo:nil]
15 |
16 | @implementation MASConstraint
17 |
18 | #pragma mark - Init
19 |
20 | - (id)init {
21 | NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly.");
22 | return [super init];
23 | }
24 |
25 | #pragma mark - NSLayoutRelation proxies
26 |
27 | - (MASConstraint * (^)(id))equalTo {
28 | return ^id(id attribute) {
29 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
30 | };
31 | }
32 |
33 | - (MASConstraint * (^)(id))mas_equalTo {
34 | return ^id(id attribute) {
35 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual);
36 | };
37 | }
38 |
39 | - (MASConstraint * (^)(id))greaterThanOrEqualTo {
40 | return ^id(id attribute) {
41 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
42 | };
43 | }
44 |
45 | - (MASConstraint * (^)(id))mas_greaterThanOrEqualTo {
46 | return ^id(id attribute) {
47 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual);
48 | };
49 | }
50 |
51 | - (MASConstraint * (^)(id))lessThanOrEqualTo {
52 | return ^id(id attribute) {
53 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
54 | };
55 | }
56 |
57 | - (MASConstraint * (^)(id))mas_lessThanOrEqualTo {
58 | return ^id(id attribute) {
59 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual);
60 | };
61 | }
62 |
63 | #pragma mark - MASLayoutPriority proxies
64 |
65 | - (MASConstraint * (^)(void))priorityLow {
66 | return ^id{
67 | self.priority(MASLayoutPriorityDefaultLow);
68 | return self;
69 | };
70 | }
71 |
72 | - (MASConstraint * (^)(void))priorityMedium {
73 | return ^id{
74 | self.priority(MASLayoutPriorityDefaultMedium);
75 | return self;
76 | };
77 | }
78 |
79 | - (MASConstraint * (^)(void))priorityHigh {
80 | return ^id{
81 | self.priority(MASLayoutPriorityDefaultHigh);
82 | return self;
83 | };
84 | }
85 |
86 | #pragma mark - NSLayoutConstraint constant proxies
87 |
88 | - (MASConstraint * (^)(MASEdgeInsets))insets {
89 | return ^id(MASEdgeInsets insets){
90 | self.insets = insets;
91 | return self;
92 | };
93 | }
94 |
95 | - (MASConstraint * (^)(CGFloat))inset {
96 | return ^id(CGFloat inset){
97 | self.inset = inset;
98 | return self;
99 | };
100 | }
101 |
102 | - (MASConstraint * (^)(CGSize))sizeOffset {
103 | return ^id(CGSize offset) {
104 | self.sizeOffset = offset;
105 | return self;
106 | };
107 | }
108 |
109 | - (MASConstraint * (^)(CGPoint))centerOffset {
110 | return ^id(CGPoint offset) {
111 | self.centerOffset = offset;
112 | return self;
113 | };
114 | }
115 |
116 | - (MASConstraint * (^)(CGFloat))offset {
117 | return ^id(CGFloat offset){
118 | self.offset = offset;
119 | return self;
120 | };
121 | }
122 |
123 | - (MASConstraint * (^)(NSValue *value))valueOffset {
124 | return ^id(NSValue *offset) {
125 | NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset);
126 | [self setLayoutConstantWithValue:offset];
127 | return self;
128 | };
129 | }
130 |
131 | - (MASConstraint * (^)(id offset))mas_offset {
132 | // Will never be called due to macro
133 | return nil;
134 | }
135 |
136 | #pragma mark - NSLayoutConstraint constant setter
137 |
138 | - (void)setLayoutConstantWithValue:(NSValue *)value {
139 | if ([value isKindOfClass:NSNumber.class]) {
140 | self.offset = [(NSNumber *)value doubleValue];
141 | } else if (strcmp(value.objCType, @encode(CGPoint)) == 0) {
142 | CGPoint point;
143 | [value getValue:&point];
144 | self.centerOffset = point;
145 | } else if (strcmp(value.objCType, @encode(CGSize)) == 0) {
146 | CGSize size;
147 | [value getValue:&size];
148 | self.sizeOffset = size;
149 | } else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) {
150 | MASEdgeInsets insets;
151 | [value getValue:&insets];
152 | self.insets = insets;
153 | } else {
154 | NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value);
155 | }
156 | }
157 |
158 | #pragma mark - Semantic properties
159 |
160 | - (MASConstraint *)with {
161 | return self;
162 | }
163 |
164 | - (MASConstraint *)and {
165 | return self;
166 | }
167 |
168 | #pragma mark - Chaining
169 |
170 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute {
171 | MASMethodNotImplemented();
172 | }
173 |
174 | - (MASConstraint *)left {
175 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft];
176 | }
177 |
178 | - (MASConstraint *)top {
179 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop];
180 | }
181 |
182 | - (MASConstraint *)right {
183 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight];
184 | }
185 |
186 | - (MASConstraint *)bottom {
187 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom];
188 | }
189 |
190 | - (MASConstraint *)leading {
191 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading];
192 | }
193 |
194 | - (MASConstraint *)trailing {
195 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing];
196 | }
197 |
198 | - (MASConstraint *)width {
199 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth];
200 | }
201 |
202 | - (MASConstraint *)height {
203 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight];
204 | }
205 |
206 | - (MASConstraint *)centerX {
207 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX];
208 | }
209 |
210 | - (MASConstraint *)centerY {
211 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY];
212 | }
213 |
214 | - (MASConstraint *)baseline {
215 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
216 | }
217 |
218 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
219 |
220 | - (MASConstraint *)firstBaseline {
221 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline];
222 | }
223 | - (MASConstraint *)lastBaseline {
224 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline];
225 | }
226 |
227 | #endif
228 |
229 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
230 |
231 | - (MASConstraint *)leftMargin {
232 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
233 | }
234 |
235 | - (MASConstraint *)rightMargin {
236 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin];
237 | }
238 |
239 | - (MASConstraint *)topMargin {
240 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin];
241 | }
242 |
243 | - (MASConstraint *)bottomMargin {
244 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin];
245 | }
246 |
247 | - (MASConstraint *)leadingMargin {
248 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin];
249 | }
250 |
251 | - (MASConstraint *)trailingMargin {
252 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin];
253 | }
254 |
255 | - (MASConstraint *)centerXWithinMargins {
256 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins];
257 | }
258 |
259 | - (MASConstraint *)centerYWithinMargins {
260 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins];
261 | }
262 |
263 | #endif
264 |
265 | #pragma mark - Abstract
266 |
267 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); }
268 |
269 | - (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); }
270 |
271 | - (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); }
272 |
273 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); }
274 |
275 | - (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); }
276 |
277 | - (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); }
278 |
279 | - (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); }
280 |
281 | - (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); }
282 |
283 | - (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); }
284 |
285 | - (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); }
286 |
287 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV)
288 |
289 | - (MASConstraint *)animator { MASMethodNotImplemented(); }
290 |
291 | #endif
292 |
293 | - (void)activate { MASMethodNotImplemented(); }
294 |
295 | - (void)deactivate { MASMethodNotImplemented(); }
296 |
297 | - (void)install { MASMethodNotImplemented(); }
298 |
299 | - (void)uninstall { MASMethodNotImplemented(); }
300 |
301 | @end
302 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraintMaker.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraintMaker.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraint.h"
10 | #import "MASUtilities.h"
11 |
12 | typedef NS_OPTIONS(NSInteger, MASAttribute) {
13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft,
14 | MASAttributeRight = 1 << NSLayoutAttributeRight,
15 | MASAttributeTop = 1 << NSLayoutAttributeTop,
16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom,
17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading,
18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing,
19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth,
20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight,
21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX,
22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY,
23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline,
24 |
25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
26 |
27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline,
28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline,
29 |
30 | #endif
31 |
32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
33 |
34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin,
35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin,
36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin,
37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin,
38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin,
39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin,
40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins,
41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins,
42 |
43 | #endif
44 |
45 | };
46 |
47 | /**
48 | * Provides factory methods for creating MASConstraints.
49 | * Constraints are collected until they are ready to be installed
50 | *
51 | */
52 | @interface MASConstraintMaker : NSObject
53 |
54 | /**
55 | * The following properties return a new MASViewConstraint
56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute
57 | */
58 | @property (nonatomic, strong, readonly) MASConstraint *left;
59 | @property (nonatomic, strong, readonly) MASConstraint *top;
60 | @property (nonatomic, strong, readonly) MASConstraint *right;
61 | @property (nonatomic, strong, readonly) MASConstraint *bottom;
62 | @property (nonatomic, strong, readonly) MASConstraint *leading;
63 | @property (nonatomic, strong, readonly) MASConstraint *trailing;
64 | @property (nonatomic, strong, readonly) MASConstraint *width;
65 | @property (nonatomic, strong, readonly) MASConstraint *height;
66 | @property (nonatomic, strong, readonly) MASConstraint *centerX;
67 | @property (nonatomic, strong, readonly) MASConstraint *centerY;
68 | @property (nonatomic, strong, readonly) MASConstraint *baseline;
69 |
70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
71 |
72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline;
73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline;
74 |
75 | #endif
76 |
77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
78 |
79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin;
80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin;
81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin;
82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin;
83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin;
84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin;
85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins;
86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins;
87 |
88 | #endif
89 |
90 | /**
91 | * Returns a block which creates a new MASCompositeConstraint with the first item set
92 | * to the makers associated view and children corresponding to the set bits in the
93 | * MASAttribute parameter. Combine multiple attributes via binary-or.
94 | */
95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs);
96 |
97 | /**
98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges
99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right)
100 | * with the first item set to the makers associated view
101 | */
102 | @property (nonatomic, strong, readonly) MASConstraint *edges;
103 |
104 | /**
105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize
106 | * which generates the appropriate MASViewConstraint children (width, height)
107 | * with the first item set to the makers associated view
108 | */
109 | @property (nonatomic, strong, readonly) MASConstraint *size;
110 |
111 | /**
112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter
113 | * which generates the appropriate MASViewConstraint children (centerX, centerY)
114 | * with the first item set to the makers associated view
115 | */
116 | @property (nonatomic, strong, readonly) MASConstraint *center;
117 |
118 | /**
119 | * Whether or not to check for an existing constraint instead of adding constraint
120 | */
121 | @property (nonatomic, assign) BOOL updateExisting;
122 |
123 | /**
124 | * Whether or not to remove existing constraints prior to installing
125 | */
126 | @property (nonatomic, assign) BOOL removeExisting;
127 |
128 | /**
129 | * initialises the maker with a default view
130 | *
131 | * @param view any MASConstraint are created with this view as the first item
132 | *
133 | * @return a new MASConstraintMaker
134 | */
135 | - (id)initWithView:(MAS_VIEW *)view;
136 |
137 | /**
138 | * Calls install method on any MASConstraints which have been created by this maker
139 | *
140 | * @return an array of all the installed MASConstraints
141 | */
142 | - (NSArray *)install;
143 |
144 | - (MASConstraint * (^)(dispatch_block_t))group;
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASConstraintMaker.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASConstraintMaker.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASConstraintMaker.h"
10 | #import "MASViewConstraint.h"
11 | #import "MASCompositeConstraint.h"
12 | #import "MASConstraint+Private.h"
13 | #import "MASViewAttribute.h"
14 | #import "View+MASAdditions.h"
15 |
16 | @interface MASConstraintMaker ()
17 |
18 | @property (nonatomic, weak) MAS_VIEW *view;
19 | @property (nonatomic, strong) NSMutableArray *constraints;
20 |
21 | @end
22 |
23 | @implementation MASConstraintMaker
24 |
25 | - (id)initWithView:(MAS_VIEW *)view {
26 | self = [super init];
27 | if (!self) return nil;
28 |
29 | self.view = view;
30 | self.constraints = NSMutableArray.new;
31 |
32 | return self;
33 | }
34 |
35 | - (NSArray *)install {
36 | if (self.removeExisting) {
37 | NSArray *installedConstraints = [MASViewConstraint installedConstraintsForView:self.view];
38 | for (MASConstraint *constraint in installedConstraints) {
39 | [constraint uninstall];
40 | }
41 | }
42 | NSArray *constraints = self.constraints.copy;
43 | for (MASConstraint *constraint in constraints) {
44 | constraint.updateExisting = self.updateExisting;
45 | [constraint install];
46 | }
47 | [self.constraints removeAllObjects];
48 | return constraints;
49 | }
50 |
51 | #pragma mark - MASConstraintDelegate
52 |
53 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint {
54 | NSUInteger index = [self.constraints indexOfObject:constraint];
55 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint);
56 | [self.constraints replaceObjectAtIndex:index withObject:replacementConstraint];
57 | }
58 |
59 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
60 | MASViewAttribute *viewAttribute = [[MASViewAttribute alloc] initWithView:self.view layoutAttribute:layoutAttribute];
61 | MASViewConstraint *newConstraint = [[MASViewConstraint alloc] initWithFirstViewAttribute:viewAttribute];
62 | if ([constraint isKindOfClass:MASViewConstraint.class]) {
63 | //replace with composite constraint
64 | NSArray *children = @[constraint, newConstraint];
65 | MASCompositeConstraint *compositeConstraint = [[MASCompositeConstraint alloc] initWithChildren:children];
66 | compositeConstraint.delegate = self;
67 | [self constraint:constraint shouldBeReplacedWithConstraint:compositeConstraint];
68 | return compositeConstraint;
69 | }
70 | if (!constraint) {
71 | newConstraint.delegate = self;
72 | [self.constraints addObject:newConstraint];
73 | }
74 | return newConstraint;
75 | }
76 |
77 | - (MASConstraint *)addConstraintWithAttributes:(MASAttribute)attrs {
78 | __unused MASAttribute anyAttribute = (MASAttributeLeft | MASAttributeRight | MASAttributeTop | MASAttributeBottom | MASAttributeLeading
79 | | MASAttributeTrailing | MASAttributeWidth | MASAttributeHeight | MASAttributeCenterX
80 | | MASAttributeCenterY | MASAttributeBaseline
81 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
82 | | MASAttributeFirstBaseline | MASAttributeLastBaseline
83 | #endif
84 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
85 | | MASAttributeLeftMargin | MASAttributeRightMargin | MASAttributeTopMargin | MASAttributeBottomMargin
86 | | MASAttributeLeadingMargin | MASAttributeTrailingMargin | MASAttributeCenterXWithinMargins
87 | | MASAttributeCenterYWithinMargins
88 | #endif
89 | );
90 |
91 | NSAssert((attrs & anyAttribute) != 0, @"You didn't pass any attribute to make.attributes(...)");
92 |
93 | NSMutableArray *attributes = [NSMutableArray array];
94 |
95 | if (attrs & MASAttributeLeft) [attributes addObject:self.view.mas_left];
96 | if (attrs & MASAttributeRight) [attributes addObject:self.view.mas_right];
97 | if (attrs & MASAttributeTop) [attributes addObject:self.view.mas_top];
98 | if (attrs & MASAttributeBottom) [attributes addObject:self.view.mas_bottom];
99 | if (attrs & MASAttributeLeading) [attributes addObject:self.view.mas_leading];
100 | if (attrs & MASAttributeTrailing) [attributes addObject:self.view.mas_trailing];
101 | if (attrs & MASAttributeWidth) [attributes addObject:self.view.mas_width];
102 | if (attrs & MASAttributeHeight) [attributes addObject:self.view.mas_height];
103 | if (attrs & MASAttributeCenterX) [attributes addObject:self.view.mas_centerX];
104 | if (attrs & MASAttributeCenterY) [attributes addObject:self.view.mas_centerY];
105 | if (attrs & MASAttributeBaseline) [attributes addObject:self.view.mas_baseline];
106 |
107 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
108 |
109 | if (attrs & MASAttributeFirstBaseline) [attributes addObject:self.view.mas_firstBaseline];
110 | if (attrs & MASAttributeLastBaseline) [attributes addObject:self.view.mas_lastBaseline];
111 |
112 | #endif
113 |
114 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
115 |
116 | if (attrs & MASAttributeLeftMargin) [attributes addObject:self.view.mas_leftMargin];
117 | if (attrs & MASAttributeRightMargin) [attributes addObject:self.view.mas_rightMargin];
118 | if (attrs & MASAttributeTopMargin) [attributes addObject:self.view.mas_topMargin];
119 | if (attrs & MASAttributeBottomMargin) [attributes addObject:self.view.mas_bottomMargin];
120 | if (attrs & MASAttributeLeadingMargin) [attributes addObject:self.view.mas_leadingMargin];
121 | if (attrs & MASAttributeTrailingMargin) [attributes addObject:self.view.mas_trailingMargin];
122 | if (attrs & MASAttributeCenterXWithinMargins) [attributes addObject:self.view.mas_centerXWithinMargins];
123 | if (attrs & MASAttributeCenterYWithinMargins) [attributes addObject:self.view.mas_centerYWithinMargins];
124 |
125 | #endif
126 |
127 | NSMutableArray *children = [NSMutableArray arrayWithCapacity:attributes.count];
128 |
129 | for (MASViewAttribute *a in attributes) {
130 | [children addObject:[[MASViewConstraint alloc] initWithFirstViewAttribute:a]];
131 | }
132 |
133 | MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children];
134 | constraint.delegate = self;
135 | [self.constraints addObject:constraint];
136 | return constraint;
137 | }
138 |
139 | #pragma mark - standard Attributes
140 |
141 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute {
142 | return [self constraint:nil addConstraintWithLayoutAttribute:layoutAttribute];
143 | }
144 |
145 | - (MASConstraint *)left {
146 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft];
147 | }
148 |
149 | - (MASConstraint *)top {
150 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop];
151 | }
152 |
153 | - (MASConstraint *)right {
154 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight];
155 | }
156 |
157 | - (MASConstraint *)bottom {
158 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom];
159 | }
160 |
161 | - (MASConstraint *)leading {
162 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading];
163 | }
164 |
165 | - (MASConstraint *)trailing {
166 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing];
167 | }
168 |
169 | - (MASConstraint *)width {
170 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth];
171 | }
172 |
173 | - (MASConstraint *)height {
174 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight];
175 | }
176 |
177 | - (MASConstraint *)centerX {
178 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX];
179 | }
180 |
181 | - (MASConstraint *)centerY {
182 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY];
183 | }
184 |
185 | - (MASConstraint *)baseline {
186 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline];
187 | }
188 |
189 | - (MASConstraint *(^)(MASAttribute))attributes {
190 | return ^(MASAttribute attrs){
191 | return [self addConstraintWithAttributes:attrs];
192 | };
193 | }
194 |
195 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
196 |
197 | - (MASConstraint *)firstBaseline {
198 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline];
199 | }
200 |
201 | - (MASConstraint *)lastBaseline {
202 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline];
203 | }
204 |
205 | #endif
206 |
207 |
208 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
209 |
210 | - (MASConstraint *)leftMargin {
211 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin];
212 | }
213 |
214 | - (MASConstraint *)rightMargin {
215 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin];
216 | }
217 |
218 | - (MASConstraint *)topMargin {
219 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin];
220 | }
221 |
222 | - (MASConstraint *)bottomMargin {
223 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin];
224 | }
225 |
226 | - (MASConstraint *)leadingMargin {
227 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin];
228 | }
229 |
230 | - (MASConstraint *)trailingMargin {
231 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin];
232 | }
233 |
234 | - (MASConstraint *)centerXWithinMargins {
235 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins];
236 | }
237 |
238 | - (MASConstraint *)centerYWithinMargins {
239 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins];
240 | }
241 |
242 | #endif
243 |
244 |
245 | #pragma mark - composite Attributes
246 |
247 | - (MASConstraint *)edges {
248 | return [self addConstraintWithAttributes:MASAttributeTop | MASAttributeLeft | MASAttributeRight | MASAttributeBottom];
249 | }
250 |
251 | - (MASConstraint *)size {
252 | return [self addConstraintWithAttributes:MASAttributeWidth | MASAttributeHeight];
253 | }
254 |
255 | - (MASConstraint *)center {
256 | return [self addConstraintWithAttributes:MASAttributeCenterX | MASAttributeCenterY];
257 | }
258 |
259 | #pragma mark - grouping
260 |
261 | - (MASConstraint *(^)(dispatch_block_t group))group {
262 | return ^id(dispatch_block_t group) {
263 | NSInteger previousCount = self.constraints.count;
264 | group();
265 |
266 | NSArray *children = [self.constraints subarrayWithRange:NSMakeRange(previousCount, self.constraints.count - previousCount)];
267 | MASCompositeConstraint *constraint = [[MASCompositeConstraint alloc] initWithChildren:children];
268 | constraint.delegate = self;
269 | return constraint;
270 | };
271 | }
272 |
273 | @end
274 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASLayoutConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * When you are debugging or printing the constraints attached to a view this subclass
13 | * makes it easier to identify which constraints have been created via Masonry
14 | */
15 | @interface MASLayoutConstraint : NSLayoutConstraint
16 |
17 | /**
18 | * a key to associate with this constraint
19 | */
20 | @property (nonatomic, strong) id mas_key;
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASLayoutConstraint.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASLayoutConstraint.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASLayoutConstraint.h"
10 |
11 | @implementation MASLayoutConstraint
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASUtilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASUtilities.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 19/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 |
13 | #if TARGET_OS_IPHONE || TARGET_OS_TV
14 |
15 | #import
16 | #define MAS_VIEW UIView
17 | #define MAS_VIEW_CONTROLLER UIViewController
18 | #define MASEdgeInsets UIEdgeInsets
19 |
20 | typedef UILayoutPriority MASLayoutPriority;
21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired;
22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh;
23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500;
24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow;
25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel;
26 |
27 | #elif TARGET_OS_MAC
28 |
29 | #import
30 | #define MAS_VIEW NSView
31 | #define MASEdgeInsets NSEdgeInsets
32 |
33 | typedef NSLayoutPriority MASLayoutPriority;
34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired;
35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh;
36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow;
37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501;
38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut;
39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow;
40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow;
41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression;
42 |
43 | #endif
44 |
45 | /**
46 | * Allows you to attach keys to objects matching the variable names passed.
47 | *
48 | * view1.mas_key = @"view1", view2.mas_key = @"view2";
49 | *
50 | * is equivalent to:
51 | *
52 | * MASAttachKeys(view1, view2);
53 | */
54 | #define MASAttachKeys(...) \
55 | { \
56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \
57 | for (id key in keyPairs.allKeys) { \
58 | id obj = keyPairs[key]; \
59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \
60 | @"Cannot attach mas_key to %@", obj); \
61 | [obj setMas_key:key]; \
62 | } \
63 | }
64 |
65 | /**
66 | * Used to create object hashes
67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html
68 | */
69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger))
70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch)))
71 |
72 | /**
73 | * Given a scalar or struct value, wraps it in NSValue
74 | * Based on EXPObjectify: https://github.com/specta/expecta
75 | */
76 | static inline id _MASBoxValue(const char *type, ...) {
77 | va_list v;
78 | va_start(v, type);
79 | id obj = nil;
80 | if (strcmp(type, @encode(id)) == 0) {
81 | id actual = va_arg(v, id);
82 | obj = actual;
83 | } else if (strcmp(type, @encode(CGPoint)) == 0) {
84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint);
85 | obj = [NSValue value:&actual withObjCType:type];
86 | } else if (strcmp(type, @encode(CGSize)) == 0) {
87 | CGSize actual = (CGSize)va_arg(v, CGSize);
88 | obj = [NSValue value:&actual withObjCType:type];
89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) {
90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets);
91 | obj = [NSValue value:&actual withObjCType:type];
92 | } else if (strcmp(type, @encode(double)) == 0) {
93 | double actual = (double)va_arg(v, double);
94 | obj = [NSNumber numberWithDouble:actual];
95 | } else if (strcmp(type, @encode(float)) == 0) {
96 | float actual = (float)va_arg(v, double);
97 | obj = [NSNumber numberWithFloat:actual];
98 | } else if (strcmp(type, @encode(int)) == 0) {
99 | int actual = (int)va_arg(v, int);
100 | obj = [NSNumber numberWithInt:actual];
101 | } else if (strcmp(type, @encode(long)) == 0) {
102 | long actual = (long)va_arg(v, long);
103 | obj = [NSNumber numberWithLong:actual];
104 | } else if (strcmp(type, @encode(long long)) == 0) {
105 | long long actual = (long long)va_arg(v, long long);
106 | obj = [NSNumber numberWithLongLong:actual];
107 | } else if (strcmp(type, @encode(short)) == 0) {
108 | short actual = (short)va_arg(v, int);
109 | obj = [NSNumber numberWithShort:actual];
110 | } else if (strcmp(type, @encode(char)) == 0) {
111 | char actual = (char)va_arg(v, int);
112 | obj = [NSNumber numberWithChar:actual];
113 | } else if (strcmp(type, @encode(bool)) == 0) {
114 | bool actual = (bool)va_arg(v, int);
115 | obj = [NSNumber numberWithBool:actual];
116 | } else if (strcmp(type, @encode(unsigned char)) == 0) {
117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int);
118 | obj = [NSNumber numberWithUnsignedChar:actual];
119 | } else if (strcmp(type, @encode(unsigned int)) == 0) {
120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int);
121 | obj = [NSNumber numberWithUnsignedInt:actual];
122 | } else if (strcmp(type, @encode(unsigned long)) == 0) {
123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long);
124 | obj = [NSNumber numberWithUnsignedLong:actual];
125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) {
126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long);
127 | obj = [NSNumber numberWithUnsignedLongLong:actual];
128 | } else if (strcmp(type, @encode(unsigned short)) == 0) {
129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int);
130 | obj = [NSNumber numberWithUnsignedShort:actual];
131 | }
132 | va_end(v);
133 | return obj;
134 | }
135 |
136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value))
137 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewAttribute.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * An immutable tuple which stores the view and the related NSLayoutAttribute.
13 | * Describes part of either the left or right hand side of a constraint equation
14 | */
15 | @interface MASViewAttribute : NSObject
16 |
17 | /**
18 | * The view which the reciever relates to. Can be nil if item is not a view.
19 | */
20 | @property (nonatomic, weak, readonly) MAS_VIEW *view;
21 |
22 | /**
23 | * The item which the reciever relates to.
24 | */
25 | @property (nonatomic, weak, readonly) id item;
26 |
27 | /**
28 | * The attribute which the reciever relates to
29 | */
30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute;
31 |
32 | /**
33 | * Convenience initializer.
34 | */
35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute;
36 |
37 | /**
38 | * The designated initializer.
39 | */
40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute;
41 |
42 | /**
43 | * Determine whether the layoutAttribute is a size attribute
44 | *
45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight
46 | */
47 | - (BOOL)isSizeAttribute;
48 |
49 | @end
50 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewAttribute.m:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewAttribute.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 21/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 |
11 | @implementation MASViewAttribute
12 |
13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute {
14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute];
15 | return self;
16 | }
17 |
18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute {
19 | self = [super init];
20 | if (!self) return nil;
21 |
22 | _view = view;
23 | _item = item;
24 | _layoutAttribute = layoutAttribute;
25 |
26 | return self;
27 | }
28 |
29 | - (BOOL)isSizeAttribute {
30 | return self.layoutAttribute == NSLayoutAttributeWidth
31 | || self.layoutAttribute == NSLayoutAttributeHeight;
32 | }
33 |
34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute {
35 | if ([viewAttribute isKindOfClass:self.class]) {
36 | return self.view == viewAttribute.view
37 | && self.layoutAttribute == viewAttribute.layoutAttribute;
38 | }
39 | return [super isEqual:viewAttribute];
40 | }
41 |
42 | - (NSUInteger)hash {
43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute;
44 | }
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/MASViewConstraint.h:
--------------------------------------------------------------------------------
1 | //
2 | // MASViewConstraint.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASViewAttribute.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 | #import "MASUtilities.h"
13 |
14 | /**
15 | * A single constraint.
16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view
17 | */
18 | @interface MASViewConstraint : MASConstraint
19 |
20 | /**
21 | * First item/view and first attribute of the NSLayoutConstraint
22 | */
23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute;
24 |
25 | /**
26 | * Second item/view and second attribute of the NSLayoutConstraint
27 | */
28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute;
29 |
30 | /**
31 | * initialises the MASViewConstraint with the first part of the equation
32 | *
33 | * @param firstViewAttribute view.mas_left, view.mas_width etc.
34 | *
35 | * @return a new view constraint
36 | */
37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute;
38 |
39 | /**
40 | * Returns all MASViewConstraints installed with this view as a first item.
41 | *
42 | * @param view A view to retrieve constraints for.
43 | *
44 | * @return An array of MASViewConstraints.
45 | */
46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view;
47 |
48 | @end
49 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/Masonry.h:
--------------------------------------------------------------------------------
1 | //
2 | // Masonry.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | //! Project version number for Masonry.
12 | FOUNDATION_EXPORT double MasonryVersionNumber;
13 |
14 | //! Project version string for Masonry.
15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
16 |
17 | #import "MASUtilities.h"
18 | #import "View+MASAdditions.h"
19 | #import "View+MASShorthandAdditions.h"
20 | #import "ViewController+MASAdditions.h"
21 | #import "NSArray+MASAdditions.h"
22 | #import "NSArray+MASShorthandAdditions.h"
23 | #import "MASConstraint.h"
24 | #import "MASCompositeConstraint.h"
25 | #import "MASViewAttribute.h"
26 | #import "MASViewConstraint.h"
27 | #import "MASConstraintMaker.h"
28 | #import "MASLayoutConstraint.h"
29 | #import "NSLayoutConstraint+MASDebugAdditions.h"
30 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.h
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | typedef NS_ENUM(NSUInteger, MASAxisType) {
14 | MASAxisTypeHorizontal,
15 | MASAxisTypeVertical
16 | };
17 |
18 | @interface NSArray (MASAdditions)
19 |
20 | /**
21 | * Creates a MASConstraintMaker with each view in the callee.
22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view
23 | *
24 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
25 | *
26 | * @return Array of created MASConstraints
27 | */
28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
29 |
30 | /**
31 | * Creates a MASConstraintMaker with each view in the callee.
32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
33 | * If an existing constraint exists then it will be updated instead.
34 | *
35 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
36 | *
37 | * @return Array of created/updated MASConstraints
38 | */
39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
40 |
41 | /**
42 | * Creates a MASConstraintMaker with each view in the callee.
43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view.
44 | * All constraints previously installed for the views will be removed.
45 | *
46 | * @param block scope within which you can build up the constraints which you wish to apply to each view.
47 | *
48 | * @return Array of created/updated MASConstraints
49 | */
50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block;
51 |
52 | /**
53 | * distribute with fixed spacing
54 | *
55 | * @param axisType which axis to distribute items along
56 | * @param fixedSpacing the spacing between each item
57 | * @param leadSpacing the spacing before the first item and the container
58 | * @param tailSpacing the spacing after the last item and the container
59 | */
60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
61 |
62 | /**
63 | * distribute with fixed item size
64 | *
65 | * @param axisType which axis to distribute items along
66 | * @param fixedItemLength the fixed length of each item
67 | * @param leadSpacing the spacing before the first item and the container
68 | * @param tailSpacing the spacing after the last item and the container
69 | */
70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing;
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSArray+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASAdditions.m
3 | //
4 | //
5 | // Created by Daniel Hammond on 11/26/13.
6 | //
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 | #import "View+MASAdditions.h"
11 |
12 | @implementation NSArray (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block {
15 | NSMutableArray *constraints = [NSMutableArray array];
16 | for (MAS_VIEW *view in self) {
17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]];
19 | }
20 | return constraints;
21 | }
22 |
23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block {
24 | NSMutableArray *constraints = [NSMutableArray array];
25 | for (MAS_VIEW *view in self) {
26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]];
28 | }
29 | return constraints;
30 | }
31 |
32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
33 | NSMutableArray *constraints = [NSMutableArray array];
34 | for (MAS_VIEW *view in self) {
35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views");
36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]];
37 | }
38 | return constraints;
39 | }
40 |
41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
42 | if (self.count < 2) {
43 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
44 | return;
45 | }
46 |
47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
48 | if (axisType == MASAxisTypeHorizontal) {
49 | MAS_VIEW *prev;
50 | for (int i = 0; i < self.count; i++) {
51 | MAS_VIEW *v = self[i];
52 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
53 | if (prev) {
54 | make.width.equalTo(prev);
55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing);
56 | if (i == self.count - 1) {//last one
57 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
58 | }
59 | }
60 | else {//first one
61 | make.left.equalTo(tempSuperView).offset(leadSpacing);
62 | }
63 |
64 | }];
65 | prev = v;
66 | }
67 | }
68 | else {
69 | MAS_VIEW *prev;
70 | for (int i = 0; i < self.count; i++) {
71 | MAS_VIEW *v = self[i];
72 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
73 | if (prev) {
74 | make.height.equalTo(prev);
75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing);
76 | if (i == self.count - 1) {//last one
77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
78 | }
79 | }
80 | else {//first one
81 | make.top.equalTo(tempSuperView).offset(leadSpacing);
82 | }
83 |
84 | }];
85 | prev = v;
86 | }
87 | }
88 | }
89 |
90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing {
91 | if (self.count < 2) {
92 | NSAssert(self.count>1,@"views to distribute need to bigger than one");
93 | return;
94 | }
95 |
96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews];
97 | if (axisType == MASAxisTypeHorizontal) {
98 | MAS_VIEW *prev;
99 | for (int i = 0; i < self.count; i++) {
100 | MAS_VIEW *v = self[i];
101 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
102 | make.width.equalTo(@(fixedItemLength));
103 | if (prev) {
104 | if (i == self.count - 1) {//last one
105 | make.right.equalTo(tempSuperView).offset(-tailSpacing);
106 | }
107 | else {
108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
110 | }
111 | }
112 | else {//first one
113 | make.left.equalTo(tempSuperView).offset(leadSpacing);
114 | }
115 | }];
116 | prev = v;
117 | }
118 | }
119 | else {
120 | MAS_VIEW *prev;
121 | for (int i = 0; i < self.count; i++) {
122 | MAS_VIEW *v = self[i];
123 | [v mas_makeConstraints:^(MASConstraintMaker *make) {
124 | make.height.equalTo(@(fixedItemLength));
125 | if (prev) {
126 | if (i == self.count - 1) {//last one
127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing);
128 | }
129 | else {
130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1));
131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset);
132 | }
133 | }
134 | else {//first one
135 | make.top.equalTo(tempSuperView).offset(leadSpacing);
136 | }
137 | }];
138 | prev = v;
139 | }
140 | }
141 | }
142 |
143 | - (MAS_VIEW *)mas_commonSuperviewOfViews
144 | {
145 | MAS_VIEW *commonSuperview = nil;
146 | MAS_VIEW *previousView = nil;
147 | for (id object in self) {
148 | if ([object isKindOfClass:[MAS_VIEW class]]) {
149 | MAS_VIEW *view = (MAS_VIEW *)object;
150 | if (previousView) {
151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview];
152 | } else {
153 | commonSuperview = view;
154 | }
155 | previousView = view;
156 | }
157 | }
158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy.");
159 | return commonSuperview;
160 | }
161 |
162 | @end
163 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSArray+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSArray+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand array additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface NSArray (MASShorthandAdditions)
18 |
19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
22 |
23 | @end
24 |
25 | @implementation NSArray (MASShorthandAdditions)
26 |
27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block {
28 | return [self mas_makeConstraints:block];
29 | }
30 |
31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block {
32 | return [self mas_updateConstraints:block];
33 | }
34 |
35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block {
36 | return [self mas_remakeConstraints:block];
37 | }
38 |
39 | @end
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 |
11 | /**
12 | * makes debug and log output of NSLayoutConstraints more readable
13 | */
14 | @interface NSLayoutConstraint (MASDebugAdditions)
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSLayoutConstraint+MASDebugAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 3/08/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "NSLayoutConstraint+MASDebugAdditions.h"
10 | #import "MASConstraint.h"
11 | #import "MASLayoutConstraint.h"
12 |
13 | @implementation NSLayoutConstraint (MASDebugAdditions)
14 |
15 | #pragma mark - description maps
16 |
17 | + (NSDictionary *)layoutRelationDescriptionsByValue {
18 | static dispatch_once_t once;
19 | static NSDictionary *descriptionMap;
20 | dispatch_once(&once, ^{
21 | descriptionMap = @{
22 | @(NSLayoutRelationEqual) : @"==",
23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=",
24 | @(NSLayoutRelationLessThanOrEqual) : @"<=",
25 | };
26 | });
27 | return descriptionMap;
28 | }
29 |
30 | + (NSDictionary *)layoutAttributeDescriptionsByValue {
31 | static dispatch_once_t once;
32 | static NSDictionary *descriptionMap;
33 | dispatch_once(&once, ^{
34 | descriptionMap = @{
35 | @(NSLayoutAttributeTop) : @"top",
36 | @(NSLayoutAttributeLeft) : @"left",
37 | @(NSLayoutAttributeBottom) : @"bottom",
38 | @(NSLayoutAttributeRight) : @"right",
39 | @(NSLayoutAttributeLeading) : @"leading",
40 | @(NSLayoutAttributeTrailing) : @"trailing",
41 | @(NSLayoutAttributeWidth) : @"width",
42 | @(NSLayoutAttributeHeight) : @"height",
43 | @(NSLayoutAttributeCenterX) : @"centerX",
44 | @(NSLayoutAttributeCenterY) : @"centerY",
45 | @(NSLayoutAttributeBaseline) : @"baseline",
46 |
47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline",
49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline",
50 | #endif
51 |
52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin",
54 | @(NSLayoutAttributeRightMargin) : @"rightMargin",
55 | @(NSLayoutAttributeTopMargin) : @"topMargin",
56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin",
57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin",
58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin",
59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins",
60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins",
61 | #endif
62 |
63 | };
64 |
65 | });
66 | return descriptionMap;
67 | }
68 |
69 |
70 | + (NSDictionary *)layoutPriorityDescriptionsByValue {
71 | static dispatch_once_t once;
72 | static NSDictionary *descriptionMap;
73 | dispatch_once(&once, ^{
74 | #if TARGET_OS_IPHONE || TARGET_OS_TV
75 | descriptionMap = @{
76 | @(MASLayoutPriorityDefaultHigh) : @"high",
77 | @(MASLayoutPriorityDefaultLow) : @"low",
78 | @(MASLayoutPriorityDefaultMedium) : @"medium",
79 | @(MASLayoutPriorityRequired) : @"required",
80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size",
81 | };
82 | #elif TARGET_OS_MAC
83 | descriptionMap = @{
84 | @(MASLayoutPriorityDefaultHigh) : @"high",
85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window",
86 | @(MASLayoutPriorityDefaultMedium) : @"medium",
87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put",
88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window",
89 | @(MASLayoutPriorityDefaultLow) : @"low",
90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size",
91 | @(MASLayoutPriorityRequired) : @"required",
92 | };
93 | #endif
94 | });
95 | return descriptionMap;
96 | }
97 |
98 | #pragma mark - description override
99 |
100 | + (NSString *)descriptionForObject:(id)obj {
101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) {
102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]];
103 | }
104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj];
105 | }
106 |
107 | - (NSString *)description {
108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"];
109 |
110 | [description appendString:[self.class descriptionForObject:self]];
111 |
112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]];
113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) {
114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]];
115 | }
116 |
117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]];
118 |
119 | if (self.secondItem) {
120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]];
121 | }
122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) {
123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]];
124 | }
125 |
126 | if (self.multiplier != 1) {
127 | [description appendFormat:@" * %g", self.multiplier];
128 | }
129 |
130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) {
131 | [description appendFormat:@" %g", self.constant];
132 | } else {
133 | if (self.constant) {
134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)];
135 | }
136 | }
137 |
138 | if (self.priority != MASLayoutPriorityRequired) {
139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]];
140 | }
141 |
142 | [description appendString:@">"];
143 | return description;
144 | }
145 |
146 | @end
147 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/View+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | /**
14 | * Provides constraint maker block
15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs
16 | */
17 | @interface MAS_VIEW (MASAdditions)
18 |
19 | /**
20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute
21 | */
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX;
31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY;
32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline;
33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr);
34 |
35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
36 |
37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline;
38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline;
39 |
40 | #endif
41 |
42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
43 |
44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin;
49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin;
50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins;
51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins;
52 |
53 | #endif
54 |
55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
56 |
57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0));
58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0));
59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0));
60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0));
61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0));
62 |
63 | #endif
64 |
65 | /**
66 | * a key to associate with this view
67 | */
68 | @property (nonatomic, strong) id mas_key;
69 |
70 | /**
71 | * Finds the closest common superview between this view and another view
72 | *
73 | * @param view other view
74 | *
75 | * @return returns nil if common superview could not be found
76 | */
77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view;
78 |
79 | /**
80 | * Creates a MASConstraintMaker with the callee view.
81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing
82 | *
83 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
84 | *
85 | * @return Array of created MASConstraints
86 | */
87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
88 |
89 | /**
90 | * Creates a MASConstraintMaker with the callee view.
91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
92 | * If an existing constraint exists then it will be updated instead.
93 | *
94 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
95 | *
96 | * @return Array of created/updated MASConstraints
97 | */
98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
99 |
100 | /**
101 | * Creates a MASConstraintMaker with the callee view.
102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing.
103 | * All constraints previously installed for the view will be removed.
104 | *
105 | * @param block scope within which you can build up the constraints which you wish to apply to the view.
106 | *
107 | * @return Array of created/updated MASConstraints
108 | */
109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block;
110 |
111 | @end
112 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/View+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 20/07/13.
6 | // Copyright (c) 2013 cloudling. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 | #import
11 |
12 | @implementation MAS_VIEW (MASAdditions)
13 |
14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block {
15 | self.translatesAutoresizingMaskIntoConstraints = NO;
16 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
17 | block(constraintMaker);
18 | return [constraintMaker install];
19 | }
20 |
21 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block {
22 | self.translatesAutoresizingMaskIntoConstraints = NO;
23 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
24 | constraintMaker.updateExisting = YES;
25 | block(constraintMaker);
26 | return [constraintMaker install];
27 | }
28 |
29 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block {
30 | self.translatesAutoresizingMaskIntoConstraints = NO;
31 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self];
32 | constraintMaker.removeExisting = YES;
33 | block(constraintMaker);
34 | return [constraintMaker install];
35 | }
36 |
37 | #pragma mark - NSLayoutAttribute properties
38 |
39 | - (MASViewAttribute *)mas_left {
40 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft];
41 | }
42 |
43 | - (MASViewAttribute *)mas_top {
44 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop];
45 | }
46 |
47 | - (MASViewAttribute *)mas_right {
48 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight];
49 | }
50 |
51 | - (MASViewAttribute *)mas_bottom {
52 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom];
53 | }
54 |
55 | - (MASViewAttribute *)mas_leading {
56 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading];
57 | }
58 |
59 | - (MASViewAttribute *)mas_trailing {
60 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing];
61 | }
62 |
63 | - (MASViewAttribute *)mas_width {
64 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth];
65 | }
66 |
67 | - (MASViewAttribute *)mas_height {
68 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight];
69 | }
70 |
71 | - (MASViewAttribute *)mas_centerX {
72 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX];
73 | }
74 |
75 | - (MASViewAttribute *)mas_centerY {
76 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY];
77 | }
78 |
79 | - (MASViewAttribute *)mas_baseline {
80 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline];
81 | }
82 |
83 | - (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute
84 | {
85 | return ^(NSLayoutAttribute attr) {
86 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr];
87 | };
88 | }
89 |
90 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
91 |
92 | - (MASViewAttribute *)mas_firstBaseline {
93 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline];
94 | }
95 | - (MASViewAttribute *)mas_lastBaseline {
96 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline];
97 | }
98 |
99 | #endif
100 |
101 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
102 |
103 | - (MASViewAttribute *)mas_leftMargin {
104 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin];
105 | }
106 |
107 | - (MASViewAttribute *)mas_rightMargin {
108 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin];
109 | }
110 |
111 | - (MASViewAttribute *)mas_topMargin {
112 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin];
113 | }
114 |
115 | - (MASViewAttribute *)mas_bottomMargin {
116 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin];
117 | }
118 |
119 | - (MASViewAttribute *)mas_leadingMargin {
120 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin];
121 | }
122 |
123 | - (MASViewAttribute *)mas_trailingMargin {
124 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin];
125 | }
126 |
127 | - (MASViewAttribute *)mas_centerXWithinMargins {
128 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins];
129 | }
130 |
131 | - (MASViewAttribute *)mas_centerYWithinMargins {
132 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins];
133 | }
134 |
135 | #endif
136 |
137 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
138 |
139 | - (MASViewAttribute *)mas_safeAreaLayoutGuide {
140 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
141 | }
142 | - (MASViewAttribute *)mas_safeAreaLayoutGuideTop {
143 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop];
144 | }
145 | - (MASViewAttribute *)mas_safeAreaLayoutGuideBottom {
146 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
147 | }
148 | - (MASViewAttribute *)mas_safeAreaLayoutGuideLeft {
149 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft];
150 | }
151 | - (MASViewAttribute *)mas_safeAreaLayoutGuideRight {
152 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight];
153 | }
154 |
155 | #endif
156 |
157 | #pragma mark - associated properties
158 |
159 | - (id)mas_key {
160 | return objc_getAssociatedObject(self, @selector(mas_key));
161 | }
162 |
163 | - (void)setMas_key:(id)key {
164 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
165 | }
166 |
167 | #pragma mark - heirachy
168 |
169 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view {
170 | MAS_VIEW *closestCommonSuperview = nil;
171 |
172 | MAS_VIEW *secondViewSuperview = view;
173 | while (!closestCommonSuperview && secondViewSuperview) {
174 | MAS_VIEW *firstViewSuperview = self;
175 | while (!closestCommonSuperview && firstViewSuperview) {
176 | if (secondViewSuperview == firstViewSuperview) {
177 | closestCommonSuperview = secondViewSuperview;
178 | }
179 | firstViewSuperview = firstViewSuperview.superview;
180 | }
181 | secondViewSuperview = secondViewSuperview.superview;
182 | }
183 | return closestCommonSuperview;
184 | }
185 |
186 | @end
187 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/View+MASShorthandAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+MASShorthandAdditions.h
3 | // Masonry
4 | //
5 | // Created by Jonas Budelmann on 22/07/13.
6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved.
7 | //
8 |
9 | #import "View+MASAdditions.h"
10 |
11 | #ifdef MAS_SHORTHAND
12 |
13 | /**
14 | * Shorthand view additions without the 'mas_' prefixes,
15 | * only enabled if MAS_SHORTHAND is defined
16 | */
17 | @interface MAS_VIEW (MASShorthandAdditions)
18 |
19 | @property (nonatomic, strong, readonly) MASViewAttribute *left;
20 | @property (nonatomic, strong, readonly) MASViewAttribute *top;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *right;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *width;
26 | @property (nonatomic, strong, readonly) MASViewAttribute *height;
27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX;
28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY;
29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline;
30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr);
31 |
32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
33 |
34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline;
35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline;
36 |
37 | #endif
38 |
39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
40 |
41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin;
42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin;
43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin;
44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin;
45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin;
46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin;
47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins;
48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins;
49 |
50 | #endif
51 |
52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
53 |
54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0));
55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0));
56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0));
57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0));
58 |
59 | #endif
60 |
61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block;
62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block;
63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block;
64 |
65 | @end
66 |
67 | #define MAS_ATTR_FORWARD(attr) \
68 | - (MASViewAttribute *)attr { \
69 | return [self mas_##attr]; \
70 | }
71 |
72 | @implementation MAS_VIEW (MASShorthandAdditions)
73 |
74 | MAS_ATTR_FORWARD(top);
75 | MAS_ATTR_FORWARD(left);
76 | MAS_ATTR_FORWARD(bottom);
77 | MAS_ATTR_FORWARD(right);
78 | MAS_ATTR_FORWARD(leading);
79 | MAS_ATTR_FORWARD(trailing);
80 | MAS_ATTR_FORWARD(width);
81 | MAS_ATTR_FORWARD(height);
82 | MAS_ATTR_FORWARD(centerX);
83 | MAS_ATTR_FORWARD(centerY);
84 | MAS_ATTR_FORWARD(baseline);
85 |
86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100)
87 |
88 | MAS_ATTR_FORWARD(firstBaseline);
89 | MAS_ATTR_FORWARD(lastBaseline);
90 |
91 | #endif
92 |
93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000)
94 |
95 | MAS_ATTR_FORWARD(leftMargin);
96 | MAS_ATTR_FORWARD(rightMargin);
97 | MAS_ATTR_FORWARD(topMargin);
98 | MAS_ATTR_FORWARD(bottomMargin);
99 | MAS_ATTR_FORWARD(leadingMargin);
100 | MAS_ATTR_FORWARD(trailingMargin);
101 | MAS_ATTR_FORWARD(centerXWithinMargins);
102 | MAS_ATTR_FORWARD(centerYWithinMargins);
103 |
104 | #endif
105 |
106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000)
107 |
108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop);
109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom);
110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft);
111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight);
112 |
113 | #endif
114 |
115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute {
116 | return [self mas_attribute];
117 | }
118 |
119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
120 | return [self mas_makeConstraints:block];
121 | }
122 |
123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
124 | return [self mas_updateConstraints:block];
125 | }
126 |
127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block {
128 | return [self mas_remakeConstraints:block];
129 | }
130 |
131 | @end
132 |
133 | #endif
134 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.h
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "MASUtilities.h"
10 | #import "MASConstraintMaker.h"
11 | #import "MASViewAttribute.h"
12 |
13 | #ifdef MAS_VIEW_CONTROLLER
14 |
15 | @interface MAS_VIEW_CONTROLLER (MASAdditions)
16 |
17 | /**
18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute
19 | */
20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide;
21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide;
22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop;
23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom;
24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop;
25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom;
26 |
27 |
28 | @end
29 |
30 | #endif
31 |
--------------------------------------------------------------------------------
/Example/Pods/Masonry/Masonry/ViewController+MASAdditions.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+MASAdditions.m
3 | // Masonry
4 | //
5 | // Created by Craig Siemens on 2015-06-23.
6 | //
7 | //
8 |
9 | #import "ViewController+MASAdditions.h"
10 |
11 | #ifdef MAS_VIEW_CONTROLLER
12 |
13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions)
14 |
15 | - (MASViewAttribute *)mas_topLayoutGuide {
16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
17 | }
18 | - (MASViewAttribute *)mas_topLayoutGuideTop {
19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop];
20 | }
21 | - (MASViewAttribute *)mas_topLayoutGuideBottom {
22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
23 | }
24 |
25 | - (MASViewAttribute *)mas_bottomLayoutGuide {
26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
27 | }
28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop {
29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop];
30 | }
31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom {
32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom];
33 | }
34 |
35 |
36 |
37 | @end
38 |
39 | #endif
40 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/Headers/RevealServer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright © 2015 Itty Bitty Apps, Pty Ltd. All rights reserved.
3 |
4 | #import
5 |
6 | //! Project version number for RevealServer.
7 | FOUNDATION_EXPORT double RevealServerVersionNumber;
8 |
9 | //! Project version string for RevealServer.
10 | FOUNDATION_EXPORT const unsigned char RevealServerVersionString[];
11 |
12 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 18C54
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | RevealServer
11 | CFBundleIdentifier
12 | com.ittybittyapps.RevealServer
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | RevealServer
17 | CFBundlePackageType
18 | FMWK
19 | CFBundleShortVersionString
20 | 21
21 | CFBundleSignature
22 | ????
23 | CFBundleSupportedPlatforms
24 |
25 | iPhoneOS
26 |
27 | CFBundleVersion
28 | 11690
29 | DTCompiler
30 | com.apple.compilers.llvm.clang.1_0
31 | DTPlatformBuild
32 | 16B91
33 | DTPlatformName
34 | iphoneos
35 | DTPlatformVersion
36 | 12.1
37 | DTSDKBuild
38 | 16B91
39 | DTSDKName
40 | iphoneos12.1
41 | DTXcode
42 | 1010
43 | DTXcodeBuild
44 | 10B61
45 | MinimumOSVersion
46 | 8.0
47 | UIDeviceFamily
48 |
49 | 1
50 | 2
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/Modules/module.modulemap:
--------------------------------------------------------------------------------
1 | framework module RevealServer {
2 | umbrella header "RevealServer.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/RevealServer:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/RevealServer
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/Scripts/copy_and_codesign_revealserver.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -o errexit
3 | set -o nounset
4 |
5 | # Ensure that we have a valid OTHER_LDFLAGS environment variable
6 | OTHER_LDFLAGS=${OTHER_LDFLAGS:=""}
7 |
8 | # Ensure that we have a valid REVEAL_SERVER_FILENAME environment variable
9 | REVEAL_SERVER_FILENAME=${REVEAL_SERVER_FILENAME:="RevealServer.framework"}
10 |
11 | # Ensure that we have a valid REVEAL_SERVER_PATH environment variable
12 | REVEAL_SERVER_PATH=${REVEAL_SERVER_PATH:="${SRCROOT}/${REVEAL_SERVER_FILENAME}"}
13 |
14 | # The path to copy the framework to
15 | app_frameworks_dir="${CODESIGNING_FOLDER_PATH}/Frameworks"
16 |
17 | copy_library() {
18 | mkdir -p "$app_frameworks_dir"
19 | cp -vRf "$REVEAL_SERVER_PATH" "${app_frameworks_dir}/"
20 | }
21 |
22 | codesign_library() {
23 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" ]; then
24 | codesign -fs "${EXPANDED_CODE_SIGN_IDENTITY}" "${app_frameworks_dir}/${REVEAL_SERVER_FILENAME}"
25 | fi
26 | }
27 |
28 | main() {
29 | if [[ $OTHER_LDFLAGS =~ "RevealServer" ]]; then
30 | if [ -e "$REVEAL_SERVER_PATH" ]; then
31 | copy_library
32 | codesign_library
33 | echo "${REVEAL_SERVER_FILENAME} is included in this build, and has been copied to $CODESIGNING_FOLDER_PATH"
34 | else
35 | echo "${REVEAL_SERVER_FILENAME} is not included in this build, as it could not be found at $REVEAL_SERVER_PATH"
36 | fi
37 | else
38 | echo "${REVEAL_SERVER_FILENAME} is not included in this build because RevealServer was not present in the OTHER_LDFLAGS environment variable."
39 | fi
40 | }
41 |
42 | main
43 |
--------------------------------------------------------------------------------
/Example/Pods/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework/_CodeSignature/CodeResources:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | files
6 |
7 | Headers/RevealServer.h
8 |
9 | JavE2LI6bNGfH9W90/bDxwIxVlg=
10 |
11 | Info.plist
12 |
13 | geGJW0dGPi2gMM7A+UEYIGa88u8=
14 |
15 | Modules/module.modulemap
16 |
17 | EuDEeG1dcC1sd+hIW2SkUAImUg8=
18 |
19 | Scripts/copy_and_codesign_revealserver.sh
20 |
21 | yB2zXTggmRD0rra2Hbpxn2zfCRo=
22 |
23 |
24 | files2
25 |
26 | Headers/RevealServer.h
27 |
28 | hash
29 |
30 | JavE2LI6bNGfH9W90/bDxwIxVlg=
31 |
32 | hash2
33 |
34 | weLK/65HyV1EiL9dd4xoAqQhf0/0r/Oy6os2nXCA+Ew=
35 |
36 |
37 | Modules/module.modulemap
38 |
39 | hash
40 |
41 | EuDEeG1dcC1sd+hIW2SkUAImUg8=
42 |
43 | hash2
44 |
45 | tstqiJpIPr4iEd3MDHClLuTB/ciSC/zNlke1AjfSVuU=
46 |
47 |
48 | Scripts/copy_and_codesign_revealserver.sh
49 |
50 | hash
51 |
52 | yB2zXTggmRD0rra2Hbpxn2zfCRo=
53 |
54 | hash2
55 |
56 | SL0x5cGSOyS1RcojHFEmFX5IDfon/vO37cFsjSIX7LA=
57 |
58 |
59 |
60 | rules
61 |
62 | ^.*
63 |
64 | ^.*\.lproj/
65 |
66 | optional
67 |
68 | weight
69 | 1000
70 |
71 | ^.*\.lproj/locversion.plist$
72 |
73 | omit
74 |
75 | weight
76 | 1100
77 |
78 | ^Base\.lproj/
79 |
80 | weight
81 | 1010
82 |
83 | ^version.plist$
84 |
85 |
86 | rules2
87 |
88 | .*\.dSYM($|/)
89 |
90 | weight
91 | 11
92 |
93 | ^(.*/)?\.DS_Store$
94 |
95 | omit
96 |
97 | weight
98 | 2000
99 |
100 | ^.*
101 |
102 | ^.*\.lproj/
103 |
104 | optional
105 |
106 | weight
107 | 1000
108 |
109 | ^.*\.lproj/locversion.plist$
110 |
111 | omit
112 |
113 | weight
114 | 1100
115 |
116 | ^Base\.lproj/
117 |
118 | weight
119 | 1010
120 |
121 | ^Info\.plist$
122 |
123 | omit
124 |
125 | weight
126 | 20
127 |
128 | ^PkgInfo$
129 |
130 | omit
131 |
132 | weight
133 | 20
134 |
135 | ^embedded\.provisionprofile$
136 |
137 | weight
138 | 20
139 |
140 | ^version\.plist$
141 |
142 | weight
143 | 20
144 |
145 |
146 |
147 |
148 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 3.5.5
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_LCActionSheet : NSObject
3 | @end
4 | @implementation PodsDummy_LCActionSheet
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "LCActionSheet.h"
14 | #import "LCActionSheetCell.h"
15 | #import "LCActionSheetConfig.h"
16 | #import "LCActionSheetViewController.h"
17 | #import "UIDevice+LCActionSheet.h"
18 | #import "UIImage+LCActionSheet.h"
19 |
20 | FOUNDATION_EXPORT double LCActionSheetVersionNumber;
21 | FOUNDATION_EXPORT const unsigned char LCActionSheetVersionString[];
22 |
23 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet.modulemap:
--------------------------------------------------------------------------------
1 | framework module LCActionSheet {
2 | umbrella header "LCActionSheet-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/LCActionSheet/LCActionSheet.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../..
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Masonry : NSObject
3 | @end
4 | @implementation PodsDummy_Masonry
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-prefix.pch:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 | #import "MASCompositeConstraint.h"
14 | #import "MASConstraint+Private.h"
15 | #import "MASConstraint.h"
16 | #import "MASConstraintMaker.h"
17 | #import "MASLayoutConstraint.h"
18 | #import "Masonry.h"
19 | #import "MASUtilities.h"
20 | #import "MASViewAttribute.h"
21 | #import "MASViewConstraint.h"
22 | #import "NSArray+MASAdditions.h"
23 | #import "NSArray+MASShorthandAdditions.h"
24 | #import "NSLayoutConstraint+MASDebugAdditions.h"
25 | #import "View+MASAdditions.h"
26 | #import "View+MASShorthandAdditions.h"
27 | #import "ViewController+MASAdditions.h"
28 |
29 | FOUNDATION_EXPORT double MasonryVersionNumber;
30 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[];
31 |
32 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry.modulemap:
--------------------------------------------------------------------------------
1 | framework module Masonry {
2 | umbrella header "Masonry-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Masonry/Masonry.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit"
4 | PODS_BUILD_DIR = ${BUILD_DIR}
5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
6 | PODS_ROOT = ${SRCROOT}
7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry
8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
9 | SKIP_INSTALL = YES
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_LCActionSheet_Example : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_LCActionSheet_Example
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example-frameworks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | set -e
3 | set -u
4 | set -o pipefail
5 |
6 | function on_error {
7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
8 | }
9 | trap 'on_error $LINENO' ERR
10 |
11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
13 | # frameworks to, so exit 0 (signalling the script phase was successful).
14 | exit 0
15 | fi
16 |
17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
19 |
20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
22 |
23 | # Used as a return value for each invocation of `strip_invalid_archs` function.
24 | STRIP_BINARY_RETVAL=0
25 |
26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution
27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
29 |
30 | # Copies and strips a vendored framework
31 | install_framework()
32 | {
33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
34 | local source="${BUILT_PRODUCTS_DIR}/$1"
35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
37 | elif [ -r "$1" ]; then
38 | local source="$1"
39 | fi
40 |
41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
42 |
43 | if [ -L "${source}" ]; then
44 | echo "Symlinked..."
45 | source="$(readlink "${source}")"
46 | fi
47 |
48 | # Use filter instead of exclude so missing patterns don't throw errors.
49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\""
50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}"
51 |
52 | local basename
53 | basename="$(basename -s .framework "$1")"
54 | binary="${destination}/${basename}.framework/${basename}"
55 |
56 | if ! [ -r "$binary" ]; then
57 | binary="${destination}/${basename}"
58 | elif [ -L "${binary}" ]; then
59 | echo "Destination binary is symlinked..."
60 | dirname="$(dirname "${binary}")"
61 | binary="${dirname}/$(readlink "${binary}")"
62 | fi
63 |
64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then
66 | strip_invalid_archs "$binary"
67 | fi
68 |
69 | # Resign the code if required by the build settings to avoid unstable apps
70 | code_sign_if_enabled "${destination}/$(basename "$1")"
71 |
72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7.
73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then
74 | local swift_runtime_libs
75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u)
76 | for lib in $swift_runtime_libs; do
77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\""
78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}"
79 | code_sign_if_enabled "${destination}/${lib}"
80 | done
81 | fi
82 | }
83 |
84 | # Copies and strips a vendored dSYM
85 | install_dsym() {
86 | local source="$1"
87 | if [ -r "$source" ]; then
88 | # Copy the dSYM into a the targets temp dir.
89 | 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}\""
90 | 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}"
91 |
92 | local basename
93 | basename="$(basename -s .framework.dSYM "$source")"
94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
95 |
96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device
97 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then
98 | strip_invalid_archs "$binary"
99 | fi
100 |
101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
102 | # Move the stripped file into its final destination.
103 | 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}\""
104 | 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}"
105 | else
106 | # 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.
107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
108 | fi
109 | fi
110 | }
111 |
112 | # Copies the bcsymbolmap files of a vendored framework
113 | install_bcsymbolmap() {
114 | local bcsymbolmap_path="$1"
115 | local destination="${BUILT_PRODUCTS_DIR}"
116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}""
117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"
118 | }
119 |
120 | # Signs a framework with the provided identity
121 | code_sign_if_enabled() {
122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
123 | # Use the current code_sign_identity
124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
126 |
127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
128 | code_sign_cmd="$code_sign_cmd &"
129 | fi
130 | echo "$code_sign_cmd"
131 | eval "$code_sign_cmd"
132 | fi
133 | }
134 |
135 | # Strip invalid architectures
136 | strip_invalid_archs() {
137 | binary="$1"
138 | # Get architectures for current target binary
139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
140 | # Intersect them with the architectures we are building for
141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
142 | # If there are no archs supported by this binary then warn the user
143 | if [[ -z "$intersected_archs" ]]; then
144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
145 | STRIP_BINARY_RETVAL=0
146 | return
147 | fi
148 | stripped=""
149 | for arch in $binary_archs; do
150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then
151 | # Strip non-valid architectures in-place
152 | lipo -remove "$arch" -output "$binary" "$binary"
153 | stripped="$stripped $arch"
154 | fi
155 | done
156 | if [[ "$stripped" ]]; then
157 | echo "Stripped $binary of architectures:$stripped"
158 | fi
159 | STRIP_BINARY_RETVAL=1
160 | }
161 |
162 |
163 | if [[ "$CONFIGURATION" == "Debug" ]]; then
164 | install_framework "${BUILT_PRODUCTS_DIR}/LCActionSheet/LCActionSheet.framework"
165 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework"
166 | install_framework "${PODS_ROOT}/Reveal-SDK/RevealServer-21/iOS/RevealServer.framework"
167 | fi
168 | if [[ "$CONFIGURATION" == "Release" ]]; then
169 | install_framework "${BUILT_PRODUCTS_DIR}/LCActionSheet/LCActionSheet.framework"
170 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework"
171 | fi
172 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
173 | wait
174 | fi
175 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_LCActionSheet_ExampleVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_LCActionSheet_ExampleVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_ROOT}/Reveal-SDK/RevealServer-21/iOS"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet/LCActionSheet.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "Foundation" -framework "LCActionSheet" -framework "Masonry" -framework "QuartzCore" -framework "RevealServer" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_LCActionSheet_Example {
2 | umbrella header "Pods-LCActionSheet_Example-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Example/Pods-LCActionSheet_Example.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet/LCActionSheet.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "LCActionSheet" -framework "Masonry" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | ${PRODUCT_BUNDLE_IDENTIFIER}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | ${PRODUCT_NAME}
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | ${CURRENT_PROJECT_VERSION}
23 | NSPrincipalClass
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 | Generated by CocoaPods - https://cocoapods.org
4 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests-acknowledgements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreferenceSpecifiers
6 |
7 |
8 | FooterText
9 | This application makes use of the following third party libraries:
10 | Title
11 | Acknowledgements
12 | Type
13 | PSGroupSpecifier
14 |
15 |
16 | FooterText
17 | Generated by CocoaPods - https://cocoapods.org
18 | Title
19 |
20 | Type
21 | PSGroupSpecifier
22 |
23 |
24 | StringsTable
25 | Acknowledgements
26 | Title
27 | Acknowledgements
28 |
29 |
30 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_LCActionSheet_Tests : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_LCActionSheet_Tests
5 | @end
6 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests-umbrella.h:
--------------------------------------------------------------------------------
1 | #ifdef __OBJC__
2 | #import
3 | #else
4 | #ifndef FOUNDATION_EXPORT
5 | #if defined(__cplusplus)
6 | #define FOUNDATION_EXPORT extern "C"
7 | #else
8 | #define FOUNDATION_EXPORT extern
9 | #endif
10 | #endif
11 | #endif
12 |
13 |
14 | FOUNDATION_EXPORT double Pods_LCActionSheet_TestsVersionNumber;
15 | FOUNDATION_EXPORT const unsigned char Pods_LCActionSheet_TestsVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" "${PODS_ROOT}/Reveal-SDK/RevealServer-21/iOS"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet/LCActionSheet.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
5 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "Foundation" -framework "LCActionSheet" -framework "Masonry" -framework "QuartzCore" -framework "RevealServer" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests.modulemap:
--------------------------------------------------------------------------------
1 | framework module Pods_LCActionSheet_Tests {
2 | umbrella header "Pods-LCActionSheet_Tests-umbrella.h"
3 |
4 | export *
5 | module * { export * }
6 | }
7 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Pods-LCActionSheet_Tests/Pods-LCActionSheet_Tests.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/LCActionSheet/LCActionSheet.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers"
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "LCActionSheet" -framework "Masonry" -framework "UIKit"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
9 | PODS_ROOT = ${SRCROOT}/Pods
10 |
--------------------------------------------------------------------------------
/Example/Pods/Target Support Files/Reveal-SDK/Reveal-SDK.xcconfig:
--------------------------------------------------------------------------------
1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Reveal-SDK
2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Reveal-SDK/RevealServer-21/iOS"
3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks
5 | OTHER_LDFLAGS = $(inherited) -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "QuartzCore"
6 | PODS_BUILD_DIR = ${BUILD_DIR}
7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
8 | PODS_ROOT = ${SRCROOT}
9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Reveal-SDK
10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
11 | SKIP_INSTALL = YES
12 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | BNDL
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleSignature
18 | ????
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Example/Tests/Tests-Prefix.pch:
--------------------------------------------------------------------------------
1 | // The contents of this file are implicitly included at the beginning of every test case source file.
2 |
3 | #ifdef __OBJC__
4 |
5 |
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/Example/Tests/Tests.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetTests.m
3 | // LCActionSheetTests
4 | //
5 | // Created by iTofu on 03/12/2019.
6 | // Copyright (c) 2019 iTofu. All rights reserved.
7 | //
8 |
9 | @import XCTest;
10 |
11 | @interface Tests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation Tests
16 |
17 | - (void)setUp
18 | {
19 | [super setUp];
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 | }
22 |
23 | - (void)tearDown
24 | {
25 | // Put teardown code here. This method is called after the invocation of each test method in the class.
26 | [super tearDown];
27 | }
28 |
29 | - (void)testExample
30 | {
31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__);
32 | }
33 |
34 | @end
35 |
36 |
--------------------------------------------------------------------------------
/Example/Tests/en.lproj/InfoPlist.strings:
--------------------------------------------------------------------------------
1 | /* Localized versions of Info.plist keys */
2 |
3 |
--------------------------------------------------------------------------------
/LCActionSheet.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod lib lint LCActionSheet.podspec' to ensure this is a
3 | # valid spec before submitting.
4 | #
5 | # Any lines starting with a # are optional, but their use is encouraged
6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
7 | #
8 |
9 | Pod::Spec.new do |s|
10 | s.name = 'LCActionSheet'
11 | s.version = '3.5.5'
12 | s.summary = 'A simple, ornamental, but powerful action sheet! Support: https://LeoDev.me'
13 |
14 | # This description is used to generate tags and improve search results.
15 | # * Think: What does it do? Why did you write it? What is the focus?
16 | # * Try to keep it short, snappy and to the point.
17 | # * Write the description between the DESC delimiters below.
18 | # * Finally, don't worry about the indent, CocoaPods strips it!
19 |
20 | s.description = <<-DESC
21 | A simple, ornamental, but powerful action sheet! Support: https://LeoDev.me
22 | 一款简约而不失强大的 ActionSheet,微博、微信和 QQ 都采用了极其类似的样式,完全支持 Swift。
23 | DESC
24 |
25 | s.homepage = 'https://github.com/iTofu/LCActionSheet'
26 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
27 | s.license = { :type => 'MIT', :file => 'LICENSE' }
28 | s.author = { 'Leo' => 'leodaxia@gmail.com' }
29 | s.source = { :git => 'https://github.com/iTofu/LCActionSheet.git', :tag => s.version.to_s }
30 | s.social_media_url = 'https://twitter.com/LeoDaxia'
31 |
32 | s.swift_version = "4.2"
33 |
34 | s.ios.deployment_target = '8.0'
35 |
36 | s.source_files = 'LCActionSheet/Classes/**/*'
37 |
38 | # s.resource_bundles = {
39 | # 'LCActionSheet' => ['LCActionSheet/Assets/*.png']
40 | # }
41 |
42 | # s.public_header_files = 'Pod/Classes/**/*.h'
43 | # s.frameworks = 'UIKit', 'MapKit'
44 | # s.dependency 'AFNetworking', '~> 2.3'
45 | s.dependency 'Masonry', '~> 1.1.0'
46 | end
47 |
--------------------------------------------------------------------------------
/LCActionSheet/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/LCActionSheet/Assets/.gitkeep
--------------------------------------------------------------------------------
/LCActionSheet/Classes/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/LCActionSheet/Classes/.gitkeep
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetCell.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/7/15.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import
29 |
30 |
31 | #define LC_ACTION_SHEET_CELL_NO_HIDDE_LINE_TAG 100
32 | #define LC_ACTION_SHEET_CELL_HIDDE_LINE_TAG 101
33 |
34 | NS_ASSUME_NONNULL_BEGIN
35 |
36 | @interface LCActionSheetCell : UITableViewCell
37 |
38 | /**
39 | Title label.
40 | */
41 | @property (nonatomic, weak) UILabel *titleLabel;
42 |
43 | /**
44 | Line.
45 | */
46 | @property (nonatomic, weak) UIView *lineView;
47 |
48 | /**
49 | Button's edge insets. Default is `UIEdgeInsetsMake(8.0, 15.0, 8.0f, 15.0f)`.
50 | */
51 | @property (nonatomic, assign) UIEdgeInsets buttonEdgeInsets;
52 |
53 | /**
54 | Cell's separator color.
55 | */
56 | @property (nonatomic, strong) UIColor *cellSeparatorColor;
57 |
58 | @end
59 |
60 | NS_ASSUME_NONNULL_END
61 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetCell.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/7/15.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import "LCActionSheetCell.h"
29 | #import "Masonry.h"
30 | #import "LCActionSheetConfig.h"
31 |
32 | @interface LCActionSheetCell ()
33 |
34 | /**
35 | * Highlighted View.
36 | */
37 | @property (nonatomic, weak) UIView *highlightedView;
38 |
39 | @end
40 |
41 | @implementation LCActionSheetCell
42 |
43 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
44 | if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
45 | self.clipsToBounds = YES;
46 | self.backgroundColor = [UIColor clearColor];
47 |
48 | // UIView *selBgView = [[UIView alloc] init];
49 | // selBgView.backgroundColor = LC_ACTION_SHEET_BG_COLOR_HIGHLIGHTED;
50 | // self.selectedBackgroundView = selBgView;
51 |
52 |
53 | UIView *highlightedView = [[UIView alloc] init];
54 | highlightedView.backgroundColor = self.cellSeparatorColor;
55 | highlightedView.clipsToBounds = YES;
56 | highlightedView.hidden = YES;
57 | [self.contentView addSubview:highlightedView];
58 | self.highlightedView = highlightedView;
59 | [highlightedView mas_makeConstraints:^(MASConstraintMaker *make) {
60 | make.edges.equalTo(self.contentView);
61 | }];
62 |
63 | UILabel *titleLabel = [[UILabel alloc] init];
64 | titleLabel.textAlignment = NSTextAlignmentCenter;
65 | titleLabel.adjustsFontSizeToFitWidth = YES;
66 | [self.contentView addSubview:titleLabel];
67 | self.titleLabel = titleLabel;
68 | [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
69 | make.edges.equalTo(self.contentView).insets(self.buttonEdgeInsets);
70 | }];
71 |
72 | UIView *lineView = [[UIView alloc] init];
73 | lineView.backgroundColor = self.cellSeparatorColor;
74 | lineView.contentMode = UIViewContentModeBottom;
75 | lineView.clipsToBounds = YES;
76 | [self.contentView addSubview:lineView];
77 | self.lineView = lineView;
78 | [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
79 | make.left.right.bottom.equalTo(self.contentView);
80 | make.height.offset(1 / 3.0);
81 | }];
82 | }
83 | return self;
84 | }
85 |
86 | - (void)setButtonEdgeInsets:(UIEdgeInsets)buttonEdgeInsets {
87 | _buttonEdgeInsets = buttonEdgeInsets;
88 |
89 | [self.titleLabel mas_updateConstraints:^(MASConstraintMaker *make) {
90 | make.edges.equalTo(self.contentView).insets(self.buttonEdgeInsets);
91 | }];
92 | }
93 |
94 |
95 | - (void)setCellSeparatorColor:(UIColor *)cellSeparatorColor {
96 | _cellSeparatorColor = cellSeparatorColor;
97 |
98 | self.highlightedView.backgroundColor = cellSeparatorColor;
99 | self.lineView.backgroundColor = cellSeparatorColor;
100 | }
101 |
102 | - (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {
103 | if (self.tag == LC_ACTION_SHEET_CELL_HIDDE_LINE_TAG) {
104 | self.lineView.hidden = YES;
105 | } else {
106 | self.lineView.hidden = highlighted;
107 | }
108 |
109 | self.highlightedView.hidden = !highlighted;
110 | }
111 |
112 | @end
113 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetConfig.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetConfig.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/11/29.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import
29 |
30 |
31 | #define kLCActionSheetColor(r, g, b) kLCActionSheetColorA(r, g, b, 1.0f)
32 | #define kLCActionSheetColorA(r, g, b, a) [UIColor colorWithRed:(r)/255.0f\
33 | green:(g)/255.0f\
34 | blue:(b)/255.0f\
35 | alpha:a]
36 |
37 |
38 | NS_ASSUME_NONNULL_BEGIN
39 |
40 | @interface LCActionSheetConfig : NSObject
41 |
42 | /**
43 | Title.
44 | */
45 | @property (nullable, nonatomic, copy) NSString *title;
46 |
47 | /**
48 | Cancel button's title.
49 | */
50 | @property (nullable, nonatomic, copy) NSString *cancelButtonTitle;
51 |
52 | /**
53 | Cancel button's index.
54 | */
55 | @property (nonatomic, assign, readonly) NSInteger cancelButtonIndex;
56 |
57 | /**
58 | All destructive buttons' set. You should give it the `NSNumber` type items.
59 | */
60 | @property (nullable, nonatomic, strong) NSIndexSet *destructiveButtonIndexSet;
61 |
62 | /**
63 | Destructive button's color. Default is RGB(254, 67, 37).
64 | */
65 | @property (nonatomic, strong) UIColor *destructiveButtonColor;
66 | /**
67 | Destructive button's background color. Default is `[UIColor clearColor]`.
68 | */
69 | @property (nonatomic, strong) UIColor *destructiveButtonBgColor;
70 |
71 | /**
72 | Title's color. Default is `[UIColor blackColor]`.
73 | */
74 | @property (nonatomic, strong) UIColor *titleColor;
75 |
76 | /**
77 | Cancel button's color. Default is `buttonColor`.
78 | */
79 | @property (nonatomic, strong) UIColor *cancelButtonColor;
80 | /**
81 | Cancel button's backgroundColor, without destructive buttons. Default is `[UIColor clarColor]`.
82 | */
83 | @property (nonatomic, strong) UIColor *cancelButtonBgColor;
84 |
85 | /**
86 | Buttons' color, without destructive buttons. Default is `[UIColor blackColor]`.
87 | */
88 | @property (nonatomic, strong) UIColor *buttonColor;
89 | /**
90 | Buttons' backgroundColor, without destructive buttons. Default is `[UIColor clarColor]`.
91 | */
92 | @property (nonatomic, strong) UIColor *buttonBgColor;
93 |
94 | /**
95 | Title's font. Default is `[UIFont systemFontOfSize:14.0f]`.
96 | */
97 | @property (nonatomic, strong) UIFont *titleFont;
98 | /**
99 | All buttons' font. Default is `[UIFont systemFontOfSize:18.0f]`.
100 | */
101 | @property (nonatomic, strong) UIFont *buttonFont;
102 | /**
103 | All buttons' height. Default is 49.0f;
104 | */
105 | @property (nonatomic, assign) CGFloat buttonHeight;
106 | /**
107 | All buttons' corner. Default is 0.0f;
108 | */
109 | @property (nonatomic, assign) CGFloat buttonCornerRadius;
110 |
111 |
112 | /**
113 | If buttons' bottom view can scrolling. Default is NO.
114 | */
115 | @property (nonatomic, assign, getter=canScrolling) BOOL scrolling;
116 |
117 | /**
118 | Visible buttons' count. You have to set `scrolling = YES` if you want to set it.
119 | */
120 | @property (nonatomic, assign) CGFloat visibleButtonCount;
121 |
122 | /**
123 | Animation duration. Default is 0.3 seconds.
124 | */
125 | @property (nonatomic, assign) CGFloat animationDuration;
126 |
127 | /**
128 | Opacity of dark background. Default is 0.3f.
129 | */
130 | @property (nonatomic, assign) CGFloat darkOpacity;
131 |
132 | /**
133 | If you can tap darkView to dismiss. Defalut is NO, you can tap dardView to dismiss.
134 | */
135 | @property (nonatomic, assign) BOOL darkViewNoTaped;
136 |
137 | /**
138 | Clear blur effect. Default is NO, don't clear blur effect.
139 | */
140 | @property (nonatomic, assign) BOOL unBlur;
141 |
142 | /**
143 | Style of blur effect. Default is `UIBlurEffectStyleExtraLight`. iOS 8.0 +
144 | */
145 | @property (nonatomic, assign) UIBlurEffectStyle blurEffectStyle;
146 |
147 | /**
148 | Title's edge insets. Default is `UIEdgeInsetsMake(15.0f, 15.0f, 15.0f, 15.0f)`.
149 | */
150 | @property (nonatomic, assign) UIEdgeInsets titleEdgeInsets;
151 | /**
152 | Title's edge insets. Default is `UIEdgeInsetsMake(8.0, 15.0, 8.0f, 15.0f)`.
153 | */
154 | @property (nonatomic, assign) UIEdgeInsets buttonEdgeInsets;
155 | ///**
156 | // ActionSheet's edge insets. Default is `UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f)`.
157 | // */
158 | //@property (nonatomic, assign) UIEdgeInsets actionSheetEdgeInsets;
159 |
160 | /**
161 | Cell's separator color. Default is `RGBA(170/255.0f, 170/255.0f, 170/255.0f, 0.5f)`.
162 | */
163 | @property (nonatomic, strong) UIColor *separatorColor;
164 |
165 | /**
166 | Blur view's background color. Default is `RGBA(255.0/255.0f, 255.0/255.0f, 255.0/255.0f, 0.5f)`.
167 | */
168 | @property (nonatomic, strong) UIColor *blurBackgroundColor;
169 |
170 | /**
171 | Title can be limit in numberOfTitleLines. Default is 0.
172 | */
173 | @property (nonatomic, assign) NSInteger numberOfTitleLines;
174 |
175 | /**
176 | Auto hide when the device rotated. Default is NO, won't auto hide.
177 | */
178 | @property (nonatomic, assign) BOOL autoHideWhenDeviceRotated;
179 |
180 | /**
181 | Disable auto dismiss after clicking. Default is NO, will auto dismiss.
182 | */
183 | @property (nonatomic, assign) BOOL disableAutoDismissAfterClicking;
184 |
185 | /**
186 | LCActionSheetConfig shared instance.
187 | */
188 | @property (class, nonatomic, strong, readonly) LCActionSheetConfig *config;
189 |
190 | /**
191 | LCActionSheetConfig shared instance.
192 | */
193 | + (instancetype)shared NS_DEPRECATED_IOS(2_0, 10_0, "Method deprecated. Use class property `config` instead.");
194 |
195 | @end
196 |
197 | NS_ASSUME_NONNULL_END
198 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetConfig.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetConfig.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/11/29.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import "LCActionSheetConfig.h"
29 |
30 |
31 | #define kLCActionSheetButtonHeight 49.0f
32 |
33 | #define kLCActionSheetRedColor kLCActionSheetColor(254, 67, 37)
34 |
35 | #define kLCActionSheetTitleFont [UIFont systemFontOfSize:14.0f]
36 |
37 | #define kLCActionSheetButtonFont [UIFont systemFontOfSize:18.0f]
38 |
39 | #define kLCActionSheetAnimationDuration 0.3f
40 |
41 | #define kLCActionSheetDarkOpacity 0.3f
42 |
43 | #define kLCActionSheetBlurBgColorNormal [[UIColor whiteColor] colorWithAlphaComponent:0.5]
44 | //#define kLCActionSheetBlurBgColorHighlighted [[UIColor whiteColor] colorWithAlphaComponent:0.1]
45 |
46 |
47 | @implementation LCActionSheetConfig
48 |
49 | + (LCActionSheetConfig *)config {
50 | static id _config = nil;
51 | static dispatch_once_t onceToken;
52 | dispatch_once(&onceToken, ^{
53 | _config = [[self alloc] initSharedInstance];
54 | });
55 | return _config;
56 | }
57 |
58 | + (instancetype)shared {
59 | return self.config;
60 | }
61 |
62 | - (instancetype)initSharedInstance {
63 | if (self = [super init]) {
64 | self.titleFont = kLCActionSheetTitleFont;
65 | self.buttonFont = kLCActionSheetButtonFont;
66 | self.destructiveButtonColor = kLCActionSheetRedColor;
67 | self.titleColor = kLCActionSheetColor(111.0f, 111.0f, 111.0f);
68 | self.buttonColor = [UIColor blackColor];
69 |
70 | self.buttonHeight = kLCActionSheetButtonHeight;
71 | self.animationDuration = kLCActionSheetAnimationDuration;
72 | self.darkOpacity = kLCActionSheetDarkOpacity;
73 |
74 | self.titleEdgeInsets = UIEdgeInsetsMake(15.0f, 15.0f, 15.0f, 15.0f);
75 | self.buttonEdgeInsets = UIEdgeInsetsMake(8.0, 15.0, 8.0, 15.0);
76 | // self.actionSheetEdgeInsets = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f);
77 |
78 | self.separatorColor = kLCActionSheetColorA(150.0f, 150.0f, 150.0f, 0.3f);
79 | self.blurBackgroundColor = kLCActionSheetBlurBgColorNormal;
80 |
81 | self.cancelButtonColor = self.buttonColor;
82 | self.cancelButtonBgColor = [UIColor clearColor];
83 | self.buttonBgColor = [UIColor clearColor];
84 | self.destructiveButtonBgColor = [UIColor clearColor];
85 | self.buttonCornerRadius = 0.0f;
86 | }
87 | return self;
88 | }
89 |
90 | - (instancetype)init {
91 | return LCActionSheetConfig.config;
92 | }
93 |
94 | - (NSInteger)cancelButtonIndex {
95 | return 0;
96 | }
97 |
98 | @end
99 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetViewController.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 12/05/2017.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import
29 |
30 |
31 | NS_ASSUME_NONNULL_BEGIN
32 |
33 | @interface LCActionSheetViewController : UIViewController
34 |
35 | /**
36 | Status bar hidden. Same as the original.
37 | */
38 | @property (nonatomic, assign) BOOL statusBarHidden;
39 |
40 | /**
41 | Status bar style. Same as the original.
42 | */
43 | @property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
44 |
45 | @end
46 |
47 | NS_ASSUME_NONNULL_END
48 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/LCActionSheetViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // LCActionSheetViewController.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 12/05/2017.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import "LCActionSheetViewController.h"
29 |
30 | @implementation LCActionSheetViewController
31 |
32 | - (BOOL)prefersStatusBarHidden {
33 | return self.statusBarHidden;
34 | }
35 |
36 | - (UIStatusBarStyle)preferredStatusBarStyle {
37 | return self.statusBarStyle;
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/UIDevice+LCActionSheet.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIDevice+LCActionSheet.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2017/10/10.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import
29 |
30 |
31 | NS_ASSUME_NONNULL_BEGIN
32 |
33 | @interface UIDevice (LCActionSheet)
34 |
35 | /**
36 | Return `YES` if current device is iPhone X.
37 |
38 | iPhone X Safe Area
39 | - Top: +24.0pt
40 | - Bottom: +34.0pt
41 |
42 | @return Whether it is iPhone X
43 | */
44 | - (BOOL)lc_isX;
45 |
46 | @end
47 |
48 | NS_ASSUME_NONNULL_END
49 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/UIDevice+LCActionSheet.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIDevice+LCActionSheet.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2017/10/10.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 | #import "UIDevice+LCActionSheet.h"
28 |
29 | @implementation UIDevice (LCActionSheet)
30 |
31 | - (BOOL)lc_isX {
32 | CGSize screenSize = [UIScreen mainScreen].bounds.size;
33 | CGFloat height = MAX(screenSize.width, screenSize.height);
34 | BOOL isX = height == 812.0 || height == 896.0;
35 | return isX;
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/UIImage+LCActionSheet.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LCActionSheet.h
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/11/29.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import
29 |
30 |
31 | NS_ASSUME_NONNULL_BEGIN
32 |
33 | @interface UIImage (LCActionSheet)
34 |
35 | /**
36 | Create a image with the color.
37 | */
38 | + (nullable instancetype)lc_imageWithColor:(UIColor *)color;
39 |
40 | @end
41 |
42 | NS_ASSUME_NONNULL_END
43 |
--------------------------------------------------------------------------------
/LCActionSheet/Classes/UIImage+LCActionSheet.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIImage+LCActionSheet.m
3 | // LCActionSheet
4 | //
5 | // Created by Leo on 2016/11/29.
6 | //
7 | // Copyright (c) 2015-2019 Leo
8 | //
9 | // Permission is hereby granted, free of charge, to any person obtaining a copy
10 | // of this software and associated documentation files (the "Software"), to deal
11 | // in the Software without restriction, including without limitation the rights
12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | // copies of the Software, and to permit persons to whom the Software is
14 | // furnished to do so, subject to the following conditions:
15 | //
16 | // The above copyright notice and this permission notice shall be included in all
17 | // copies or substantial portions of the Software.
18 | //
19 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 | // SOFTWARE.
26 |
27 |
28 | #import "UIImage+LCActionSheet.h"
29 |
30 | @implementation UIImage (LCActionSheet)
31 |
32 | + (instancetype)lc_imageWithColor:(UIColor *)color {
33 | CGRect rect = CGRectMake(0.0f, 0.0f, 2.0f, 2.0f);
34 |
35 | UIGraphicsBeginImageContext(rect.size);
36 | CGContextRef context = UIGraphicsGetCurrentContext();
37 | CGContextSetFillColorWithColor(context, [color CGColor]);
38 | CGContextFillRect(context, rect);
39 | UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
40 | UIGraphicsEndImageContext();
41 |
42 | return image;
43 | }
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2019 iTofu
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
20 |
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemo01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemo01.png
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemo02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemo02.png
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemo03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemo03.png
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemoGif01.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemoGif01.gif
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemoGif02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemoGif02.gif
--------------------------------------------------------------------------------
/Preview/LCActionSheetDemoGif03.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iTofu/LCActionSheet/5d78c56dbe285347e5cde16861ddbc3811a2ddc0/Preview/LCActionSheetDemoGif03.webp
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # LCActionSheet
2 |
3 | [](https://travis-ci.org/iTofu/LCActionSheet)
4 | [](https://cocoapods.org/pods/LCActionSheet)
5 | [](https://cocoapods.org/pods/LCActionSheet)
6 | [](https://cocoapods.org/pods/LCActionSheet)
7 | [](https://github.com/iTofu/LCActionSheet)
8 | [](https://cocoapods.org/pods/LCActionSheet)
9 | [](https://leodev.me)
10 | [](https://github.com/iTofu/LCActionSheet)
11 |
12 | A simple ActionSheet. WeChat, Weibo and QQ all use similar styles. Fully support Swift.
13 |
14 |
15 |
16 | [🇨🇳中文介绍][1]
17 |
18 | ## Example
19 |
20 | To run the example project, clone the repo, and run `pod install` from the Example directory first.
21 |
22 | ## Requirements
23 |
24 | * iOS 7.0+
25 | * Xcode 7.0+
26 | * Objective-C & Swift
27 |
28 | ## Installation
29 |
30 | LCActionSheet is available through [CocoaPods](https://cocoapods.org). To install
31 | it, simply add the following line to your Podfile:
32 |
33 | ```ruby
34 | pod 'LCActionSheet'
35 | ```
36 |
37 | ## Author
38 |
39 | Leo, leodaxia@gmail.com
40 |
41 | ## License
42 |
43 | LCActionSheet is available under the MIT license. See the LICENSE file for more info.
44 |
45 |
46 | [1]: https://github.com/iTofu/LCActionSheet/blob/master/README_zh-CN.md
47 |
--------------------------------------------------------------------------------
/_Pods.xcodeproj:
--------------------------------------------------------------------------------
1 | Example/Pods/Pods.xcodeproj
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------