├── README ├── logo.png └── playground.gif ├── Pods ├── Target Support Files │ ├── EasyPeasy │ │ ├── EasyPeasy-prefix.pch │ │ ├── EasyPeasy.modulemap │ │ ├── EasyPeasy-dummy.m │ │ ├── EasyPeasy-umbrella.h │ │ ├── EasyPeasy.xcconfig │ │ └── Info.plist │ └── Pods-EasyPeasyPlayground │ │ ├── Pods-EasyPeasyPlayground.modulemap │ │ ├── Pods-EasyPeasyPlayground-dummy.m │ │ ├── Pods-EasyPeasyPlayground-umbrella.h │ │ ├── Pods-EasyPeasyPlayground.debug.xcconfig │ │ ├── Pods-EasyPeasyPlayground.release.xcconfig │ │ ├── Info.plist │ │ ├── Pods-EasyPeasyPlayground-acknowledgements.markdown │ │ ├── Pods-EasyPeasyPlayground-acknowledgements.plist │ │ ├── Pods-EasyPeasyPlayground-frameworks.sh │ │ └── Pods-EasyPeasyPlayground-resources.sh ├── Manifest.lock ├── Pods.xcodeproj │ ├── xcuserdata │ │ └── nakio.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── xcschememanagement.plist │ │ │ ├── EasyPeasy.xcscheme │ │ │ └── Pods-EasyPeasyPlayground.xcscheme │ └── project.pbxproj └── EasyPeasy │ ├── LICENSE │ ├── EasyPeasy │ ├── NSLayoutConstraint+Internal.swift │ ├── Priority.swift │ ├── UIView+Internal.swift │ ├── CompoundAttribute.swift │ ├── Attribute+Operators.swift │ ├── Constant.swift │ ├── Attribute+Install.swift │ ├── DimensionAttribute.swift │ ├── UIView+Easy.swift │ ├── Attribute.swift │ ├── ReferenceAttribute.swift │ └── PositionAttribute.swift │ └── README.md ├── EasyPeasyPlayground.playground ├── timeline.xctimeline ├── playground.xcworkspace │ └── contents.xcworkspacedata ├── contents.xcplayground └── Contents.swift ├── EasyPeasyPlayground.xcworkspace └── contents.xcworkspacedata ├── EasyPeasyPlayground ├── ViewController.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard └── AppDelegate.swift ├── README.md └── LICENSE /README/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakiostudio/EasyPeasy-Playground/HEAD/README/logo.png -------------------------------------------------------------------------------- /README/playground.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nakiostudio/EasyPeasy-Playground/HEAD/README/playground.gif -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/EasyPeasy-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #endif 4 | 5 | -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/EasyPeasy.modulemap: -------------------------------------------------------------------------------- 1 | framework module EasyPeasy { 2 | umbrella header "EasyPeasy-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /EasyPeasyPlayground.playground/timeline.xctimeline: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/EasyPeasy-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_EasyPeasy : NSObject 3 | @end 4 | @implementation PodsDummy_EasyPeasy 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - EasyPeasy (0.2.1) 3 | 4 | DEPENDENCIES: 5 | - EasyPeasy 6 | 7 | SPEC CHECKSUMS: 8 | EasyPeasy: f8e0d3d06ce3ca7dbc8f852384266c53dd06c53c 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/EasyPeasy-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double EasyPeasyVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char EasyPeasyVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /EasyPeasyPlayground.playground/playground.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_EasyPeasyPlayground { 2 | umbrella header "Pods-EasyPeasyPlayground-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_EasyPeasyPlayground : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_EasyPeasyPlayground 5 | @end 6 | -------------------------------------------------------------------------------- /EasyPeasyPlayground.playground/contents.xcplayground: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-umbrella.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | 4 | FOUNDATION_EXPORT double Pods_EasyPeasyPlaygroundVersionNumber; 5 | FOUNDATION_EXPORT const unsigned char Pods_EasyPeasyPlaygroundVersionString[]; 6 | 7 | -------------------------------------------------------------------------------- /EasyPeasyPlayground.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/EasyPeasy.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/EasyPeasy" "${PODS_ROOT}/Headers/Public" 3 | OTHER_LDFLAGS = -framework "UIKit" 4 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 5 | PODS_ROOT = ${SRCROOT} 6 | SKIP_INSTALL = YES -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/EasyPeasy.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "EasyPeasy" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-EasyPeasyPlayground 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 4 | OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/EasyPeasy.framework/Headers" 5 | OTHER_LDFLAGS = $(inherited) -framework "EasyPeasy" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 7 | PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-EasyPeasyPlayground 8 | PODS_ROOT = ${SRCROOT}/Pods -------------------------------------------------------------------------------- /EasyPeasyPlayground/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // EasyPeasyPlayground 4 | // 5 | // Created by Carlos Vidal Pallin on 09/04/2016. 6 | // Copyright © 2016 nakioStudio. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | override func viewDidLoad() { 14 | super.viewDidLoad() 15 | // Do any additional setup after loading the view, typically from a nib. 16 | } 17 | 18 | override func didReceiveMemoryWarning() { 19 | super.didReceiveMemoryWarning() 20 | // Dispose of any resources that can be recreated. 21 | } 22 | 23 | 24 | } 25 | 26 | -------------------------------------------------------------------------------- /EasyPeasyPlayground/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/nakio.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | EasyPeasy.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-EasyPeasyPlayground.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 04D1808FE55FC4475CD2FBD432AD72A8 21 | 22 | primary 23 | 24 | 25 | B22E5CA2A4EFB3B5EE6DDDFB0850E940 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![logo](README/logo.png) 2 | 3 | [![Version](https://img.shields.io/cocoapods/v/EasyPeasy.svg?style=flat)](http://cocoapods.org/pods/EasyPeasy) 4 | [![Docs](https://img.shields.io/cocoapods/metrics/doc-percent/EasyPeasy.svg)](http://cocoadocs.org/docsets/EasyPeasy) 5 | 6 | ## Playground 7 | 8 | This repository contains a tiny example of **EasyPeasy** laying out and animating 9 | constraints. 10 | 11 | ![gif](README/playground.gif) 12 | 13 | In order to make it run, just: 14 | 15 | 1. Open the `EasyPeasyPlayground.xcworkspace` file. 16 | 17 | 2. Build the **EasyPeasy** scheme. 18 | 19 | 3. Show the assistant editor. 20 | 21 | 4. Click on *Execute Playground*. 22 | 23 | ## EasyPeasy 24 | 25 | **EasyPeasy** is available [here](https://github.com/nakiostudio/EasyPeasy). 26 | 27 | ## Author 28 | 29 | Carlos Vidal - [@carlostify](https://twitter.com/carlostify) 30 | 31 | ## License 32 | 33 | EasyPeasy is available under the MIT license. See the LICENSE file for more info. 34 | -------------------------------------------------------------------------------- /Pods/Target Support Files/EasyPeasy/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Carlos Vidal 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Carlos Vidal 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/NSLayoutConstraint+Internal.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import UIKit 12 | 13 | internal var easy_attributeReference: Int = 0 14 | 15 | /** 16 | Associated objects applicable to `NSLayoutConstraint` 17 | */ 18 | internal extension NSLayoutConstraint { 19 | 20 | /// Association with the *EasyPeasy* `Attribute` 21 | /// that created the current `NSLayoutConstraint` 22 | internal var easy_attribute: Attribute? { 23 | get { 24 | return objc_getAssociatedObject(self, &easy_attributeReference) as? Attribute 25 | } 26 | 27 | set { 28 | let policy = objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC 29 | objc_setAssociatedObject(self, &easy_attributeReference, newValue, policy) 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /EasyPeasyPlayground/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/Priority.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | Enum which offers 3 pre-defined levels of `UILayoutPriority` 15 | as well as a case wrapping a `Float` value to specify actual 16 | values 17 | */ 18 | public enum Priority { 19 | 20 | case CustomPriority(Float) 21 | case HighPriority 22 | case MediumPriority 23 | case LowPriority 24 | 25 | /** 26 | `UILayoutPriority` equivalent to the current case 27 | - returns `UILayoutPriority` 28 | */ 29 | internal func layoutPriority() -> Float { 30 | switch self { 31 | case .CustomPriority(let value): return value 32 | case .HighPriority: return 1000.0 33 | case .MediumPriority: return 500.0 34 | case .LowPriority: return 1.0 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## EasyPeasy 5 | 6 | Copyright (c) 2016 Carlos Vidal 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | Generated by CocoaPods - http://cocoapods.org 27 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/UIView+Internal.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import UIKit 12 | 13 | internal var easy_attributesReference: Int = 0 14 | 15 | /** 16 | Associated objects applicable to `UIView` and subclasses 17 | */ 18 | internal extension UIView { 19 | 20 | /// Association with an array containing all the *EasyPeasy* 21 | /// attributes applied to the current view 22 | internal var easy_attributes: [Attribute] { 23 | get { 24 | if let attributes = objc_getAssociatedObject(self, &easy_attributesReference) as? 25 | [Attribute] { 26 | return attributes 27 | } 28 | return [] 29 | } 30 | 31 | set { 32 | let policy = objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC 33 | objc_setAssociatedObject(self, &easy_attributesReference, newValue, policy) 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /EasyPeasyPlayground/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 | -------------------------------------------------------------------------------- /EasyPeasyPlayground/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 | -------------------------------------------------------------------------------- /EasyPeasyPlayground/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // EasyPeasyPlayground 4 | // 5 | // Created by Carlos Vidal Pallin on 09/04/2016. 6 | // Copyright © 2016 nakioStudio. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(application: UIApplication) { 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 | func applicationDidBecomeActive(application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2016 Carlos Vidal <nakioparkour@gmail.com> 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | 37 | Title 38 | EasyPeasy 39 | Type 40 | PSGroupSpecifier 41 | 42 | 43 | FooterText 44 | Generated by CocoaPods - http://cocoapods.org 45 | Title 46 | 47 | Type 48 | PSGroupSpecifier 49 | 50 | 51 | StringsTable 52 | Acknowledgements 53 | Title 54 | Acknowledgements 55 | 56 | 57 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/nakio.xcuserdatad/xcschemes/EasyPeasy.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/nakio.xcuserdatad/xcschemes/Pods-EasyPeasyPlayground.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /EasyPeasyPlayground.playground/Contents.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY 4 | // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 5 | // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 6 | // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS 7 | // OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 8 | // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 9 | // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 10 | // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 11 | 12 | import UIKit 13 | import EasyPeasy 14 | import XCPlayground 15 | 16 | // Helper function 17 | func delay(delay:Double, closure:()->()) { 18 | dispatch_after( dispatch_time( DISPATCH_TIME_NOW, Int64(delay * Double(NSEC_PER_SEC))), 19 | dispatch_get_main_queue(), closure) 20 | } 21 | 22 | // Creating the views 23 | let container = UIView(frame: CGRect(x: 0, y: 0, width: 370.0, height: 370.0)) 24 | container.backgroundColor = UIColor.whiteColor() 25 | container.layer.borderColor = UIColor.darkGrayColor().CGColor 26 | container.layer.borderWidth = 1.0 27 | 28 | XCPlaygroundPage.currentPage.liveView = container 29 | 30 | let blueBox = UIView(frame: CGRectZero) 31 | blueBox.backgroundColor = UIColor(red: 0.0/255.0, green: 105.0/255.0, blue: 167.0/255.0, alpha: 1.0) 32 | container.addSubview(blueBox) 33 | 34 | let redBox = UIView(frame: CGRectZero) 35 | redBox.backgroundColor = UIColor(red: 240.0/255.0, green: 84.0/255.0, blue: 43.0/255.0, alpha: 1.0) 36 | container.addSubview(redBox) 37 | 38 | let greenBox = UIView(frame: CGRectZero) 39 | greenBox.backgroundColor = UIColor(red: 181.0/255.0, green: 206.0/255.0, blue: 61.0/255.0, alpha: 1.0) 40 | container.addSubview(greenBox) 41 | 42 | let yellowBox = UIView(frame: CGRectZero) 43 | yellowBox.backgroundColor = UIColor(red: 224.0/255.0, green: 176.0/255.0, blue: 75.0/255.0, alpha: 1.0) 44 | container.addSubview(yellowBox) 45 | 46 | // Adding the constraints 47 | blueBox <- [ 48 | Width(80), 49 | Height(50).with(.MediumPriority), 50 | Left(10), 51 | Bottom(10) 52 | ] 53 | 54 | redBox <- [ 55 | Width().like(blueBox), 56 | Height(*0.5).like(blueBox), 57 | Left(10).to(blueBox), 58 | Bottom().to(blueBox, .Bottom) 59 | ] 60 | 61 | greenBox <- [ 62 | Width().like(blueBox), 63 | Height(*0.5).like(redBox), 64 | Left(10).to(redBox), 65 | Bottom().to(redBox, .Bottom) 66 | ] 67 | 68 | yellowBox <- [ 69 | Width().like(blueBox), 70 | Height(*0.5).like(greenBox), 71 | Left(10).to(greenBox), 72 | Bottom().to(greenBox, .Bottom) 73 | ] 74 | 75 | // Animating the constraints 76 | delay(2.0) { 77 | 78 | UIView.animateWithDuration(1.5) { 79 | blueBox <- Top(10) 80 | container.layoutIfNeeded() 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/CompoundAttribute.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | `Attribute` that leads on the application of multiple 15 | `Attribute` objects 16 | */ 17 | public class CompoundAttribute: Attribute { 18 | 19 | /// Array of attributes that shape the `CompoundAttribute` 20 | public internal(set) var attributes: [Attribute] = [] 21 | 22 | // MARK: Public methods 23 | 24 | /** 25 | Sets the `priority` of the constraint and subconstraints 26 | - parameter priority: `Priority` enum specifying the 27 | priority of the constraint 28 | - returns: the `Attribute` instance 29 | */ 30 | public override func with(priority: Priority) -> Self { 31 | super.with(priority) 32 | for attribute in self.attributes { 33 | attribute.with(priority) 34 | } 35 | return self 36 | } 37 | 38 | /** 39 | Sets the `when` closure of the `Attribute` and each one 40 | of the `Attribute` objects shaping the `CompoundAttribute` 41 | - parameter closure: `Closure` to be called before 42 | installing a constraint 43 | - returns: the `Attribute` instance 44 | */ 45 | public override func when(closure: Condition?) -> Self { 46 | super.when(closure) 47 | for attribute in self.attributes { 48 | attribute.when(closure) 49 | } 50 | return self 51 | } 52 | 53 | // MARK: Internal methods 54 | 55 | /** 56 | This method evaluates whether an `Attribute` should be 57 | applied, resolves any conflicts with the `Attributes` 58 | already applied and it also generates the `NSLayoutConstraint` 59 | added to `view` for each one of the `Attribute` objects 60 | shaping the `CompoundAttribute` 61 | - parameter view: `UIView` in which the generated 62 | `NSLayoutConstraint` will be added 63 | - returns an `Array` of `NSLayoutConstraint` objects that will 64 | be installed on the `UIView` passed as parameter 65 | */ 66 | override func createConstraintForView(view: UIView) -> [NSLayoutConstraint] { 67 | // Reference to the target view 68 | self.createView = view 69 | 70 | // Create the constraints that will be installed in 71 | // the `UIView` given composing the `CompoundAttribute` 72 | var constraints: [NSLayoutConstraint] = [] 73 | for attribute in self.attributes { 74 | let newConstraints = attribute.createConstraintForView(view) 75 | constraints.appendContentsOf(newConstraints) 76 | } 77 | 78 | return constraints 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/Attribute+Operators.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | extension Attribute: Equatable { } 14 | 15 | /** 16 | Infix operator which determines whether two Attributes are equal 17 | */ 18 | public func == (lhs: Attribute, rhs: Attribute) -> Bool { 19 | 20 | // Create views 21 | if (lhs.createView === rhs.createView) == false { 22 | return false 23 | } 24 | 25 | // Create attributes 26 | if lhs.createAttribute.conflictingAttributes.contains(rhs.createAttribute) == false { 27 | return false 28 | } 29 | 30 | // Reference views 31 | if (lhs.referenceView === rhs.referenceView) == false { 32 | return false 33 | } 34 | 35 | // Reference attributes 36 | if lhs.referenceAttribute != rhs.referenceAttribute { 37 | return false 38 | } 39 | 40 | // Constant 41 | if lhs.constant.value != rhs.constant.value { 42 | return false 43 | } 44 | 45 | if lhs.constant.modifier != rhs.constant.modifier { 46 | return false 47 | } 48 | 49 | // Priorities conflict 50 | if lhs.priority.layoutPriority() != rhs.priority.layoutPriority() { 51 | return false 52 | } 53 | 54 | // Conditions conflict 55 | var lhsCondition = true 56 | if let createView = lhs.createView { 57 | lhsCondition = lhs.shouldInstallOnView(createView) 58 | } 59 | 60 | var rhsCondition = true 61 | if let createView = rhs.createView { 62 | rhsCondition = rhs.shouldInstallOnView(createView) 63 | } 64 | 65 | if lhsCondition != rhsCondition { 66 | return false 67 | } 68 | 69 | return true 70 | } 71 | 72 | infix operator =~ {} 73 | 74 | /** 75 | Infix operator which determines whether two Attributes conflict 76 | between them or not 77 | */ 78 | internal func =~ (installed: Attribute, toInstall: Attribute) -> Bool { 79 | 80 | // Create views conflict 81 | if (installed.createView === toInstall.createView) == false { 82 | return false 83 | } 84 | 85 | // Create attributes conflict 86 | if installed.createAttribute.conflictingAttributes.contains(toInstall.createAttribute) == false { 87 | return false 88 | } 89 | 90 | // Priorities conflict 91 | if installed.priority.layoutPriority() != toInstall.priority.layoutPriority() { 92 | return false 93 | } 94 | 95 | // Conditions conflict (we assume condition is true for 96 | // the installed view) 97 | var toInstallCondition = true 98 | if let createView = toInstall.createView { 99 | toInstallCondition = toInstall.shouldInstallOnView(createView) 100 | } 101 | 102 | if toInstallCondition == false { 103 | return false 104 | } 105 | 106 | return true 107 | } 108 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | install_framework() 10 | { 11 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 12 | local source="${BUILT_PRODUCTS_DIR}/$1" 13 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 14 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 15 | elif [ -r "$1" ]; then 16 | local source="$1" 17 | fi 18 | 19 | local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 20 | 21 | if [ -L "${source}" ]; then 22 | echo "Symlinked..." 23 | source="$(readlink "${source}")" 24 | fi 25 | 26 | # use filter instead of exclude so missing patterns dont' throw errors 27 | echo "rsync -av --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 28 | rsync -av --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 29 | 30 | local basename 31 | basename="$(basename -s .framework "$1")" 32 | binary="${destination}/${basename}.framework/${basename}" 33 | if ! [ -r "$binary" ]; then 34 | binary="${destination}/${basename}" 35 | fi 36 | 37 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 38 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 39 | strip_invalid_archs "$binary" 40 | fi 41 | 42 | # Resign the code if required by the build settings to avoid unstable apps 43 | code_sign_if_enabled "${destination}/$(basename "$1")" 44 | 45 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 46 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 47 | local swift_runtime_libs 48 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 49 | for lib in $swift_runtime_libs; do 50 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 51 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 52 | code_sign_if_enabled "${destination}/${lib}" 53 | done 54 | fi 55 | } 56 | 57 | # Signs a framework with the provided identity 58 | code_sign_if_enabled() { 59 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 60 | # Use the current code_sign_identitiy 61 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 62 | echo "/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements \"$1\"" 63 | /usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} --preserve-metadata=identifier,entitlements "$1" 64 | fi 65 | } 66 | 67 | # Strip invalid architectures 68 | strip_invalid_archs() { 69 | binary="$1" 70 | # Get architectures for current file 71 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 72 | stripped="" 73 | for arch in $archs; do 74 | if ! [[ "${VALID_ARCHS}" == *"$arch"* ]]; then 75 | # Strip non-valid architectures in-place 76 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 77 | stripped="$stripped $arch" 78 | fi 79 | done 80 | if [[ "$stripped" ]]; then 81 | echo "Stripped $binary of architectures:$stripped" 82 | fi 83 | } 84 | 85 | 86 | if [[ "$CONFIGURATION" == "Debug" ]]; then 87 | install_framework "Pods-EasyPeasyPlayground/EasyPeasy.framework" 88 | fi 89 | if [[ "$CONFIGURATION" == "Release" ]]; then 90 | install_framework "Pods-EasyPeasyPlayground/EasyPeasy.framework" 91 | fi 92 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/Constant.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | Modifier used when a relationship is created between the target `UIView` 15 | and the reference `UIView`. 16 | 17 | Unlike `NSLayoutRelation` this enum also includes a `MultipliedBy` case 18 | which acts as the `multiplier property of a `NSLayoutConstraint` 19 | */ 20 | public enum Modifier { 21 | 22 | case EqualTo 23 | case GreaterThanOrEqualTo 24 | case LessThanOrEqualTo 25 | case MultipliedBy 26 | 27 | } 28 | 29 | /** 30 | Struct that aggregates `NSLayoutRelation`, constant and multiplier of a 31 | layout constraint eventually created 32 | */ 33 | public struct Constant { 34 | 35 | /// Value of the constant 36 | let value: CGFloat 37 | 38 | /// Modifier applied to the `value` of the `Constant` 39 | var modifier: Modifier 40 | 41 | /** 42 | This initializer creates a `Constant` with the value supplied 43 | and the modifier `.EqualTo` 44 | - parameter value: Value of the `Constant` 45 | - returns: the `Constant` struct created 46 | */ 47 | init(_ value: CGFloat) { 48 | self.value = value 49 | self.modifier = .EqualTo 50 | } 51 | 52 | /** 53 | This initializer creates a `Constant` with the `value` and `modifier` 54 | supplied. 55 | - parameter value: Value of the `Constant` 56 | - parameter modifier: Modifier applied to the `value` 57 | - returns: the `Constant` struct created 58 | */ 59 | init(value: CGFloat, modifier: Modifier) { 60 | self.value = value 61 | self.modifier = modifier 62 | } 63 | 64 | /** 65 | `NSLayoutRelation` equivalent to the `modifier` of the `Constant` 66 | - returns: `NSLayoutRelation` equivalent 67 | */ 68 | internal func layoutRelation() -> NSLayoutRelation { 69 | switch self.modifier { 70 | case .EqualTo: return .Equal 71 | case .LessThanOrEqualTo: return .LessThanOrEqual 72 | case .GreaterThanOrEqualTo: return .GreaterThanOrEqual 73 | case .MultipliedBy: return .Equal 74 | } 75 | } 76 | 77 | /** 78 | Determines the `CGFloat` value of the multiplier for the `modifier` 79 | property 80 | - returns: `CGFloat` multiplier 81 | */ 82 | internal func layoutMultiplier() -> CGFloat { 83 | switch self.modifier { 84 | case .EqualTo: return 1.0 85 | case .LessThanOrEqualTo: return 1.0 86 | case .GreaterThanOrEqualTo: return 1.0 87 | case .MultipliedBy: return CGFloat(self.value) 88 | } 89 | } 90 | 91 | /** 92 | Value of the `Constant` 93 | - returns: `CGFloat` value of the `Constant` 94 | */ 95 | internal func layoutValue() -> CGFloat { 96 | switch self.modifier { 97 | case .MultipliedBy: return 0.0 98 | default: return CGFloat(self.value) 99 | } 100 | } 101 | 102 | } 103 | 104 | prefix operator >= {} 105 | 106 | /** 107 | Prefix operator that eases the creation of a `Constant` with a 108 | `.GreaterThanOrEqualTo` modifier. 109 | - parameter rhs: Value for the `Constant` 110 | - returns: The resulting `Constant` struct 111 | */ 112 | public prefix func >= (rhs: CGFloat) -> Constant { 113 | return Constant(value: rhs, modifier: .GreaterThanOrEqualTo) 114 | } 115 | 116 | prefix operator <= {} 117 | 118 | /** 119 | Prefix operator that eases the creation of a `Constant` with a 120 | `.LessThanOrEqualTo` modifier. 121 | - parameter rhs: Value for the `Constant` 122 | - returns: The resulting `Constant` struct 123 | */ 124 | public prefix func <= (rhs: CGFloat) -> Constant { 125 | return Constant(value: rhs, modifier: .LessThanOrEqualTo) 126 | } 127 | 128 | prefix operator * {} 129 | 130 | /** 131 | Prefix operator that eases the creation of a `Constant` with `value = 0.0` 132 | and `multiplier` the value specifier at the right hand side of the operator. 133 | - parameter rhs: Value for the `multiplier` 134 | - returns: The resulting `Constant` struct 135 | */ 136 | public prefix func * (rhs: CGFloat) -> Constant { 137 | return Constant(value: rhs, modifier: .MultipliedBy) 138 | } 139 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 5 | 6 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 7 | > "$RESOURCES_TO_COPY" 8 | 9 | XCASSET_FILES=() 10 | 11 | realpath() { 12 | DIRECTORY="$(cd "${1%/*}" && pwd)" 13 | FILENAME="${1##*/}" 14 | echo "$DIRECTORY/$FILENAME" 15 | } 16 | 17 | install_resource() 18 | { 19 | case $1 in 20 | *.storyboard) 21 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 22 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .storyboard`.storyboardc" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 23 | ;; 24 | *.xib) 25 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib ${PODS_ROOT}/$1 --sdk ${SDKROOT}" 26 | ibtool --reference-external-strings-file --errors --warnings --notices --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$1\" .xib`.nib" "${PODS_ROOT}/$1" --sdk "${SDKROOT}" 27 | ;; 28 | *.framework) 29 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 30 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 31 | echo "rsync -av ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 32 | rsync -av "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 33 | ;; 34 | *.xcdatamodel) 35 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1"`.mom\"" 36 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodel`.mom" 37 | ;; 38 | *.xcdatamodeld) 39 | echo "xcrun momc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd\"" 40 | xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcdatamodeld`.momd" 41 | ;; 42 | *.xcmappingmodel) 43 | echo "xcrun mapc \"${PODS_ROOT}/$1\" \"${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm\"" 44 | xcrun mapc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$1" .xcmappingmodel`.cdm" 45 | ;; 46 | *.xcassets) 47 | ABSOLUTE_XCASSET_FILE=$(realpath "${PODS_ROOT}/$1") 48 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 49 | ;; 50 | /*) 51 | echo "$1" 52 | echo "$1" >> "$RESOURCES_TO_COPY" 53 | ;; 54 | *) 55 | echo "${PODS_ROOT}/$1" 56 | echo "${PODS_ROOT}/$1" >> "$RESOURCES_TO_COPY" 57 | ;; 58 | esac 59 | } 60 | 61 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 62 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 63 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 64 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 65 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 66 | fi 67 | rm -f "$RESOURCES_TO_COPY" 68 | 69 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ] 70 | then 71 | case "${TARGETED_DEVICE_FAMILY}" in 72 | 1,2) 73 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 74 | ;; 75 | 1) 76 | TARGET_DEVICE_ARGS="--target-device iphone" 77 | ;; 78 | 2) 79 | TARGET_DEVICE_ARGS="--target-device ipad" 80 | ;; 81 | *) 82 | TARGET_DEVICE_ARGS="--target-device mac" 83 | ;; 84 | esac 85 | 86 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 87 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 88 | while read line; do 89 | if [[ $line != "`realpath $PODS_ROOT`*" ]]; then 90 | XCASSET_FILES+=("$line") 91 | fi 92 | done <<<"$OTHER_XCASSETS" 93 | 94 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${IPHONEOS_DEPLOYMENT_TARGET}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 95 | fi 96 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/Attribute+Install.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import UIKit 12 | 13 | /** 14 | Convenience methods applicable to `Attribute` and subclasses 15 | */ 16 | internal extension Attribute { 17 | 18 | /** 19 | Determines whether the `Attribute` must be installed or not 20 | depending on the `Condition` closure and the existence of a 21 | superview for the `view` parameter 22 | - parameter view: `UIView` which superview will be checked 23 | - return boolean determining if the `Attribute` has to be 24 | applied 25 | */ 26 | internal func shouldInstallOnView(view: UIView) -> Bool { 27 | guard let _ = view.superview else { 28 | return false 29 | } 30 | guard self.condition?() ?? true else { 31 | return false 32 | } 33 | return true 34 | } 35 | 36 | /** 37 | Checks whether a conflicting `Attribute` has been already applied 38 | to the `UIView` supplied and if so uninstalls the constraint related 39 | with such `Attribute` 40 | - parameter view: `UIView` in which the `Attribute` will be installed 41 | */ 42 | internal func resolveConflictsOnView(view: UIView) { 43 | // Find conflicting constraints and attributes already installed 44 | let ownerView = self.ownedBySuperview() ? view.superview! : view 45 | var conflictingAttributes: [Attribute] = [] 46 | let conflictingConstraints = ownerView.constraints.filter { constraint in 47 | if let attribute = constraint.easy_attribute where attribute =~ self { 48 | conflictingAttributes.append(attribute) 49 | return true 50 | } 51 | return false 52 | } 53 | 54 | // Remove conflicting attributes 55 | ownerView.easy_attributes = ownerView.easy_attributes.filter { 56 | conflictingAttributes.contains($0) == false || $0 == self 57 | } 58 | 59 | // Deactivate conflicting installed constraints 60 | NSLayoutConstraint.deactivateConstraints(conflictingConstraints) 61 | } 62 | 63 | /** 64 | Determines which `ReferenceAttribute` must be taken as reference 65 | attribute for the actual Attribute class. Usually is the opposite 66 | of the one that is going to be installed 67 | - returns `ReferenceAttribute` to install 68 | */ 69 | internal func referenceAttributeHelper() -> ReferenceAttribute { 70 | // If already set return 71 | if let attribute = self.referenceAttribute { 72 | return attribute 73 | } 74 | 75 | // If reference view is the superview then return same attribute 76 | // as `createAttribute` 77 | if let referenceView = self.referenceView where referenceView === self.createView?.superview { 78 | return self.createAttribute 79 | } 80 | 81 | // Otherwise return the opposite of `createAttribute` 82 | return self.createAttribute.opposite 83 | } 84 | 85 | } 86 | 87 | /** 88 | Convenience methods applicable to `Attribute` and subclasses 89 | */ 90 | internal extension Attribute { 91 | 92 | /** 93 | Helper that creates the equivalent `ReferenceAttribute` for an 94 | `Attribute` subclass 95 | - returns: the equivalent `ReferenceAttribute` 96 | */ 97 | internal func referenceAttributeFromClass() -> ReferenceAttribute { 98 | switch self { 99 | case is Width: return .Width 100 | case is Height: return .Height 101 | case is Left: return .Left 102 | case is Right: return .Right 103 | case is Top: return .Top 104 | case is Bottom: return .Bottom 105 | case is Leading: return .Leading 106 | case is Trailing: return .Trailing 107 | case is CenterX: return .CenterX 108 | case is CenterY: return .CenterY 109 | case is FirstBaseline: return .FirstBaseline 110 | case is LastBaseline: return .LastBaseline 111 | case is LeftMargin: return .LeftMargin 112 | case is RightMargin: return .RightMargin 113 | case is TopMargin: return .TopMargin 114 | case is BottomMargin: return .BottomMargin 115 | case is LeadingMargin: return .LeadingMargin 116 | case is TrailingMargin: return .TrailingMargin 117 | case is CenterXWithinMargins: return .CenterXWithinMargins 118 | case is CenterYWithinMargins: return .CenterYWithinMargins 119 | default: return .NotAnAttribute 120 | } 121 | } 122 | 123 | } 124 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/DimensionAttribute.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | Superclass for those `Attribute` objects that imply dimension 15 | constraints like width and height 16 | */ 17 | public class DimensionAttribute: Attribute { 18 | 19 | /** 20 | Establishes a relationship between the dimension attribute 21 | applied to the `UIView` and the reference `UIView` passed as 22 | parameter. 23 | 24 | It's also possible to link this relationship to a particular 25 | attribute of the `view` parameter by supplying `attribute`. 26 | 27 | - parameter view: The reference view 28 | - parameter attribute: The attribute of `view` we are establishing 29 | the relationship to 30 | - returns: The current `Attribute` instance 31 | */ 32 | public func like(view: UIView, _ attribute: ReferenceAttribute? = nil) -> Self { 33 | self.referenceView = view 34 | self.referenceAttribute = attribute 35 | return self 36 | } 37 | 38 | // MARK: Overriden methods 39 | 40 | /** 41 | Method overriden to indicate that `PositionAttributes` are 42 | owned by `createView` and not `superview` 43 | - returns boolean if the resulting constraint is owned by 44 | the superview 45 | */ 46 | override func ownedBySuperview() -> Bool { 47 | return false 48 | } 49 | 50 | } 51 | 52 | /** 53 | The width of the object’s alignment rectangle 54 | */ 55 | public class Width: DimensionAttribute { } 56 | 57 | /** 58 | The height of the object’s alignment rectangle 59 | */ 60 | public class Height: DimensionAttribute { } 61 | 62 | /** 63 | The size of the object’s rectangle 64 | */ 65 | public class Size: CompoundAttribute { 66 | 67 | /** 68 | Initializer which creates a `CompountAttribute` instance formed 69 | by `Width` and `Height` attributes with `constant = 0.0`, 70 | `multiplier = 1.0` and `relatedBy = .Equal` 71 | - returns: the `CompoundAttribute` instance created 72 | */ 73 | public override init() { 74 | super.init() 75 | self.attributes = [ 76 | Width(), 77 | Height() 78 | ] 79 | } 80 | 81 | /** 82 | Initializer which creates a `CompountAttribute` instance formed 83 | by `Width` and `Height` attributes with `constant = value`, 84 | `multiplier = 1.0` and `relatedBy = .Equal` 85 | - parameter value: `constant` of the constraint 86 | - returns: the `CompoundAttribute` instance created 87 | */ 88 | public override init(_ value: CGFloat) { 89 | super.init() 90 | self.attributes = [ 91 | Width(value), 92 | Height(value) 93 | ] 94 | } 95 | 96 | /** 97 | Initializer which creates a `CompountAttribute` instance formed 98 | by `Width` and `Height` attributes with the `constant`, 99 | `multiplier` and `relatedBy` defined by the `Constant` supplied 100 | - parameter constant: `Constant` struct aggregating `constant`, 101 | `multiplier` and `relatedBy` properties 102 | - returns: the `CompoundAttribute` instance created 103 | */ 104 | public override init(_ constant: Constant) { 105 | super.init() 106 | self.attributes = [ 107 | Width(constant), 108 | Height(constant) 109 | ] 110 | } 111 | 112 | /** 113 | Initializer which creates a `CompountAttribute` instance formed 114 | by `Width` and `Height` attributes with `constant = size.width` 115 | and `constant = size.height` respectively, `multiplier = 1.0` 116 | and `relatedBy = .Equal` 117 | - parameter size: `CGSize` that sets the constants for the `Width` 118 | and `Height` *subattributes* 119 | - returns: the `CompoundAttribute` instance created 120 | */ 121 | public init(_ size: CGSize) { 122 | super.init() 123 | self.attributes = [ 124 | Width(CGFloat(size.width)), 125 | Height(CGFloat(size.height)) 126 | ] 127 | } 128 | 129 | /** 130 | Establishes a relationship between the dimension attribute 131 | applied to the `UIView` and the reference `UIView` passed as 132 | parameter. 133 | - parameter view: The reference view 134 | - returns: The current `CompoundAttribute` instance 135 | */ 136 | public func like(view: UIView) -> Self { 137 | self.referenceView = view 138 | for attr in self.attributes { 139 | attr.referenceView = view 140 | } 141 | return self 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/UIView+Easy.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import UIKit 12 | 13 | infix operator <- {} 14 | 15 | /** 16 | Operator which applies the attribute given to the view located 17 | in the left hand side of it 18 | - parameter lhs: `UIView` the attributes will apply to 19 | - parameter rhs: Attribute applied to the `UIView` 20 | - returns: The array of attributes applied 21 | */ 22 | public func <- (lhs: UIView, rhs: Attribute) -> [Attribute] { 23 | return lhs <- [rhs] 24 | } 25 | 26 | /** 27 | Opeator which applies the attributes given to the view located 28 | in the left hand side of it 29 | - parameter lhs: UIView the attributes will apply to 30 | - parameter rhs: Attributes applied to the UIView 31 | - returns: The array of attributes applied 32 | */ 33 | public func <- (lhs: UIView, rhs: [Attribute]) -> [Attribute] { 34 | // Disable autoresizing to constraints translation 35 | lhs.translatesAutoresizingMaskIntoConstraints = false 36 | 37 | // Create constraints to install and gather regular attribtues 38 | var constraintsToInstall: [NSLayoutConstraint] = [] 39 | var regularAttributes: [Attribute] = [] 40 | for attribute in rhs { 41 | // Create the constraint 42 | let newConstraints = attribute.createConstraintForView(lhs) 43 | constraintsToInstall.appendContentsOf(newConstraints) 44 | 45 | // Gather regular attributes only as we don't want to store 46 | // `CompoundAttribute` objects 47 | var attributesToStore: [Attribute] = [] 48 | if let compountAttribute = attribute as? CompoundAttribute { 49 | attributesToStore.appendContentsOf(compountAttribute.attributes) 50 | } 51 | else { 52 | attributesToStore.append(attribute) 53 | } 54 | 55 | // Append to the list of attributes that will be returned 56 | regularAttributes.appendContentsOf(attributesToStore) 57 | 58 | // Store the attribute applied in the superview 59 | if attribute.ownedBySuperview() { 60 | lhs.superview?.easy_attributes.appendContentsOf(attributesToStore) 61 | } 62 | else { // Store the attributes applied in self 63 | lhs.easy_attributes.appendContentsOf(attributesToStore) 64 | } 65 | } 66 | 67 | // Install these constraints 68 | NSLayoutConstraint.activateConstraints(constraintsToInstall) 69 | 70 | // Return just regular `Attributes`, not `CompoundAttributes` 71 | return regularAttributes 72 | } 73 | 74 | /** 75 | Convenience methods applicable to `UIView` and subclasses 76 | */ 77 | public extension UIView { 78 | 79 | /** 80 | This method will trigger the recreation of the constraints 81 | created using *EasyPeasy* for the current view. `Condition` 82 | closures will be evaluated again 83 | */ 84 | public func easy_reload() { 85 | var storedAttributes: [Attribute] = [] 86 | 87 | // Reload attributes owned by the superview 88 | if let attributes = (self.superview?.easy_attributes.filter { $0.createView === self }) { 89 | storedAttributes.appendContentsOf(attributes) 90 | } 91 | 92 | // Reload attributes owned by the current view 93 | let attributes = self.easy_attributes.filter { $0.createView === self } 94 | storedAttributes.appendContentsOf(attributes) 95 | 96 | // Apply 97 | self <- storedAttributes 98 | } 99 | 100 | /** 101 | Clears all the constraints applied with EasyPeasy to the 102 | current `UIView` 103 | */ 104 | public func easy_clear() { 105 | // Remove from the stored Attribute objects of the superview 106 | // those which createView is the current UIView 107 | if let superview = self.superview { 108 | superview.easy_attributes = superview.easy_attributes.filter { $0.createView !== self } 109 | } 110 | 111 | // Remove from the stored Attribute objects of the current view 112 | // those which createView is the current UIView 113 | self.easy_attributes = self.easy_attributes.filter { $0.createView !== self } 114 | 115 | // Now uninstall those constraints 116 | var constraintsToUninstall: [NSLayoutConstraint] = [] 117 | 118 | // Gather NSLayoutConstraints in the superview with self as createView 119 | for constraint in (self.superview?.constraints ?? []) { 120 | if let attribute = constraint.easy_attribute where attribute.createView === self { 121 | constraintsToUninstall.append(constraint) 122 | } 123 | } 124 | 125 | // Gather NSLayoutConstraints in self with self as createView 126 | for constraint in self.constraints { 127 | if let attribute = constraint.easy_attribute where attribute.createView === self { 128 | constraintsToUninstall.append(constraint) 129 | } 130 | } 131 | 132 | // Deactive the constraints 133 | NSLayoutConstraint.deactivateConstraints(constraintsToUninstall) 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/Attribute.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | Typealias of a closure with no parameters and `Bool` 15 | as returning type. 16 | 17 | This type of closure is used to evaluate whether an 18 | `Attribute` should be applied or not. 19 | */ 20 | public typealias Condition = () -> Bool 21 | 22 | /** 23 | This class is the abstraction of `NSLayoutConstraint` 24 | objects used by **EasyPeasy** to create and update 25 | `UIView` constraints 26 | */ 27 | public class Attribute { 28 | 29 | /// This property aggregates the `NSLayoutRelation`, 30 | /// the constant and the multiplier of a layout 31 | /// constraint 32 | public internal(set) var constant: Constant 33 | 34 | /// Priority level of the constraint 35 | public internal(set) var priority: Priority 36 | 37 | /// Condition to evaluate in order to apply 38 | /// (or not) the constraint 39 | public internal(set) var condition: Condition? 40 | 41 | /// Target `UIView` of the constraint 42 | public internal(set) weak var createView: UIView? 43 | 44 | /// `Attribute` applied to the view 45 | public var createAttribute: ReferenceAttribute { 46 | return self.referenceAttributeFromClass() 47 | } 48 | 49 | /// Reference `UIView` of the constraint 50 | public internal(set) weak var referenceView: UIView? 51 | 52 | /// Referencce `Attribute` of the constraint 53 | public internal(set) var referenceAttribute: ReferenceAttribute? 54 | 55 | /** 56 | Initializer which creates an `Attribute` instance 57 | with `constant = 0.0`, `multiplier = 1.0` and 58 | `relatedBy = .Equal` 59 | - returns: the `Attribute` instance created 60 | */ 61 | public init() { 62 | self.constant = Constant(0.0) 63 | self.priority = .HighPriority 64 | } 65 | 66 | /** 67 | Initializer which creates an `Attribute` instance 68 | with `constant = value`, `multiplier = 1.0` and 69 | `relatedBy = .Equal` 70 | - parameter value: `constant` of the constraint 71 | - returns: the `Attribute` instance created 72 | */ 73 | public init(_ value: CGFloat) { 74 | self.constant = Constant(value) 75 | self.priority = .HighPriority 76 | } 77 | 78 | /** 79 | Initializer which creates an `Attribute` instance 80 | with the `constant`, `multiplier` and `relatedBy` 81 | specified by the `Constant` struct 82 | - parameter constant: `Constant` struct aggregating 83 | `constant`, `multiplier` and `relatedBy` properties 84 | - returns: the `Attribute` instance created 85 | */ 86 | public init(_ constant: Constant) { 87 | self.constant = constant 88 | self.priority = .HighPriority 89 | } 90 | 91 | // MARK: Public methods 92 | 93 | /** 94 | Sets the `priority` of the constraint 95 | - parameter priority: `Priority` enum specifying the 96 | priority of the constraint 97 | - returns: the `Attribute` instance 98 | */ 99 | public func with(priority: Priority) -> Self { 100 | self.priority = priority 101 | return self 102 | } 103 | 104 | /** 105 | Sets the `when` closure of the `Attribute` 106 | - parameter closure: `Closure` to be called before 107 | installing a constraint 108 | - returns: the `Attribute` instance 109 | */ 110 | public func when(closure: Condition?) -> Self { 111 | self.condition = closure 112 | return self 113 | } 114 | 115 | // MARK: Internal methods (acting as protected) 116 | 117 | /** 118 | This method evaluates whether an `Attribute` should be 119 | applied, resolves any conflicts with the `Attributes` 120 | already applied and it also generates the `NSLayoutConstraint` 121 | added to `view` 122 | - parameter view: `UIView` in which the generated 123 | `NSLayoutConstraint` will be added 124 | - returns an `Array` of `NSLayoutConstraint` objects that will 125 | be installed on the `UIView` passed as parameter 126 | */ 127 | internal func createConstraintForView(view: UIView) -> [NSLayoutConstraint] { 128 | // Reference to the target view 129 | self.createView = view 130 | 131 | // If condition is `false` return 132 | if self.shouldInstallOnView(view) == false { 133 | return [] 134 | } 135 | 136 | // Resolve constraint conflicts 137 | self.resolveConflictsOnView(view) 138 | 139 | // Build layout constraint 140 | let constantFactor: CGFloat = self.createAttribute.shouldInvertConstant ? -1 : 1 141 | let layoutConstraint = NSLayoutConstraint( 142 | item: view, 143 | attribute: self.createAttribute.layoutAttribute, 144 | relatedBy: self.constant.layoutRelation(), 145 | toItem: self.referenceView, 146 | attribute: self.referenceAttributeHelper().layoutAttribute, 147 | multiplier: self.constant.layoutMultiplier(), 148 | constant: (self.constant.layoutValue() * constantFactor) 149 | ) 150 | 151 | // Set priority 152 | layoutConstraint.priority = self.priority.layoutPriority() 153 | 154 | // Set associated Attribute 155 | layoutConstraint.easy_attribute = self 156 | 157 | // Return the constraint 158 | return [layoutConstraint] 159 | } 160 | 161 | /** 162 | Method to be overriden by the child classes, determines 163 | whether the `NSLayoutConstraint` created by the `Attribute` 164 | will be stored by the `superview` or the `createView` 165 | - returns boolean if the resulting constraint is owned by 166 | the superview 167 | */ 168 | internal func ownedBySuperview() -> Bool { 169 | return true 170 | } 171 | 172 | } 173 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/ReferenceAttribute.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import UIKit 12 | 13 | /** 14 | An enum representation of the different attribute 15 | classes available 16 | */ 17 | public enum ReferenceAttribute { 18 | 19 | // Dimesion attributes 20 | case Width 21 | case Height 22 | 23 | // Position attributes 24 | case Left 25 | case Right 26 | case Top 27 | case Bottom 28 | case Leading 29 | case Trailing 30 | case CenterX 31 | case CenterY 32 | case FirstBaseline 33 | case LastBaseline 34 | case LeftMargin 35 | case RightMargin 36 | case TopMargin 37 | case BottomMargin 38 | case LeadingMargin 39 | case TrailingMargin 40 | case CenterXWithinMargins 41 | case CenterYWithinMargins 42 | 43 | // Default 44 | case NotAnAttribute 45 | 46 | /// Reference attribute opposite to the current one 47 | internal var opposite: ReferenceAttribute { 48 | switch self { 49 | case .Width: return .Width 50 | case .Height: return .Height 51 | case .Left: return .Right 52 | case .Right: return .Left 53 | case .Top: return .Bottom 54 | case .Bottom:return .Top 55 | case .Leading: return .Trailing 56 | case .Trailing: return .Leading 57 | case .CenterX: return .CenterX 58 | case .CenterY: return .CenterY 59 | case .LastBaseline: return .LastBaseline 60 | case .FirstBaseline: return .FirstBaseline 61 | case .LeftMargin: return .RightMargin 62 | case .RightMargin: return .LeftMargin 63 | case .TopMargin: return .BottomMargin 64 | case .BottomMargin: return .TopMargin 65 | case .LeadingMargin: return .TrailingMargin 66 | case .TrailingMargin: return .LeadingMargin 67 | case .CenterXWithinMargins: return .CenterXWithinMargins 68 | case .CenterYWithinMargins: return .CenterYWithinMargins 69 | case .NotAnAttribute: return .NotAnAttribute 70 | } 71 | } 72 | 73 | /// AutoLayout attribute equivalent of the current reference 74 | /// attribute 75 | internal var layoutAttribute: NSLayoutAttribute { 76 | switch self { 77 | case .Width: return .Width 78 | case .Height: return .Height 79 | case .Left: return .Left 80 | case .Right: return .Right 81 | case .Top: return .Top 82 | case .Bottom:return .Bottom 83 | case .Leading: return .Leading 84 | case .Trailing: return .Trailing 85 | case .CenterX: return .CenterX 86 | case .CenterY: return .CenterY 87 | case .LastBaseline: return .LastBaseline 88 | case .FirstBaseline: return .FirstBaseline 89 | case .LeftMargin: return .LeftMargin 90 | case .RightMargin: return .RightMargin 91 | case .TopMargin: return .TopMargin 92 | case .BottomMargin: return .BottomMargin 93 | case .LeadingMargin: return .LeadingMargin 94 | case .TrailingMargin: return .TrailingMargin 95 | case .CenterXWithinMargins: return .CenterXWithinMargins 96 | case .CenterYWithinMargins: return .CenterYWithinMargins 97 | case .NotAnAttribute: return .NotAnAttribute 98 | } 99 | } 100 | 101 | /// Reference attributes that may conflict with the current one 102 | internal var conflictingAttributes: [ReferenceAttribute] { 103 | let left: [ReferenceAttribute] = [.Left, .CenterX, .Leading, .LeftMargin, .CenterXWithinMargins, .LeadingMargin] 104 | let right: [ReferenceAttribute] = [.Right, .CenterX, .Trailing, .RightMargin, .CenterXWithinMargins, .TrailingMargin] 105 | let top: [ReferenceAttribute] = [.Top, .CenterY, .FirstBaseline, .TopMargin, .CenterYWithinMargins] 106 | let bottom: [ReferenceAttribute] = [.Bottom, .CenterY, LastBaseline, .BottomMargin, .CenterYWithinMargins] 107 | let firstBaseLine: [ReferenceAttribute] = [.Top, .CenterY, .FirstBaseline, .TopMargin, .CenterYWithinMargins] 108 | let lastBaseLine: [ReferenceAttribute] = [.LastBaseline, .Bottom, .CenterY, .BottomMargin, .CenterYWithinMargins] 109 | let centerX: [ReferenceAttribute] = [.CenterX, .Left, .Right, .Leading, .Trailing, .LeftMargin, .RightMargin, .CenterXWithinMargins, .LeadingMargin, .TrailingMargin] 110 | let centerY: [ReferenceAttribute] = [.CenterY, .Top, .Bottom, .LastBaseline, .FirstBaseline, .TopMargin, .BottomMargin, .CenterYWithinMargins] 111 | 112 | switch self { 113 | case .Width: return [.Width] 114 | case .Height: return [.Height] 115 | case .Left: return left 116 | case .Right: return right 117 | case .Top: return top 118 | case .Bottom: return bottom 119 | case .Leading: return left 120 | case .Trailing: return right 121 | case .CenterX: return centerX 122 | case .CenterY: return centerY 123 | case .FirstBaseline: return firstBaseLine 124 | case .LastBaseline: return lastBaseLine 125 | case .LeftMargin: return left 126 | case .RightMargin: return right 127 | case .TopMargin: return top 128 | case .BottomMargin: return bottom 129 | case .LeadingMargin: return left 130 | case .TrailingMargin: return right 131 | case .CenterXWithinMargins: return centerX 132 | case .CenterYWithinMargins: return centerY 133 | case .NotAnAttribute: return [] 134 | } 135 | } 136 | 137 | /// Property that determines whether the constant of 138 | /// the `Attribute` should be multiplied by `-1`. This 139 | /// is usually done for right hand `PositionAttribute` 140 | /// objects 141 | internal var shouldInvertConstant: Bool { 142 | switch self { 143 | case .Width: return false 144 | case .Height: return false 145 | case .Left: return false 146 | case .Right: return true 147 | case .Top: return false 148 | case .Bottom:return true 149 | case .Leading: return false 150 | case .Trailing: return true 151 | case .CenterX: return false 152 | case .CenterY: return false 153 | case .FirstBaseline: return false 154 | case .LastBaseline: return true 155 | case .LeftMargin: return false 156 | case .RightMargin: return true 157 | case .TopMargin: return false 158 | case .BottomMargin: return true 159 | case .LeadingMargin: return false 160 | case .TrailingMargin: return true 161 | case .CenterXWithinMargins: return false 162 | case .CenterYWithinMargins: return false 163 | case .NotAnAttribute: return false 164 | } 165 | } 166 | 167 | } 168 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/README.md: -------------------------------------------------------------------------------- 1 | ![logo](README/logo.png) 2 | 3 | [![CI Status](http://img.shields.io/travis/nakiostudio/EasyPeasy.svg?style=flat)](https://travis-ci.org/nakiostudio/EasyPeasy) 4 | [![Version](https://img.shields.io/cocoapods/v/EasyPeasy.svg?style=flat)](http://cocoapods.org/pods/EasyPeasy) 5 | [![Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen.svg)](http://cocoapods.org/pods/EasyPeasy) 6 | [![Docs](https://img.shields.io/cocoapods/metrics/doc-percent/EasyPeasy.svg)](http://cocoadocs.org/docsets/EasyPeasy) 7 | 8 | **EasyPeasy** is a Swift framework that lets you create *Auto Layout* constraints 9 | programmatically without headaches and never ending boilerplate code. Besides the 10 | basics, **EasyPeasy** resolves most of the constraint conflicts for you and lets 11 | you attach to a constraint conditional closures that are evaluated before applying 12 | a constraint, this lets you apply (or not) a constraint depending on platform, size 13 | classes, orientation... or the state of your controller, easy peasy! 14 | 15 | In this quick tour through **EasyPeasy** we assume that you already know the 16 | advantages and disadvantages of the different *Auto Layout* APIs and therefore you 17 | won't see here a comparison of the code side by side, just read and decide 18 | whether **EasyPeasy** is for you or not. 19 | 20 | ### A touch of EasyPeasy 21 | The example below is quite simple but shows how effortless its implementation 22 | result using **EasyPeasy**. 23 | ![touch](README/first_touch.png) 24 | 25 | ## Table of contents 26 | 27 | * [Installation](#installation) 28 | * [Usage](#usage) 29 | * [Modifiers](#modifiers) 30 | * [Attributes](#attributes) 31 | * [DimensionAttributes](#dimensionattributes) 32 | * [PositionAttributes](#positionattributes) 33 | * [CompoundAttributes](#compoundattributes) 34 | * [Priorities](#priorities) 35 | * [Conditions](#conditions) 36 | * [Lastly](#lastly) 37 | * [Updating constraints](#updating-constraints) 38 | * [Clearing constraints](#clearing-constraints) 39 | * [Animating constraints](#animating-constraints) 40 | * [Example project](#example-project) 41 | * [Autogenerated documentation](#autogenerated-documentation) 42 | 43 | ## Installation 44 | 45 | ### Cocoapods 46 | EasyPeasy is available through [CocoaPods](http://cocoapods.org). To install 47 | it, simply add the following line to your Podfile: 48 | 49 | ```ruby 50 | pod "EasyPeasy" 51 | ``` 52 | 53 | ### Compatibility 54 | For now **EasyPeasy** is only compatible with iOS 8 and above, although we aim 55 | to make it compatible with OS X. 56 | The framework has been tested with Xcode 7 and Swift 2.0, however don't hesitate 57 | to report any issues you may find with different versions. 58 | 59 | ## Usage 60 | 61 | **EasyPeasy** is a set of position and dimension attributes that you can apply 62 | to your views. For instance, to set a width of 200px to a view you would create 63 | an attribute of class `Width` with a constant value of `200`, then the attribute 64 | is applied to the view by using the custom *apply* operator `<-`. 65 | ```swift 66 | myView <- Width(200) 67 | ``` 68 | 69 | Because our view without height is nothing we can apply multiple attributes at 70 | once as follows: 71 | ```swift 72 | myView <- [ 73 | Width(200), 74 | Height(120) 75 | ] 76 | ``` 77 | 78 | In the previous example, two attributes have been applied and therefore two constraints 79 | created and added: a width constraint with `constant = 200` and a height constraint 80 | with `constant = 120`. 81 | 82 | ### Modifiers 83 | Without really knowing it, we have just created an **EasyPeasy** `Constant` 84 | struct containing the constant and the relation of a `NSLayoutConstraint`. 85 | That relation is a `Modifier` and **EasyPeasy** provides four different modifiers: 86 | * `.EqualTo`: the equivalent of `NSLayoutRelationEqual`, it's created like in 87 | our previous example. `Width(200)` 88 | * `.GreaterThanOrEqualTo`: the equivalent of `NSLayoutRelationGreaterThanOrEqual`, 89 | it's created as easy as this `Width(>=200)` and it means that our view has a width 90 | greater than or equal to 200px. 91 | * `.LessThanOrEqualTo`: the equivalent of `NSLayoutRelationLessThanOrEqual` 92 | is created as follows `Width(<=200)`. 93 | * `.MultipliedBy`: this modifier is a bit particular as it does not match any 94 | `NSLayoutRelation`, instead, this modifier replaces the `multiplier` property 95 | of a `NSLayoutConstraint`. It's created like this `Width(*2)` and means that the 96 | width of our view is two times *something*, we will mention later how to establish 97 | the relationship with that *something*. 98 | 99 | ### Attributes 100 | **EasyPeasy** provides as many `Attribute` classes as attributes `NSLayoutConstraint` 101 | have, plus something that we have called `CompoundAttributes` (we will explain these 102 | attributes later). 103 | 104 | #### DimensionAttributes 105 | There are just two dimension attributes `Width` and `Height`. You can create an 106 | *Auto Layout* relationship between your view `DimensionAttribute` and another view 107 | by using the method `func like(view: UIView) -> Self`. Example: 108 | ```swift 109 | contentLabel <- Width().like(headerView) 110 | ``` 111 | 112 | That line of code will create a constraint that sets a width for `contentLabel` 113 | equal to the `headerView` width. 114 | 115 | It's possible to create that relationship with any attribute of the reference 116 | view, for example the following piece of code will create a constraint setting a 117 | width for `contentLabel` equal to the width of `headerView`. 118 | ```swift 119 | contentLabel <- Width().like(headerView) 120 | ``` 121 | 122 | #### PositionAttributes 123 | The table below shows the different position attributes available. Because they 124 | behave like the `NSLayoutConstraint` attributes, you can find a complete 125 | description of them in the [Apple docs](https://developer.apple.com/library/ios/documentation/AppKit/Reference/NSLayoutConstraint_Class/#//apple_ref/c/tdef/NSLayoutRelation). 126 | 127 | Attribute | Attribute | Attribute | Attribute 128 | --- | --- | --- | --- 129 | Left | Right | Top | Bottom 130 | Leading | Trailing | CenterX | CenterY 131 | LeftMargin | RightMargin | TopMargin | BottomMargin 132 | LeadingMargin | TrailingMargin | CenterXWithinMargins | CenterYWithinMargins 133 | FirstBaseline | LastBaseline | -- | -- 134 | 135 | As well as the **DimensionAttributes** have the `like:` method to establish 136 | *Auto Layout* relationships, you can use a similar method to do the same with 137 | **PositionAttributes**. This method is: 138 | ```swift 139 | func to(view: UIView, _ attribute: ReferenceAttribute? = nil) -> Self 140 | ``` 141 | 142 | The example below positions `contentLabel` 10px under `headerView` with the same 143 | left margin as `headerView`. 144 | ```swift 145 | contentLabel <- [ 146 | Top(10).to(headerView), 147 | Left().to(headerView, .Left) 148 | ] 149 | ``` 150 | 151 | #### CompoundAttributes 152 | These attributes are the ones that create multiple `DimensionAttributes` or 153 | `PositionAttributes` under the hood. For example, the `Size` attribute will create 154 | a `Width` and a `Height` attributes with their width and height 155 | `NSLayoutConstraints` respectively. 156 | 157 | These are the `CompoundAttributes` available: 158 | 159 | * `Size`: As mentioned before this attribute will apply a `Width` and a `Height` 160 | attribute to the view. It can be initialized in many ways and depending on that 161 | the result may change. These are some examples: 162 | ```swift 163 | // Apply width = 0 and height = 0 constraints 164 | view <- Size() 165 | // Apply width = referenceView.width and height = referenceView.height constraints 166 | view <- Size().like(referenceView) 167 | // Apply width = 100 and height = 100 constraints 168 | view <- Size(100) 169 | // Apply width = 200 and height = 100 constraints 170 | view <- Size(CGSize(width: 200, height: 100)) 171 | ``` 172 | 173 | * `Edges`: This attribute creates `Left`, `Right`, `Top` and `Bottom` attributes 174 | at once. Examples: 175 | ```swift 176 | // Apply left = 0, right = 0, top = 0 and bottom = 0 constraints to its superview 177 | view <- Edges() 178 | // Apply left = 10, right = 10, top = 10 and bottom = 10 constraints to its superview 179 | view <- Edges(10) 180 | // Apply left = 10, right = 10, top = 5 and bottom = 5 constraints to its superview 181 | view <- Edges(UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 10)) 182 | ``` 183 | 184 | * `Center`: It creates `CenterX` and `CenterY` attributes. Examples: 185 | ```swift 186 | // Apply centerX = 0 and centerY = 0 constraints to its superview 187 | view <- Center() 188 | // Apply centerX = 10 and centerY = 10 constraints to its superview 189 | view <- Center(10) 190 | // Apply centerX = 0 and centerY = 50 constraints to its superview 191 | view <- Center(CGPoint(x: 0, y: 50)) 192 | ``` 193 | 194 | * `Margins`: This attribute creates `LeftMargin`, `RightMargin`, `TopMargin` and 195 | `BottomMargin` attributes at once. Examples: 196 | ```swift 197 | // Apply leftMargin = 0, rightMargin = 0, topMargin = 0 and bottomMargin = 0 constraints to its superview 198 | view <- Margins() 199 | // Apply leftMargin = 10, rightMargin = 10, topMargin = 10 and bottomMargin = 10 constraints to its superview 200 | view <- Margins(10) 201 | // Apply leftMargin = 10, rightMargin = 10, topMargin = 5 and bottomMargin = 5 constraints to its superview 202 | view <- Margins(UIEdgeInsets(top: 5, left: 10, bottom: 5, right: 10)) 203 | ``` 204 | 205 | * `CenterWithinMargins`: It creates `CenterXWithinMargins` and `CenterYWithinMargins` 206 | attributes. Examples: 207 | ```swift 208 | // Apply centerXWithinMargins = 0 and centerYWithinMargins = 0 constraints to its superview 209 | view <- CenterWithinMargins() 210 | // Apply centerXWithinMargins = 10 and centerYWithinMargins = 10 constraints to its superview 211 | view <- CenterWithinMargins(10) 212 | // Apply centerXWithinMargins = 0 and centerYWithinMargins = 50 constraints to its superview 213 | view <- CenterWithinMargins(CGPoint(x: 0, y: 50)) 214 | ``` 215 | 216 | ### Priorities 217 | 218 | The `Priority` enum does the same function as `UILayoutPriority` and it's shaped 219 | by four cases: 220 | * `LowPriority`: it creates an *Auto Layout* priority with `Float` value `1`. 221 | 222 | * `MediumPriority`: it creates an *Auto Layout* priority with `Float` value `500`. 223 | 224 | * `HighPriority`: it creates an *Auto Layout* priority with `Float` value `1000`. 225 | 226 | * `CustomPriority`: it specifies the *Auto Layout* priority defined by the 227 | developer in the case associated value `value`. Example: `.CustomPriority(value: 750.0)` 228 | 229 | In order to apply any of these priorities to an `Attribute`, the method 230 | `.with(priority: Priority)` must be used. The following example gives an 231 | `UILayoutPriority` of `500` to the `Top` `Attribute` applied to `view`: 232 | 233 | ```swift 234 | view <- Top(>=50).with(.MediumPriority) 235 | ``` 236 | 237 | ### Conditions 238 | One of the peculiarities of **EasyPeasy** is the usage of `Conditions` or closures 239 | that evaluate whether a constraint should be applied or not to the view. 240 | 241 | The method `when(condition: Condition)` sets the `Condition` closure to an `Attribute`. 242 | 243 | There is plenty of use cases, the example below shows how to apply different 244 | constraints depending on the device: 245 | ```swift 246 | view <- [ 247 | Top(10), 248 | Bottom(10), 249 | Width(250), 250 | Left(10).when { Device() == .iPad }, 251 | CenterX(0).when { Device() == .iPhone } 252 | ] 253 | ``` 254 | 255 | *Note:* the global function `Device()` in the example above is not implemented in 256 | the framework. 257 | 258 | These `Condition` closures can be re-evaluated during the lifecycle of an `UIView`, 259 | to do so you just need to call the `UIView` convenience method `easy_reload()`. 260 | ```swift 261 | view.easy_reload() 262 | ``` 263 | 264 | Bare in mind that these `Condition` closures are stored in properties therefore 265 | you need to capture those variables you access within the closure. For example: 266 | ```swift 267 | descriptionLabel <- [ 268 | Height(100).when { weak self in 269 | return self?.expandDescriptionLabel ?? false 270 | } 271 | ] 272 | ``` 273 | 274 | ### Lastly 275 | Finally but not less important in this section we will explain how to interact 276 | with `Attributes` once they have been applied to an `UIView` using the `<-` 277 | operator. 278 | 279 | #### Updating constraints 280 | We briefly mentioned in the introductory section that **EasyPeasy** solves most 281 | of the constraint conflicts and it's true. Usually, in order to update a constraint 282 | or the constant of a constraint you have to keep a reference to your 283 | `NSLayoutConstraint` and update the constant when needed. With **EasyPeasy** you 284 | just need to apply another `Attribute` to your `UIView` of the same or different 285 | type. In the example below we have two methods, the one in which we setup our 286 | constraints `viewDidLoad()` and a method in which we want to update the `Top` 287 | attribute of our `headerView`. 288 | ```swift 289 | func viewDidLoad() { 290 | super.viewDidLoad() 291 | 292 | headerView <- [ 293 | Top(0), 294 | Left(0), 295 | Right(0), 296 | Height(60) 297 | ] 298 | } 299 | 300 | func didTapButton(sender: UIButton?) { 301 | headerView <- Top(100) 302 | } 303 | ``` 304 | That's it! we have updated our `Top` constraint without caring about keeping 305 | references or installing/uninstalling new constraints. 306 | 307 | However, there is some cases in which **EasyPeasy** cannot prevent a conflict (at 308 | least for now). This is when multiple constraints cannot be satisfied, i.e. existing 309 | a `Left` and `Right` constraints it's also applied a `Width` constraint (all of them 310 | with the same priority). But **EasyPeasy** is smart enough to prevent conflicts, 311 | i.e. when replacing a `Left` and `Right` attributes with a `CenterX` attribute. 312 | 313 | #### Clearing constraints 314 | **EasyPeasy** provides a method extending `UIView` that clears all the constraints 315 | installed in an `UIView` by the framework. This method is `func easy_clear()`. 316 | ```swift 317 | view.easy_clear() 318 | ``` 319 | 320 | #### Animating constraints 321 | Animating constraints with **EasyPeasy** is very straightforward, just apply one 322 | or more `Attributes` to your view within an animation block and you are ready to 323 | go, without worrying about constraint conflicts. Example: 324 | ```swift 325 | UIView.animateWithDuration(0.3) { 326 | view <- Top(10) 327 | view.layoutIfNeeded() 328 | } 329 | ``` 330 | 331 | ## Example project 332 | 333 | Don't forget to clone the repository and run the example project to see 334 | **EasyPeasy** in action. 335 | 336 | ![demo](README/demo_project.gif) 337 | 338 | *Note:* the messages in the demo app aren't real and the appearance of 339 | those *Twitter* accounts no more than a tribute to some kickass developers :) 340 | 341 | ## Autogenerated documentation 342 | 343 | **EasyPeasy** is a well documented framework and therefore all the documented 344 | classes and methods are available in [Cocoadocs](http://cocoadocs.org/docsets/EasyPeasy). 345 | 346 | ## Author 347 | 348 | Carlos Vidal - [@carlostify](https://twitter.com/carlostify) 349 | 350 | ## License 351 | 352 | EasyPeasy is available under the MIT license. See the LICENSE file for more info. 353 | -------------------------------------------------------------------------------- /Pods/EasyPeasy/EasyPeasy/PositionAttribute.swift: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) - Copyright (c) 2016 Carlos Vidal 2 | // 3 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | // SOFTWARE. 10 | 11 | import Foundation 12 | 13 | /** 14 | Superclass for those `Attribute` objects that imply position 15 | constraints like left, right, top and bottom margins 16 | */ 17 | public class PositionAttribute: Attribute { 18 | 19 | /** 20 | This method overrides super's `createConstraintForView` to set 21 | the `UIView` parameter to `superview` as `referenceView` in case 22 | this is not specified by using the `to:view:attribute` method 23 | - parameter view: `UIView` in which the generated 24 | `NSLayoutConstraint` will be added 25 | */ 26 | override func createConstraintForView(view: UIView) -> [NSLayoutConstraint] { 27 | if let superview = view.superview where self.referenceView == nil { 28 | self.to(superview) 29 | } 30 | return super.createConstraintForView(view) 31 | } 32 | 33 | /** 34 | Establishes a position relationship between the `UIView` the 35 | attribute is applied to and the `UIView` passed as parameter. 36 | 37 | It's also possible to link this relationship to a particular 38 | attribute of the `view` parameter by supplying `attribute`. 39 | 40 | - parameter view: The reference view 41 | - parameter attribute: The attribute of `view` we are establishing 42 | the relationship to 43 | - returns: The current `Attribute` instance 44 | */ 45 | public func to(view: UIView, _ attribute: ReferenceAttribute? = nil) -> Self { 46 | self.referenceView = view 47 | self.referenceAttribute = attribute 48 | return self 49 | } 50 | 51 | } 52 | 53 | /** 54 | The left side of the object’s alignment rectangle 55 | */ 56 | public class Left: PositionAttribute { } 57 | 58 | /** 59 | The right side of the object’s alignment rectangle 60 | */ 61 | public class Right: PositionAttribute { } 62 | 63 | /** 64 | The top of the object’s alignment rectangle 65 | */ 66 | public class Top: PositionAttribute { } 67 | 68 | /** 69 | The bottom of the object’s alignment rectangle 70 | */ 71 | public class Bottom: PositionAttribute { } 72 | 73 | /** 74 | The leading edge of the object’s alignment rectangle 75 | */ 76 | public class Leading: PositionAttribute { } 77 | 78 | /** 79 | The trailing edge of the object’s alignment rectangle 80 | */ 81 | public class Trailing: PositionAttribute { } 82 | 83 | /** 84 | The center along the x-axis of the object’s alignment rectangle 85 | */ 86 | public class CenterX: PositionAttribute { } 87 | 88 | /** 89 | The center along the y-axis of the object’s alignment rectangle 90 | */ 91 | public class CenterY: PositionAttribute { } 92 | 93 | /** 94 | The object’s baseline. For objects with more than one line of text, 95 | this is the baseline for the topmost line of text 96 | */ 97 | public class FirstBaseline: PositionAttribute { } 98 | 99 | /** 100 | The object’s baseline. For objects with more than one line of text, 101 | this is the baseline for the bottommost line of text 102 | */ 103 | public class LastBaseline: PositionAttribute { } 104 | 105 | /** 106 | The object’s left margin. For UIView objects, the margins are defined 107 | by their layoutMargins property 108 | */ 109 | public class LeftMargin: PositionAttribute { } 110 | 111 | /** 112 | The object’s right margin. For UIView objects, the margins are defined 113 | by their layoutMargins property 114 | */ 115 | public class RightMargin: PositionAttribute { } 116 | 117 | /** 118 | The object’s top margin. For UIView objects, the margins are defined 119 | by their layoutMargins property 120 | */ 121 | public class TopMargin: PositionAttribute { } 122 | 123 | /** 124 | The object’s bottom margin. For UIView objects, the margins are defined 125 | by their layoutMargins property 126 | */ 127 | public class BottomMargin: PositionAttribute { } 128 | 129 | /** 130 | The object’s leading margin. For UIView objects, the margins are defined 131 | by their layoutMargins property 132 | */ 133 | public class LeadingMargin: PositionAttribute { } 134 | 135 | /** 136 | The object’s trailing margin. For UIView objects, the margins are defined 137 | by their layoutMargins property 138 | */ 139 | public class TrailingMargin: PositionAttribute { } 140 | 141 | /** 142 | The center along the x-axis between the object’s left and right margin. 143 | For UIView objects, the margins are defined by their layoutMargins property 144 | */ 145 | public class CenterXWithinMargins: PositionAttribute { } 146 | 147 | /** 148 | The center along the y-axis between the object’s top and bottom margin. 149 | For UIView objects, the margins are defined by their layoutMargins property 150 | */ 151 | public class CenterYWithinMargins: PositionAttribute { } 152 | 153 | /** 154 | The size of the object’s rectangle 155 | */ 156 | public class Edges: CompoundAttribute { 157 | 158 | /** 159 | Initializer that creates the sub `Attribute` objects 160 | shaping the `CompoundAttribute` object with `constant = 0.0`, 161 | `multiplier = 1.0` and `RelatedBy = .Equal` 162 | - returns: the `CompoundAttribute` instance created 163 | */ 164 | public override init() { 165 | super.init() 166 | self.attributes = [ 167 | Top(), 168 | Left(), 169 | Right(), 170 | Bottom() 171 | ] 172 | } 173 | 174 | /** 175 | Initializer that creates the sub `Attribute` objects shaping the 176 | `CompoundAttribute` object with `constant = value`, `multiplier = 1.0` 177 | and `RelatedBy = .Equal` 178 | - parameter value: `constant` of the constraint 179 | - returns: the `CompoundAttribute` instance created 180 | */ 181 | public override init(_ value: CGFloat) { 182 | super.init() 183 | self.attributes = [ 184 | Top(value), 185 | Left(value), 186 | Right(value), 187 | Bottom(value) 188 | ] 189 | } 190 | 191 | /** 192 | Initializer that creates the sub `Attribute` objects shaping the 193 | `CompoundAttribute` object with `constant`, `multiplier` and 194 | `RelatedBy` properties defined by the `Constant` supplied 195 | - parameter constant: `Constant` struct aggregating 196 | `constant`, `multiplier` and `relatedBy` properties 197 | - returns: the `CompoundAttribute` instance created 198 | */ 199 | public override init(_ constant: Constant) { 200 | super.init() 201 | self.attributes = [ 202 | Top(constant), 203 | Left(constant), 204 | Right(constant), 205 | Bottom(constant) 206 | ] 207 | } 208 | 209 | /** 210 | Initializer that creates the sub `Attribute` objects shaping the 211 | `CompoundAttribute` object with the `constant` properties specified by 212 | the `UIEdgeInsets` parameter, `multiplier = 1.0` and `RelatedBy = .Equal` 213 | - parameter edgeInsets: `UIEdgeInsets` that gives value to the `constant` 214 | properties of each one of the sub `Attribute` objects 215 | - returns: the `CompoundAttribute` instance created 216 | */ 217 | public init(_ edgeInsets: UIEdgeInsets) { 218 | super.init() 219 | self.attributes = [ 220 | Top(CGFloat(edgeInsets.top)), 221 | Left(CGFloat(edgeInsets.left)), 222 | Right(CGFloat(edgeInsets.right)), 223 | Bottom(CGFloat(edgeInsets.bottom)) 224 | ] 225 | } 226 | 227 | } 228 | 229 | /** 230 | The center along the x and y axis of the object’s alignment rectangle 231 | */ 232 | public class Center: CompoundAttribute { 233 | 234 | /** 235 | Initializer that creates the sub `Attribute` objects 236 | shaping the `CompoundAttribute` object with `constant = 0.0`, 237 | `multiplier = 1.0` and `RelatedBy = .Equal` 238 | - returns: the `CompoundAttribute` instance created 239 | */ 240 | public override init() { 241 | super.init() 242 | self.attributes = [ 243 | CenterX(), 244 | CenterY() 245 | ] 246 | } 247 | 248 | /** 249 | Initializer that creates the sub `Attribute` objects shaping the 250 | `CompoundAttribute` object with `constant = value`, `multiplier = 1.0` 251 | and `RelatedBy = .Equal` 252 | - parameter value: `constant` of the constraint 253 | - returns: the `CompoundAttribute` instance created 254 | */ 255 | public override init(_ value: CGFloat) { 256 | super.init() 257 | self.attributes = [ 258 | CenterX(value), 259 | CenterY(value) 260 | ] 261 | } 262 | 263 | /** 264 | Initializer that creates the sub `Attribute` objects shaping the 265 | `CompoundAttribute` object with `constant`, `multiplier` and 266 | `RelatedBy` properties defined by the `Constant` supplied 267 | - parameter constant: `Constant` struct aggregating 268 | `constant`, `multiplier` and `relatedBy` properties 269 | - returns: the `CompoundAttribute` instance created 270 | */ 271 | public override init(_ constant: Constant) { 272 | super.init() 273 | self.attributes = [ 274 | CenterX(constant), 275 | CenterY(constant) 276 | ] 277 | } 278 | 279 | /** 280 | Initializer that creates the sub `Attribute` objects shaping the 281 | `CompoundAttribute` object with the `constant` properties specified by 282 | the `CGPoint` parameter, `multiplier = 1.0` and `RelatedBy = .Equal` 283 | - parameter point: `CGPoint` that gives value to the `constant` properties 284 | of each one of the sub `Attribute` objects 285 | - returns: the `CompoundAttribute` instance created 286 | */ 287 | public init(_ point: CGPoint) { 288 | super.init() 289 | self.attributes = [ 290 | CenterX(CGFloat(point.x)), 291 | CenterY(CGFloat(point.y)) 292 | ] 293 | } 294 | 295 | } 296 | 297 | /** 298 | The object’s margins. For UIView objects, the margins are defined 299 | by their layoutMargins property 300 | */ 301 | public class Margins: CompoundAttribute { 302 | 303 | /** 304 | Initializer that creates the sub `Attribute` objects 305 | shaping the `CompoundAttribute` object with `constant = 0.0`, 306 | `multiplier = 1.0` and `RelatedBy = .Equal` 307 | - returns: the `CompoundAttribute` instance created 308 | */ 309 | public override init() { 310 | super.init() 311 | self.attributes = [ 312 | TopMargin(), 313 | LeftMargin(), 314 | RightMargin(), 315 | BottomMargin() 316 | ] 317 | } 318 | 319 | /** 320 | Initializer that creates the sub `Attribute` objects shaping the 321 | `CompoundAttribute` object with `constant = value`, `multiplier = 1.0` 322 | and `RelatedBy = .Equal` 323 | - parameter value: `constant` of the constraint 324 | - returns: the `CompoundAttribute` instance created 325 | */ 326 | public override init(_ value: CGFloat) { 327 | super.init() 328 | self.attributes = [ 329 | TopMargin(value), 330 | LeftMargin(value), 331 | RightMargin(value), 332 | BottomMargin(value) 333 | ] 334 | } 335 | 336 | /** 337 | Initializer that creates the sub `Attribute` objects shaping the 338 | `CompoundAttribute` object with `constant`, `multiplier` and 339 | `RelatedBy` properties defined by the `Constant` supplied 340 | - parameter constant: `Constant` struct aggregating 341 | `constant`, `multiplier` and `relatedBy` properties 342 | - returns: the `CompoundAttribute` instance created 343 | */ 344 | public override init(_ constant: Constant) { 345 | super.init() 346 | self.attributes = [ 347 | TopMargin(constant), 348 | LeftMargin(constant), 349 | RightMargin(constant), 350 | BottomMargin(constant) 351 | ] 352 | } 353 | 354 | /** 355 | Initializer that creates the sub `Attribute` objects shaping the 356 | `CompoundAttribute` object with the `constant` properties specified by 357 | the `UIEdgeInsets` parameter, `multiplier = 1.0` and `RelatedBy = .Equal` 358 | - parameter edgeInsets: `UIEdgeInsets` that gives value to the `constant` 359 | properties of each one of the sub `Attribute` objects 360 | - returns: the `CompoundAttribute` instance created 361 | */ 362 | public init(_ edgeInsets: UIEdgeInsets) { 363 | super.init() 364 | self.attributes = [ 365 | TopMargin(CGFloat(edgeInsets.top)), 366 | LeftMargin(CGFloat(edgeInsets.left)), 367 | RightMargin(CGFloat(edgeInsets.right)), 368 | BottomMargin(CGFloat(edgeInsets.bottom)) 369 | ] 370 | } 371 | 372 | } 373 | 374 | /** 375 | The center along the x-axis between the object’s left and right margin. 376 | For UIView objects, the margins are defined by their layoutMargins property 377 | */ 378 | public class CenterWithinMargins: CompoundAttribute { 379 | 380 | /** 381 | Initializer that creates the sub `Attribute` objects 382 | shaping the `CompoundAttribute` object with `constant = 0.0`, 383 | `multiplier = 1.0` and `RelatedBy = .Equal` 384 | - returns: the `CompoundAttribute` instance created 385 | */ 386 | public override init() { 387 | super.init() 388 | self.attributes = [ 389 | CenterXWithinMargins(), 390 | CenterYWithinMargins() 391 | ] 392 | } 393 | 394 | /** 395 | Initializer that creates the sub `Attribute` objects shaping the 396 | `CompoundAttribute` object with `constant = value`, `multiplier = 1.0` 397 | and `RelatedBy = .Equal` 398 | - parameter value: `constant` of the constraint 399 | - returns: the `CompoundAttribute` instance created 400 | */ 401 | public override init(_ value: CGFloat) { 402 | super.init() 403 | self.attributes = [ 404 | CenterXWithinMargins(value), 405 | CenterYWithinMargins(value) 406 | ] 407 | } 408 | 409 | /** 410 | Initializer that creates the sub `Attribute` objects shaping the 411 | `CompoundAttribute` object with `constant`, `multiplier` and 412 | `RelatedBy` properties defined by the `Constant` supplied 413 | - parameter constant: `Constant` struct aggregating 414 | `constant`, `multiplier` and `relatedBy` properties 415 | - returns: the `CompoundAttribute` instance created 416 | */ 417 | public override init(_ constant: Constant) { 418 | super.init() 419 | self.attributes = [ 420 | CenterXWithinMargins(constant), 421 | CenterYWithinMargins(constant) 422 | ] 423 | } 424 | 425 | /** 426 | Initializer that creates the sub `Attribute` objects shaping the 427 | `CompoundAttribute` object with the `constant` properties specified by 428 | the `CGPoint` parameter, `multiplier = 1.0` and `RelatedBy = .Equal` 429 | - parameter point: `CGPoint` that gives value to the `constant` 430 | properties of each one of the sub `Attribute` objects 431 | - returns: the `CompoundAttribute` instance created 432 | */ 433 | public init(_ point: CGPoint) { 434 | super.init() 435 | self.attributes = [ 436 | CenterXWithinMargins(CGFloat(point.x)), 437 | CenterYWithinMargins(CGFloat(point.y)) 438 | ] 439 | } 440 | 441 | } 442 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | archiveVersion 6 | 1 7 | classes 8 | 9 | objectVersion 10 | 46 11 | objects 12 | 13 | 04D1808FE55FC4475CD2FBD432AD72A8 14 | 15 | buildConfigurationList 16 | 8AEA79A83B33CBEF59589AF68298886C 17 | buildPhases 18 | 19 | 5E0E5D4F438FC798E85F1AC109A9D5D1 20 | 78BCBF726D8A2EE1ACAF43625E6C9ECC 21 | 55B6B69B4AB481093CA3F109F9F4AB9D 22 | 23 | buildRules 24 | 25 | dependencies 26 | 27 | 65D7BFA6CD76971B56E6876B7BD23F8D 28 | 29 | isa 30 | PBXNativeTarget 31 | name 32 | Pods-EasyPeasyPlayground 33 | productName 34 | Pods-EasyPeasyPlayground 35 | productReference 36 | BEB02AEDDC02904085A7481CB42CFA14 37 | productType 38 | com.apple.product-type.framework 39 | 40 | 058D73DF7FB63FDB36AB6075C3B23D8D 41 | 42 | fileRef 43 | 3FD3ED0A933BC1F04546021CB008ADEA 44 | isa 45 | PBXBuildFile 46 | 47 | 0B72295BB6F04DAE7254C9370B524A13 48 | 49 | buildActionMask 50 | 2147483647 51 | files 52 | 53 | 16556F9667C290C6CC0C656C15657701 54 | 55 | isa 56 | PBXHeadersBuildPhase 57 | runOnlyForDeploymentPostprocessing 58 | 0 59 | 60 | 0C3A1DA34B89F8FED5EBD9C87EE93521 61 | 62 | baseConfigurationReference 63 | 991D1C463A2833A24EE7A50C6A2A059D 64 | buildSettings 65 | 66 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 67 | iPhone Developer 68 | CURRENT_PROJECT_VERSION 69 | 1 70 | DEFINES_MODULE 71 | YES 72 | DYLIB_COMPATIBILITY_VERSION 73 | 1 74 | DYLIB_CURRENT_VERSION 75 | 1 76 | DYLIB_INSTALL_NAME_BASE 77 | @rpath 78 | ENABLE_STRICT_OBJC_MSGSEND 79 | YES 80 | INFOPLIST_FILE 81 | Target Support Files/Pods-EasyPeasyPlayground/Info.plist 82 | INSTALL_PATH 83 | $(LOCAL_LIBRARY_DIR)/Frameworks 84 | IPHONEOS_DEPLOYMENT_TARGET 85 | 8.0 86 | LD_RUNPATH_SEARCH_PATHS 87 | 88 | $(inherited) 89 | @executable_path/Frameworks 90 | @loader_path/Frameworks 91 | 92 | MACH_O_TYPE 93 | staticlib 94 | MODULEMAP_FILE 95 | Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground.modulemap 96 | MTL_ENABLE_DEBUG_INFO 97 | YES 98 | OTHER_LDFLAGS 99 | 100 | OTHER_LIBTOOLFLAGS 101 | 102 | PODS_ROOT 103 | $(SRCROOT) 104 | PRODUCT_NAME 105 | Pods_EasyPeasyPlayground 106 | SDKROOT 107 | iphoneos 108 | SKIP_INSTALL 109 | YES 110 | SWIFT_OPTIMIZATION_LEVEL 111 | -Onone 112 | TARGETED_DEVICE_FAMILY 113 | 1,2 114 | VERSIONING_SYSTEM 115 | apple-generic 116 | VERSION_INFO_PREFIX 117 | 118 | 119 | isa 120 | XCBuildConfiguration 121 | name 122 | Debug 123 | 124 | 0C50A2F847545CD4BDC8DA0BCA40A234 125 | 126 | explicitFileType 127 | wrapper.framework 128 | includeInIndex 129 | 0 130 | isa 131 | PBXFileReference 132 | name 133 | EasyPeasy.framework 134 | path 135 | EasyPeasy.framework 136 | sourceTree 137 | BUILT_PRODUCTS_DIR 138 | 139 | 0E6353EA6B0854DFC5B9CC5DBB979213 140 | 141 | fileRef 142 | AB59E095952E2648BF22429E25276BAC 143 | isa 144 | PBXBuildFile 145 | 146 | 12BADB3BB344EBFE9AC677FC1A7EA7E8 147 | 148 | fileRef 149 | 1B89D4AD7D7819B0E679EDB3E3633174 150 | isa 151 | PBXBuildFile 152 | 153 | 1382CD8B7700592E442D547D5D618499 154 | 155 | baseConfigurationReference 156 | 7F7116C653DDEFB45595871697FF7B18 157 | buildSettings 158 | 159 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 160 | iPhone Developer 161 | CURRENT_PROJECT_VERSION 162 | 1 163 | DEFINES_MODULE 164 | YES 165 | DYLIB_COMPATIBILITY_VERSION 166 | 1 167 | DYLIB_CURRENT_VERSION 168 | 1 169 | DYLIB_INSTALL_NAME_BASE 170 | @rpath 171 | ENABLE_STRICT_OBJC_MSGSEND 172 | YES 173 | INFOPLIST_FILE 174 | Target Support Files/Pods-EasyPeasyPlayground/Info.plist 175 | INSTALL_PATH 176 | $(LOCAL_LIBRARY_DIR)/Frameworks 177 | IPHONEOS_DEPLOYMENT_TARGET 178 | 8.0 179 | LD_RUNPATH_SEARCH_PATHS 180 | 181 | $(inherited) 182 | @executable_path/Frameworks 183 | @loader_path/Frameworks 184 | 185 | MACH_O_TYPE 186 | staticlib 187 | MODULEMAP_FILE 188 | Target Support Files/Pods-EasyPeasyPlayground/Pods-EasyPeasyPlayground.modulemap 189 | MTL_ENABLE_DEBUG_INFO 190 | NO 191 | OTHER_LDFLAGS 192 | 193 | OTHER_LIBTOOLFLAGS 194 | 195 | PODS_ROOT 196 | $(SRCROOT) 197 | PRODUCT_NAME 198 | Pods_EasyPeasyPlayground 199 | SDKROOT 200 | iphoneos 201 | SKIP_INSTALL 202 | YES 203 | TARGETED_DEVICE_FAMILY 204 | 1,2 205 | VERSIONING_SYSTEM 206 | apple-generic 207 | VERSION_INFO_PREFIX 208 | 209 | 210 | isa 211 | XCBuildConfiguration 212 | name 213 | Release 214 | 215 | 16556F9667C290C6CC0C656C15657701 216 | 217 | fileRef 218 | 5ABE2C8001EB9ED5A3E8A4C6E806C42C 219 | isa 220 | PBXBuildFile 221 | settings 222 | 223 | ATTRIBUTES 224 | 225 | Public 226 | 227 | 228 | 229 | 16922D4C041784C28B5D25B3FE8942E0 230 | 231 | fileRef 232 | A65CC86DB740B5593D4E0A404DF7E909 233 | isa 234 | PBXBuildFile 235 | 236 | 18340F12838DEE43507667CC74401EB1 237 | 238 | children 239 | 240 | 6E7E5AF37923BFA48D6994B9BFC6535F 241 | C3B7BDF5CE5CB8F095FE12DA55D9A9BB 242 | 243 | isa 244 | PBXGroup 245 | name 246 | iOS 247 | sourceTree 248 | <group> 249 | 250 | 1B89D4AD7D7819B0E679EDB3E3633174 251 | 252 | includeInIndex 253 | 1 254 | isa 255 | PBXFileReference 256 | lastKnownFileType 257 | sourcecode.swift 258 | name 259 | UIView+Internal.swift 260 | path 261 | EasyPeasy/UIView+Internal.swift 262 | sourceTree 263 | <group> 264 | 265 | 21D567DFE3DC38BC5C81D84B5FAEA212 266 | 267 | includeInIndex 268 | 1 269 | isa 270 | PBXFileReference 271 | lastKnownFileType 272 | text.plist.xml 273 | path 274 | Pods-EasyPeasyPlayground-acknowledgements.plist 275 | sourceTree 276 | <group> 277 | 278 | 225900D3762FFCF3F81BC81A0D22A99A 279 | 280 | fileRef 281 | 639BC9C01BCDCA0515D1D3913F9ECF64 282 | isa 283 | PBXBuildFile 284 | 285 | 23791134E554FDDC85A783F6DD311BDA 286 | 287 | buildActionMask 288 | 2147483647 289 | files 290 | 291 | 6AE1E7DEFB137D50611DD0C5C1E6C6EB 292 | 687922A5E381E31710087B8DEFDB2BF3 293 | 294 | isa 295 | PBXFrameworksBuildPhase 296 | runOnlyForDeploymentPostprocessing 297 | 0 298 | 299 | 265B27661C6CA8A75FC2030B7669CADD 300 | 301 | fileRef 302 | F69C458334B28EAE626999B38FA7DF28 303 | isa 304 | PBXBuildFile 305 | 306 | 2A4C20E5B2634886DB1867C84C02016B 307 | 308 | includeInIndex 309 | 1 310 | isa 311 | PBXFileReference 312 | lastKnownFileType 313 | text.xcconfig 314 | path 315 | EasyPeasy.xcconfig 316 | sourceTree 317 | <group> 318 | 319 | 2B9283F43DF6362DF807BF8DFC774FB5 320 | 321 | includeInIndex 322 | 1 323 | isa 324 | PBXFileReference 325 | lastKnownFileType 326 | text.script.sh 327 | path 328 | Pods-EasyPeasyPlayground-frameworks.sh 329 | sourceTree 330 | <group> 331 | 332 | 2D8E8EC45A3A1A1D94AE762CB5028504 333 | 334 | buildConfigurations 335 | 336 | A70CDAD61F90AC503C7D04CC22DA2923 337 | FB45FFD90572718D82AB9092B750F0CA 338 | 339 | defaultConfigurationIsVisible 340 | 0 341 | defaultConfigurationName 342 | Release 343 | isa 344 | XCConfigurationList 345 | 346 | 2F0181C7392835E689700904D3EBEF59 347 | 348 | includeInIndex 349 | 1 350 | isa 351 | PBXFileReference 352 | lastKnownFileType 353 | sourcecode.c.h 354 | path 355 | Pods-EasyPeasyPlayground-umbrella.h 356 | sourceTree 357 | <group> 358 | 359 | 2FDEA72A28FAA8D6B2952E5096CB5039 360 | 361 | fileRef 362 | BB56F811EE125C0C82800C568357B573 363 | isa 364 | PBXBuildFile 365 | 366 | 332F54735CCF706F98059149D0F67A5B 367 | 368 | includeInIndex 369 | 1 370 | isa 371 | PBXFileReference 372 | lastKnownFileType 373 | sourcecode.c.h 374 | path 375 | EasyPeasy-prefix.pch 376 | sourceTree 377 | <group> 378 | 379 | 3A1BC7D04384E3C19912213FBE0C5A9C 380 | 381 | includeInIndex 382 | 1 383 | isa 384 | PBXFileReference 385 | lastKnownFileType 386 | sourcecode.swift 387 | name 388 | Attribute+Install.swift 389 | path 390 | EasyPeasy/Attribute+Install.swift 391 | sourceTree 392 | <group> 393 | 394 | 3FD3ED0A933BC1F04546021CB008ADEA 395 | 396 | includeInIndex 397 | 1 398 | isa 399 | PBXFileReference 400 | lastKnownFileType 401 | sourcecode.swift 402 | name 403 | PositionAttribute.swift 404 | path 405 | EasyPeasy/PositionAttribute.swift 406 | sourceTree 407 | <group> 408 | 409 | 433CD3331B6C3787F473C941B61FC68F 410 | 411 | children 412 | 413 | 18340F12838DEE43507667CC74401EB1 414 | 415 | isa 416 | PBXGroup 417 | name 418 | Frameworks 419 | sourceTree 420 | <group> 421 | 422 | 50FFEEBB24516277F2869814ECA58C22 423 | 424 | children 425 | 426 | BB6199388A2E9B5A741DF91971E6BDB5 427 | 428 | isa 429 | PBXGroup 430 | name 431 | Pods 432 | sourceTree 433 | <group> 434 | 435 | 55B6B69B4AB481093CA3F109F9F4AB9D 436 | 437 | buildActionMask 438 | 2147483647 439 | files 440 | 441 | 64110798B8676878B6C6AC76A4C7DF29 442 | 443 | isa 444 | PBXHeadersBuildPhase 445 | runOnlyForDeploymentPostprocessing 446 | 0 447 | 448 | 5ABE2C8001EB9ED5A3E8A4C6E806C42C 449 | 450 | includeInIndex 451 | 1 452 | isa 453 | PBXFileReference 454 | lastKnownFileType 455 | sourcecode.c.h 456 | path 457 | EasyPeasy-umbrella.h 458 | sourceTree 459 | <group> 460 | 461 | 5BD24BF68EA52F71D2477BB686F9BFC5 462 | 463 | fileRef 464 | B2A34A033AB5B55EB3981E07183627BD 465 | isa 466 | PBXBuildFile 467 | 468 | 5E0E5D4F438FC798E85F1AC109A9D5D1 469 | 470 | buildActionMask 471 | 2147483647 472 | files 473 | 474 | FA6D902E18851068D08B386C0DFA4543 475 | 476 | isa 477 | PBXSourcesBuildPhase 478 | runOnlyForDeploymentPostprocessing 479 | 0 480 | 481 | 5E22297C7DAF146AC92C517BEFC10ADB 482 | 483 | includeInIndex 484 | 1 485 | isa 486 | PBXFileReference 487 | lastKnownFileType 488 | sourcecode.swift 489 | name 490 | UIView+Easy.swift 491 | path 492 | EasyPeasy/UIView+Easy.swift 493 | sourceTree 494 | <group> 495 | 496 | 639BC9C01BCDCA0515D1D3913F9ECF64 497 | 498 | includeInIndex 499 | 1 500 | isa 501 | PBXFileReference 502 | lastKnownFileType 503 | sourcecode.swift 504 | name 505 | DimensionAttribute.swift 506 | path 507 | EasyPeasy/DimensionAttribute.swift 508 | sourceTree 509 | <group> 510 | 511 | 64110798B8676878B6C6AC76A4C7DF29 512 | 513 | fileRef 514 | 2F0181C7392835E689700904D3EBEF59 515 | isa 516 | PBXBuildFile 517 | settings 518 | 519 | ATTRIBUTES 520 | 521 | Public 522 | 523 | 524 | 525 | 65D7BFA6CD76971B56E6876B7BD23F8D 526 | 527 | isa 528 | PBXTargetDependency 529 | name 530 | EasyPeasy 531 | target 532 | B22E5CA2A4EFB3B5EE6DDDFB0850E940 533 | targetProxy 534 | 6DF5BAA8A35780BA5D004EC6098C2E1C 535 | 536 | 687922A5E381E31710087B8DEFDB2BF3 537 | 538 | fileRef 539 | C3B7BDF5CE5CB8F095FE12DA55D9A9BB 540 | isa 541 | PBXBuildFile 542 | 543 | 6AE1E7DEFB137D50611DD0C5C1E6C6EB 544 | 545 | fileRef 546 | 6E7E5AF37923BFA48D6994B9BFC6535F 547 | isa 548 | PBXBuildFile 549 | 550 | 6DF5BAA8A35780BA5D004EC6098C2E1C 551 | 552 | containerPortal 553 | D41D8CD98F00B204E9800998ECF8427E 554 | isa 555 | PBXContainerItemProxy 556 | proxyType 557 | 1 558 | remoteGlobalIDString 559 | B22E5CA2A4EFB3B5EE6DDDFB0850E940 560 | remoteInfo 561 | EasyPeasy 562 | 563 | 6E7E5AF37923BFA48D6994B9BFC6535F 564 | 565 | isa 566 | PBXFileReference 567 | lastKnownFileType 568 | wrapper.framework 569 | name 570 | Foundation.framework 571 | path 572 | Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/Foundation.framework 573 | sourceTree 574 | DEVELOPER_DIR 575 | 576 | 7198DBB71A5675BF4B4A4C1EF00AD6D1 577 | 578 | includeInIndex 579 | 1 580 | isa 581 | PBXFileReference 582 | lastKnownFileType 583 | sourcecode.swift 584 | name 585 | Attribute+Operators.swift 586 | path 587 | EasyPeasy/Attribute+Operators.swift 588 | sourceTree 589 | <group> 590 | 591 | 727D4F6AD7C986F52C9CB12640F5908C 592 | 593 | baseConfigurationReference 594 | 2A4C20E5B2634886DB1867C84C02016B 595 | buildSettings 596 | 597 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 598 | iPhone Developer 599 | CURRENT_PROJECT_VERSION 600 | 1 601 | DEFINES_MODULE 602 | YES 603 | DYLIB_COMPATIBILITY_VERSION 604 | 1 605 | DYLIB_CURRENT_VERSION 606 | 1 607 | DYLIB_INSTALL_NAME_BASE 608 | @rpath 609 | ENABLE_STRICT_OBJC_MSGSEND 610 | YES 611 | GCC_PREFIX_HEADER 612 | Target Support Files/EasyPeasy/EasyPeasy-prefix.pch 613 | INFOPLIST_FILE 614 | Target Support Files/EasyPeasy/Info.plist 615 | INSTALL_PATH 616 | $(LOCAL_LIBRARY_DIR)/Frameworks 617 | IPHONEOS_DEPLOYMENT_TARGET 618 | 8.0 619 | LD_RUNPATH_SEARCH_PATHS 620 | 621 | $(inherited) 622 | @executable_path/Frameworks 623 | @loader_path/Frameworks 624 | 625 | MODULEMAP_FILE 626 | Target Support Files/EasyPeasy/EasyPeasy.modulemap 627 | MTL_ENABLE_DEBUG_INFO 628 | YES 629 | PRODUCT_NAME 630 | EasyPeasy 631 | SDKROOT 632 | iphoneos 633 | SKIP_INSTALL 634 | YES 635 | SWIFT_OPTIMIZATION_LEVEL 636 | -Onone 637 | TARGETED_DEVICE_FAMILY 638 | 1,2 639 | VERSIONING_SYSTEM 640 | apple-generic 641 | VERSION_INFO_PREFIX 642 | 643 | 644 | isa 645 | XCBuildConfiguration 646 | name 647 | Debug 648 | 649 | 735A11EE4D725EF6714DA0D2DA55406B 650 | 651 | includeInIndex 652 | 1 653 | isa 654 | PBXFileReference 655 | path 656 | EasyPeasy.modulemap 657 | sourceTree 658 | <group> 659 | 660 | 76977CFFFD1C2E7ADD0BCCCDDDBA76C6 661 | 662 | includeInIndex 663 | 1 664 | isa 665 | PBXFileReference 666 | lastKnownFileType 667 | text.script.sh 668 | path 669 | Pods-EasyPeasyPlayground-resources.sh 670 | sourceTree 671 | <group> 672 | 673 | 78BCBF726D8A2EE1ACAF43625E6C9ECC 674 | 675 | buildActionMask 676 | 2147483647 677 | files 678 | 679 | DB7ACDBB4F7C7C3084ED44842159C708 680 | 681 | isa 682 | PBXFrameworksBuildPhase 683 | runOnlyForDeploymentPostprocessing 684 | 0 685 | 686 | 7DB346D0F39D3F0E887471402A8071AB 687 | 688 | children 689 | 690 | BA6428E9F66FD5A23C0A2E06ED26CD2F 691 | 433CD3331B6C3787F473C941B61FC68F 692 | 50FFEEBB24516277F2869814ECA58C22 693 | D30ABCCE2D8FB0747B61E6D2F128B50E 694 | D1FBDD454C89D1EC91F91E0BDE627F32 695 | 696 | isa 697 | PBXGroup 698 | sourceTree 699 | <group> 700 | 701 | 7F7116C653DDEFB45595871697FF7B18 702 | 703 | includeInIndex 704 | 1 705 | isa 706 | PBXFileReference 707 | lastKnownFileType 708 | text.xcconfig 709 | path 710 | Pods-EasyPeasyPlayground.release.xcconfig 711 | sourceTree 712 | <group> 713 | 714 | 86699B58B42F4EA69AA471C9E2E65C7F 715 | 716 | fileRef 717 | 7198DBB71A5675BF4B4A4C1EF00AD6D1 718 | isa 719 | PBXBuildFile 720 | 721 | 8AEA79A83B33CBEF59589AF68298886C 722 | 723 | buildConfigurations 724 | 725 | 0C3A1DA34B89F8FED5EBD9C87EE93521 726 | 1382CD8B7700592E442D547D5D618499 727 | 728 | defaultConfigurationIsVisible 729 | 0 730 | defaultConfigurationName 731 | Release 732 | isa 733 | XCConfigurationList 734 | 735 | 987F9F46E1D78437A2C8A7C056526315 736 | 737 | includeInIndex 738 | 1 739 | isa 740 | PBXFileReference 741 | lastKnownFileType 742 | text.plist.xml 743 | path 744 | Info.plist 745 | sourceTree 746 | <group> 747 | 748 | 99153345B9D856EF9F7AE653A437B9A6 749 | 750 | includeInIndex 751 | 1 752 | isa 753 | PBXFileReference 754 | lastKnownFileType 755 | text.plist.xml 756 | path 757 | Info.plist 758 | sourceTree 759 | <group> 760 | 761 | 991D1C463A2833A24EE7A50C6A2A059D 762 | 763 | includeInIndex 764 | 1 765 | isa 766 | PBXFileReference 767 | lastKnownFileType 768 | text.xcconfig 769 | path 770 | Pods-EasyPeasyPlayground.debug.xcconfig 771 | sourceTree 772 | <group> 773 | 774 | 9E5095F8A155A61E731E7D9F03A5A05A 775 | 776 | children 777 | 778 | 735A11EE4D725EF6714DA0D2DA55406B 779 | 2A4C20E5B2634886DB1867C84C02016B 780 | F69C458334B28EAE626999B38FA7DF28 781 | 332F54735CCF706F98059149D0F67A5B 782 | 5ABE2C8001EB9ED5A3E8A4C6E806C42C 783 | 99153345B9D856EF9F7AE653A437B9A6 784 | 785 | isa 786 | PBXGroup 787 | name 788 | Support Files 789 | path 790 | ../Target Support Files/EasyPeasy 791 | sourceTree 792 | <group> 793 | 794 | A63A35BC26D412DAF6326CE7635FD8D1 795 | 796 | fileRef 797 | 5E22297C7DAF146AC92C517BEFC10ADB 798 | isa 799 | PBXBuildFile 800 | 801 | A65CC86DB740B5593D4E0A404DF7E909 802 | 803 | includeInIndex 804 | 1 805 | isa 806 | PBXFileReference 807 | lastKnownFileType 808 | sourcecode.swift 809 | name 810 | NSLayoutConstraint+Internal.swift 811 | path 812 | EasyPeasy/NSLayoutConstraint+Internal.swift 813 | sourceTree 814 | <group> 815 | 816 | A70CDAD61F90AC503C7D04CC22DA2923 817 | 818 | buildSettings 819 | 820 | ALWAYS_SEARCH_USER_PATHS 821 | NO 822 | CLANG_CXX_LANGUAGE_STANDARD 823 | gnu++0x 824 | CLANG_CXX_LIBRARY 825 | libc++ 826 | CLANG_ENABLE_MODULES 827 | YES 828 | CLANG_ENABLE_OBJC_ARC 829 | YES 830 | CLANG_WARN_BOOL_CONVERSION 831 | YES 832 | CLANG_WARN_CONSTANT_CONVERSION 833 | YES 834 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 835 | YES 836 | CLANG_WARN_EMPTY_BODY 837 | YES 838 | CLANG_WARN_ENUM_CONVERSION 839 | YES 840 | CLANG_WARN_INT_CONVERSION 841 | YES 842 | CLANG_WARN_OBJC_ROOT_CLASS 843 | YES 844 | CLANG_WARN_UNREACHABLE_CODE 845 | YES 846 | CLANG_WARN__DUPLICATE_METHOD_MATCH 847 | YES 848 | COPY_PHASE_STRIP 849 | NO 850 | GCC_C_LANGUAGE_STANDARD 851 | gnu99 852 | GCC_DYNAMIC_NO_PIC 853 | NO 854 | GCC_OPTIMIZATION_LEVEL 855 | 0 856 | GCC_PREPROCESSOR_DEFINITIONS 857 | 858 | DEBUG=1 859 | $(inherited) 860 | 861 | GCC_SYMBOLS_PRIVATE_EXTERN 862 | NO 863 | GCC_WARN_64_TO_32_BIT_CONVERSION 864 | YES 865 | GCC_WARN_ABOUT_RETURN_TYPE 866 | YES 867 | GCC_WARN_UNDECLARED_SELECTOR 868 | YES 869 | GCC_WARN_UNINITIALIZED_AUTOS 870 | YES 871 | GCC_WARN_UNUSED_FUNCTION 872 | YES 873 | GCC_WARN_UNUSED_VARIABLE 874 | YES 875 | IPHONEOS_DEPLOYMENT_TARGET 876 | 8.0 877 | ONLY_ACTIVE_ARCH 878 | YES 879 | STRIP_INSTALLED_PRODUCT 880 | NO 881 | SYMROOT 882 | ${SRCROOT}/../build 883 | 884 | isa 885 | XCBuildConfiguration 886 | name 887 | Debug 888 | 889 | AB59E095952E2648BF22429E25276BAC 890 | 891 | includeInIndex 892 | 1 893 | isa 894 | PBXFileReference 895 | lastKnownFileType 896 | sourcecode.swift 897 | name 898 | ReferenceAttribute.swift 899 | path 900 | EasyPeasy/ReferenceAttribute.swift 901 | sourceTree 902 | <group> 903 | 904 | AD73FE6FE5541D4F28EE2CC9838246F4 905 | 906 | fileRef 907 | FB21DC92C203189907835D9DB8779754 908 | isa 909 | PBXBuildFile 910 | 911 | B22E5CA2A4EFB3B5EE6DDDFB0850E940 912 | 913 | buildConfigurationList 914 | E96CFA3778D16B204BFFC11AE829FAB5 915 | buildPhases 916 | 917 | E83427BD0CAF360194792BCE6DCA8D48 918 | 23791134E554FDDC85A783F6DD311BDA 919 | 0B72295BB6F04DAE7254C9370B524A13 920 | 921 | buildRules 922 | 923 | dependencies 924 | 925 | isa 926 | PBXNativeTarget 927 | name 928 | EasyPeasy 929 | productName 930 | EasyPeasy 931 | productReference 932 | 0C50A2F847545CD4BDC8DA0BCA40A234 933 | productType 934 | com.apple.product-type.framework 935 | 936 | B2A34A033AB5B55EB3981E07183627BD 937 | 938 | includeInIndex 939 | 1 940 | isa 941 | PBXFileReference 942 | lastKnownFileType 943 | sourcecode.swift 944 | name 945 | Priority.swift 946 | path 947 | EasyPeasy/Priority.swift 948 | sourceTree 949 | <group> 950 | 951 | B849A97DB642F498FE5D891519E901D8 952 | 953 | includeInIndex 954 | 1 955 | isa 956 | PBXFileReference 957 | lastKnownFileType 958 | text 959 | path 960 | Pods-EasyPeasyPlayground-acknowledgements.markdown 961 | sourceTree 962 | <group> 963 | 964 | BA6428E9F66FD5A23C0A2E06ED26CD2F 965 | 966 | includeInIndex 967 | 1 968 | isa 969 | PBXFileReference 970 | lastKnownFileType 971 | text 972 | name 973 | Podfile 974 | path 975 | ../Podfile 976 | sourceTree 977 | SOURCE_ROOT 978 | xcLanguageSpecificationIdentifier 979 | xcode.lang.ruby 980 | 981 | BB56F811EE125C0C82800C568357B573 982 | 983 | includeInIndex 984 | 1 985 | isa 986 | PBXFileReference 987 | lastKnownFileType 988 | sourcecode.swift 989 | name 990 | Attribute.swift 991 | path 992 | EasyPeasy/Attribute.swift 993 | sourceTree 994 | <group> 995 | 996 | BB6199388A2E9B5A741DF91971E6BDB5 997 | 998 | children 999 | 1000 | BB56F811EE125C0C82800C568357B573 1001 | 3A1BC7D04384E3C19912213FBE0C5A9C 1002 | 7198DBB71A5675BF4B4A4C1EF00AD6D1 1003 | FB21DC92C203189907835D9DB8779754 1004 | F85415C90A17F2BB1DD27DD41C7403F3 1005 | 639BC9C01BCDCA0515D1D3913F9ECF64 1006 | A65CC86DB740B5593D4E0A404DF7E909 1007 | 3FD3ED0A933BC1F04546021CB008ADEA 1008 | B2A34A033AB5B55EB3981E07183627BD 1009 | AB59E095952E2648BF22429E25276BAC 1010 | 5E22297C7DAF146AC92C517BEFC10ADB 1011 | 1B89D4AD7D7819B0E679EDB3E3633174 1012 | 9E5095F8A155A61E731E7D9F03A5A05A 1013 | 1014 | isa 1015 | PBXGroup 1016 | name 1017 | EasyPeasy 1018 | path 1019 | EasyPeasy 1020 | sourceTree 1021 | <group> 1022 | 1023 | BEB02AEDDC02904085A7481CB42CFA14 1024 | 1025 | explicitFileType 1026 | wrapper.framework 1027 | includeInIndex 1028 | 0 1029 | isa 1030 | PBXFileReference 1031 | name 1032 | Pods_EasyPeasyPlayground.framework 1033 | path 1034 | Pods_EasyPeasyPlayground.framework 1035 | sourceTree 1036 | BUILT_PRODUCTS_DIR 1037 | 1038 | C3B7BDF5CE5CB8F095FE12DA55D9A9BB 1039 | 1040 | isa 1041 | PBXFileReference 1042 | lastKnownFileType 1043 | wrapper.framework 1044 | name 1045 | UIKit.framework 1046 | path 1047 | Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/System/Library/Frameworks/UIKit.framework 1048 | sourceTree 1049 | DEVELOPER_DIR 1050 | 1051 | C9AA2931E72F7EBEF2FB5CB61A588104 1052 | 1053 | includeInIndex 1054 | 1 1055 | isa 1056 | PBXFileReference 1057 | lastKnownFileType 1058 | sourcecode.c.objc 1059 | path 1060 | Pods-EasyPeasyPlayground-dummy.m 1061 | sourceTree 1062 | <group> 1063 | 1064 | D0B0A84FC3956F716BE8A0B04A3FDCDA 1065 | 1066 | baseConfigurationReference 1067 | 2A4C20E5B2634886DB1867C84C02016B 1068 | buildSettings 1069 | 1070 | CODE_SIGN_IDENTITY[sdk=iphoneos*] 1071 | iPhone Developer 1072 | CURRENT_PROJECT_VERSION 1073 | 1 1074 | DEFINES_MODULE 1075 | YES 1076 | DYLIB_COMPATIBILITY_VERSION 1077 | 1 1078 | DYLIB_CURRENT_VERSION 1079 | 1 1080 | DYLIB_INSTALL_NAME_BASE 1081 | @rpath 1082 | ENABLE_STRICT_OBJC_MSGSEND 1083 | YES 1084 | GCC_PREFIX_HEADER 1085 | Target Support Files/EasyPeasy/EasyPeasy-prefix.pch 1086 | INFOPLIST_FILE 1087 | Target Support Files/EasyPeasy/Info.plist 1088 | INSTALL_PATH 1089 | $(LOCAL_LIBRARY_DIR)/Frameworks 1090 | IPHONEOS_DEPLOYMENT_TARGET 1091 | 8.0 1092 | LD_RUNPATH_SEARCH_PATHS 1093 | 1094 | $(inherited) 1095 | @executable_path/Frameworks 1096 | @loader_path/Frameworks 1097 | 1098 | MODULEMAP_FILE 1099 | Target Support Files/EasyPeasy/EasyPeasy.modulemap 1100 | MTL_ENABLE_DEBUG_INFO 1101 | NO 1102 | PRODUCT_NAME 1103 | EasyPeasy 1104 | SDKROOT 1105 | iphoneos 1106 | SKIP_INSTALL 1107 | YES 1108 | TARGETED_DEVICE_FAMILY 1109 | 1,2 1110 | VERSIONING_SYSTEM 1111 | apple-generic 1112 | VERSION_INFO_PREFIX 1113 | 1114 | 1115 | isa 1116 | XCBuildConfiguration 1117 | name 1118 | Release 1119 | 1120 | D1FBDD454C89D1EC91F91E0BDE627F32 1121 | 1122 | children 1123 | 1124 | FFED2CB096898098A71693F5383C185A 1125 | 1126 | isa 1127 | PBXGroup 1128 | name 1129 | Targets Support Files 1130 | sourceTree 1131 | <group> 1132 | 1133 | D30ABCCE2D8FB0747B61E6D2F128B50E 1134 | 1135 | children 1136 | 1137 | 0C50A2F847545CD4BDC8DA0BCA40A234 1138 | BEB02AEDDC02904085A7481CB42CFA14 1139 | 1140 | isa 1141 | PBXGroup 1142 | name 1143 | Products 1144 | sourceTree 1145 | <group> 1146 | 1147 | D41D8CD98F00B204E9800998ECF8427E 1148 | 1149 | attributes 1150 | 1151 | LastSwiftUpdateCheck 1152 | 0700 1153 | LastUpgradeCheck 1154 | 0700 1155 | 1156 | buildConfigurationList 1157 | 2D8E8EC45A3A1A1D94AE762CB5028504 1158 | compatibilityVersion 1159 | Xcode 3.2 1160 | developmentRegion 1161 | English 1162 | hasScannedForEncodings 1163 | 0 1164 | isa 1165 | PBXProject 1166 | knownRegions 1167 | 1168 | en 1169 | 1170 | mainGroup 1171 | 7DB346D0F39D3F0E887471402A8071AB 1172 | productRefGroup 1173 | D30ABCCE2D8FB0747B61E6D2F128B50E 1174 | projectDirPath 1175 | 1176 | projectReferences 1177 | 1178 | projectRoot 1179 | 1180 | targets 1181 | 1182 | B22E5CA2A4EFB3B5EE6DDDFB0850E940 1183 | 04D1808FE55FC4475CD2FBD432AD72A8 1184 | 1185 | 1186 | DB7ACDBB4F7C7C3084ED44842159C708 1187 | 1188 | fileRef 1189 | 6E7E5AF37923BFA48D6994B9BFC6535F 1190 | isa 1191 | PBXBuildFile 1192 | 1193 | DF1CE85D5148718CBAB55B842783D5F7 1194 | 1195 | fileRef 1196 | F85415C90A17F2BB1DD27DD41C7403F3 1197 | isa 1198 | PBXBuildFile 1199 | 1200 | E60F90FB42FC1DEF963974EDFE83B40F 1201 | 1202 | includeInIndex 1203 | 1 1204 | isa 1205 | PBXFileReference 1206 | path 1207 | Pods-EasyPeasyPlayground.modulemap 1208 | sourceTree 1209 | <group> 1210 | 1211 | E83427BD0CAF360194792BCE6DCA8D48 1212 | 1213 | buildActionMask 1214 | 2147483647 1215 | files 1216 | 1217 | F70793A7FC399C13F88A78D2308BA87E 1218 | 86699B58B42F4EA69AA471C9E2E65C7F 1219 | 2FDEA72A28FAA8D6B2952E5096CB5039 1220 | AD73FE6FE5541D4F28EE2CC9838246F4 1221 | DF1CE85D5148718CBAB55B842783D5F7 1222 | 225900D3762FFCF3F81BC81A0D22A99A 1223 | 265B27661C6CA8A75FC2030B7669CADD 1224 | 16922D4C041784C28B5D25B3FE8942E0 1225 | 058D73DF7FB63FDB36AB6075C3B23D8D 1226 | 5BD24BF68EA52F71D2477BB686F9BFC5 1227 | 0E6353EA6B0854DFC5B9CC5DBB979213 1228 | A63A35BC26D412DAF6326CE7635FD8D1 1229 | 12BADB3BB344EBFE9AC677FC1A7EA7E8 1230 | 1231 | isa 1232 | PBXSourcesBuildPhase 1233 | runOnlyForDeploymentPostprocessing 1234 | 0 1235 | 1236 | E96CFA3778D16B204BFFC11AE829FAB5 1237 | 1238 | buildConfigurations 1239 | 1240 | 727D4F6AD7C986F52C9CB12640F5908C 1241 | D0B0A84FC3956F716BE8A0B04A3FDCDA 1242 | 1243 | defaultConfigurationIsVisible 1244 | 0 1245 | defaultConfigurationName 1246 | Release 1247 | isa 1248 | XCConfigurationList 1249 | 1250 | F69C458334B28EAE626999B38FA7DF28 1251 | 1252 | includeInIndex 1253 | 1 1254 | isa 1255 | PBXFileReference 1256 | lastKnownFileType 1257 | sourcecode.c.objc 1258 | path 1259 | EasyPeasy-dummy.m 1260 | sourceTree 1261 | <group> 1262 | 1263 | F70793A7FC399C13F88A78D2308BA87E 1264 | 1265 | fileRef 1266 | 3A1BC7D04384E3C19912213FBE0C5A9C 1267 | isa 1268 | PBXBuildFile 1269 | 1270 | F85415C90A17F2BB1DD27DD41C7403F3 1271 | 1272 | includeInIndex 1273 | 1 1274 | isa 1275 | PBXFileReference 1276 | lastKnownFileType 1277 | sourcecode.swift 1278 | name 1279 | Constant.swift 1280 | path 1281 | EasyPeasy/Constant.swift 1282 | sourceTree 1283 | <group> 1284 | 1285 | FA6D902E18851068D08B386C0DFA4543 1286 | 1287 | fileRef 1288 | C9AA2931E72F7EBEF2FB5CB61A588104 1289 | isa 1290 | PBXBuildFile 1291 | 1292 | FB21DC92C203189907835D9DB8779754 1293 | 1294 | includeInIndex 1295 | 1 1296 | isa 1297 | PBXFileReference 1298 | lastKnownFileType 1299 | sourcecode.swift 1300 | name 1301 | CompoundAttribute.swift 1302 | path 1303 | EasyPeasy/CompoundAttribute.swift 1304 | sourceTree 1305 | <group> 1306 | 1307 | FB45FFD90572718D82AB9092B750F0CA 1308 | 1309 | buildSettings 1310 | 1311 | ALWAYS_SEARCH_USER_PATHS 1312 | NO 1313 | CLANG_CXX_LANGUAGE_STANDARD 1314 | gnu++0x 1315 | CLANG_CXX_LIBRARY 1316 | libc++ 1317 | CLANG_ENABLE_MODULES 1318 | YES 1319 | CLANG_ENABLE_OBJC_ARC 1320 | YES 1321 | CLANG_WARN_BOOL_CONVERSION 1322 | YES 1323 | CLANG_WARN_CONSTANT_CONVERSION 1324 | YES 1325 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE 1326 | YES 1327 | CLANG_WARN_EMPTY_BODY 1328 | YES 1329 | CLANG_WARN_ENUM_CONVERSION 1330 | YES 1331 | CLANG_WARN_INT_CONVERSION 1332 | YES 1333 | CLANG_WARN_OBJC_ROOT_CLASS 1334 | YES 1335 | CLANG_WARN_UNREACHABLE_CODE 1336 | YES 1337 | CLANG_WARN__DUPLICATE_METHOD_MATCH 1338 | YES 1339 | COPY_PHASE_STRIP 1340 | YES 1341 | ENABLE_NS_ASSERTIONS 1342 | NO 1343 | GCC_C_LANGUAGE_STANDARD 1344 | gnu99 1345 | GCC_PREPROCESSOR_DEFINITIONS 1346 | 1347 | RELEASE=1 1348 | 1349 | GCC_WARN_64_TO_32_BIT_CONVERSION 1350 | YES 1351 | GCC_WARN_ABOUT_RETURN_TYPE 1352 | YES 1353 | GCC_WARN_UNDECLARED_SELECTOR 1354 | YES 1355 | GCC_WARN_UNINITIALIZED_AUTOS 1356 | YES 1357 | GCC_WARN_UNUSED_FUNCTION 1358 | YES 1359 | GCC_WARN_UNUSED_VARIABLE 1360 | YES 1361 | IPHONEOS_DEPLOYMENT_TARGET 1362 | 8.0 1363 | STRIP_INSTALLED_PRODUCT 1364 | NO 1365 | SYMROOT 1366 | ${SRCROOT}/../build 1367 | VALIDATE_PRODUCT 1368 | YES 1369 | 1370 | isa 1371 | XCBuildConfiguration 1372 | name 1373 | Release 1374 | 1375 | FFED2CB096898098A71693F5383C185A 1376 | 1377 | children 1378 | 1379 | 987F9F46E1D78437A2C8A7C056526315 1380 | E60F90FB42FC1DEF963974EDFE83B40F 1381 | B849A97DB642F498FE5D891519E901D8 1382 | 21D567DFE3DC38BC5C81D84B5FAEA212 1383 | C9AA2931E72F7EBEF2FB5CB61A588104 1384 | 2B9283F43DF6362DF807BF8DFC774FB5 1385 | 76977CFFFD1C2E7ADD0BCCCDDDBA76C6 1386 | 2F0181C7392835E689700904D3EBEF59 1387 | 991D1C463A2833A24EE7A50C6A2A059D 1388 | 7F7116C653DDEFB45595871697FF7B18 1389 | 1390 | isa 1391 | PBXGroup 1392 | name 1393 | Pods-EasyPeasyPlayground 1394 | path 1395 | Target Support Files/Pods-EasyPeasyPlayground 1396 | sourceTree 1397 | <group> 1398 | 1399 | 1400 | rootObject 1401 | D41D8CD98F00B204E9800998ECF8427E 1402 | 1403 | 1404 | --------------------------------------------------------------------------------