├── .travis.yml ├── SwiftyLayout.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcschemes │ │ ├── SwiftyLayout-Mac.xcscheme │ │ └── SwiftyLayout-iOS.xcscheme └── project.pbxproj ├── SampleApp-Mac ├── SampleApp-Mac.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── SampleApp-Mac │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── AppDelegate.swift │ └── Base.lproj │ └── MainMenu.xib ├── SampleApp-iOS ├── SampleApp-iOS.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ ├── SampleApp-iOS.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── SampleApp-iOS │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard │ ├── Info.plist │ ├── AppDelegate.swift │ └── ViewController.swift ├── SwiftyLayoutTests ├── TestHelper.swift ├── Info.plist ├── OperatorsWithUILayoutSupportTests.swift └── OperatorsWithViewTests.swift ├── SwiftyLayout ├── SwiftyLayout │ ├── UILayoutSupport+SwiftyLayout.swift │ ├── ConstraintTerm.swift │ ├── View+SwiftyLayout.swift │ └── Operators.swift ├── SwiftyLayout.h └── Info.plist ├── CHANGES.md ├── Makefile ├── LICENSE ├── .gitignore ├── README-ja.md └── README.md /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode8 3 | before_install: 4 | - gem install xcpretty 5 | before_script: 6 | - set -o pipefail 7 | script: 8 | - make clean test | xcpretty -c 9 | -------------------------------------------------------------------------------- /SwiftyLayout.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS.xcodeproj/SampleApp-iOS.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /SwiftyLayoutTests/TestHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TestHelper.swift 3 | // SwiftyLayoutTests 4 | // 5 | // Created by fhisa on 2015/09/09. 6 | // Copyright © 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import UIKit 12 | typealias View = UIView 13 | typealias ViewController = UIViewController 14 | typealias LayoutPriority = UILayoutPriority 15 | 16 | #else 17 | 18 | import AppKit 19 | typealias View = NSView 20 | typealias ViewController = NSViewController 21 | typealias LayoutPriority = NSLayoutPriority 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /SwiftyLayout/SwiftyLayout/UILayoutSupport+SwiftyLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILayoutSupport+SwiftyLayout.swift 3 | // SwiftyLayout 4 | // 5 | // Created by fhisa on 2015/09/08. 6 | // Copyright © 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | import UIKit 11 | 12 | public extension UILayoutSupport { 13 | public func layout(attribute: NSLayoutAttribute) -> ConstraintTerm { 14 | return ConstraintTerm(view: self, attribute: attribute) 15 | } 16 | 17 | public subscript(attribute: NSLayoutAttribute) -> ConstraintTerm { 18 | return layout(attribute: attribute) 19 | } 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # CHANGES 2 | 3 | ## 4.0.0 4 | 5 | Update for Swift 3 and Xcode 8. This version isn't available for Swift 2. 6 | 7 | ## 3.0.2 8 | 9 | Support Swift 2.3 & Xcode 8 10 | 11 | ## 3.0.1 12 | 13 | Support Swift 2.2 14 | 15 | ## 3.0.0-alpha.1 16 | 17 | The framework and project was renamed SwiftyLayout (old name was FormulaStyleConstraint) 18 | 19 | ## 2.1.0 20 | 21 | * [NEW] Added division operator "/" 22 | 23 | ## 2.0.1 24 | 25 | * [FIX] Fixed a bug that non-literal value can't use (issue #4) 26 | 27 | ## 2.0 28 | 29 | * [CHANGE] Xcode 7 base project 30 | * [CHANGE] Swift 2.0 base codes 31 | * [NEW] support Mac OS X 32 | * [NEW, iOS] support UILayoutSupport (e.g. topLayoutGuide and bottomLayoutGuide property of UIViewController) 33 | -------------------------------------------------------------------------------- /SwiftyLayout/SwiftyLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyLayout.h 3 | // SwiftyLayout 4 | // 5 | // Created by fhisa on 2015/10/12. 6 | // Copyright (C) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #if TARGET_OS_IPHONE 12 | #import 13 | #else 14 | #import 15 | #endif 16 | 17 | 18 | //! Project version number for SwiftyLayout. 19 | FOUNDATION_EXPORT double SwiftyLayoutVersionNumber; 20 | 21 | //! Project version string for SwiftyLayout. 22 | FOUNDATION_EXPORT const unsigned char SwiftyLayoutVersionString[]; 23 | 24 | // In this header, you should import all the public headers of your framework using statements like #import 25 | 26 | 27 | -------------------------------------------------------------------------------- /SwiftyLayout/SwiftyLayout/ConstraintTerm.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ConstraintTerm.swift 3 | // SwiftyLayout 4 | // 5 | // Created by fhisa on 2015/08/13. 6 | // Copyright (c) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | import UIKit 11 | #else 12 | import AppKit 13 | #endif 14 | 15 | public struct ConstraintTerm 16 | { 17 | let view: AnyObject? 18 | let attribute: NSLayoutAttribute 19 | var multiplier: CGFloat 20 | var constant: CGFloat 21 | 22 | public init( 23 | view v: AnyObject? = nil, 24 | attribute a: NSLayoutAttribute = .notAnAttribute, 25 | multiplier m: CGFloat = 1.0, 26 | constant c: CGFloat = 0.0) 27 | { 28 | view = v 29 | attribute = a 30 | multiplier = m 31 | constant = c 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /SwiftyLayoutTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 4.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | BUILDCOMMAND = xcodebuild 2 | PROJECT = SwiftyLayout.xcodeproj 3 | SCHEME_IOS = SwiftyLayout-iOS 4 | SCHEME_MACOS = SwiftyLayout-Mac 5 | CONFIGURATION = Debug 6 | 7 | clean: 8 | $(BUILDCOMMAND) -project $(PROJECT) -scheme $(SCHEME_IOS) clean 9 | $(BUILDCOMMAND) -project $(PROJECT) -scheme $(SCHEME_MACOS) clean 10 | 11 | test: test_ios test_macos 12 | 13 | test_ios: 14 | $(BUILDCOMMAND) \ 15 | -project $(PROJECT) \ 16 | -scheme $(SCHEME_IOS) \ 17 | -destination 'platform=iOS Simulator,name=iPhone 6s' \ 18 | -configuration $(CONFIGURATION) \ 19 | build \ 20 | test \ 21 | TEST_AFTER_BUILD=YES \ 22 | TEST_HOST= 23 | 24 | test_macos: 25 | $(BUILDCOMMAND) \ 26 | -project $(PROJECT) \ 27 | -scheme $(SCHEME_MACOS) \ 28 | -destination 'platform=macosx' \ 29 | -configuration $(CONFIGURATION) \ 30 | build \ 31 | test \ 32 | TEST_AFTER_BUILD=YES \ 33 | TEST_HOST= 34 | -------------------------------------------------------------------------------- /SwiftyLayout/SwiftyLayout/View+SwiftyLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+SwiftyLayout.swift 3 | // SwiftyLayout 4 | // 5 | // Created by fhisa on 2015/08/13. 6 | // Copyright (c) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | import UIKit 11 | public extension UIView { 12 | 13 | public func layout(attribute: NSLayoutAttribute) -> ConstraintTerm { 14 | return ConstraintTerm(view: self, attribute: attribute) 15 | } 16 | 17 | public subscript(attribute: NSLayoutAttribute) -> ConstraintTerm { 18 | return layout(attribute: attribute) 19 | } 20 | } 21 | 22 | #else 23 | import AppKit 24 | public extension NSView { 25 | 26 | public func layout(attribute: NSLayoutAttribute) -> ConstraintTerm { 27 | return ConstraintTerm(view: self, attribute: attribute) 28 | } 29 | 30 | public subscript(attribute: NSLayoutAttribute) -> ConstraintTerm { 31 | return layout(attribute: attribute) 32 | } 33 | } 34 | #endif 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Hisakuni Fujimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /SwiftyLayout/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 4.0.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright (C) 2015 Hisakuni Fujimoto. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/code,swift 2 | 3 | ### Code ### 4 | # Visual Studio Code - https://code.visualstudio.com/ 5 | .settings/ 6 | 7 | 8 | ### Swift ### 9 | # Xcode 10 | # 11 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 12 | 13 | ## Build generated 14 | build/ 15 | DerivedData 16 | 17 | ## Various settings 18 | *.pbxuser 19 | !default.pbxuser 20 | *.mode1v3 21 | !default.mode1v3 22 | *.mode2v3 23 | !default.mode2v3 24 | *.perspectivev3 25 | !default.perspectivev3 26 | xcuserdata 27 | 28 | ## Other 29 | *.xccheckout 30 | *.moved-aside 31 | *.xcuserstate 32 | *.xcscmblueprint 33 | 34 | ## Obj-C/Swift specific 35 | *.hmap 36 | *.ipa 37 | 38 | # CocoaPods 39 | # 40 | # We recommend against adding the Pods directory to your .gitignore. However 41 | # you should judge for yourself, the pros and cons are mentioned at: 42 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 43 | # 44 | # Pods/ 45 | 46 | # Carthage 47 | # 48 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 49 | # Carthage/Checkouts 50 | 51 | Carthage/Build 52 | 53 | -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | NSHumanReadableCopyright 28 | Copyright © 2015年 Hisakuni Fujimoto. All rights reserved. 29 | NSMainNibFile 30 | MainMenu 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/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 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/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 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/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 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleApp-iOS 4 | // 5 | // Created by fhisa on 2015/10/12. 6 | // Copyright (C) 2015 Hisakuni Fujimoto. 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 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SampleApp-iOS 4 | // 5 | // Created by fhisa on 2015/10/12. 6 | // Copyright (C) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import SwiftyLayout 11 | 12 | class ViewController: UIViewController { 13 | 14 | private var v1: UIView! 15 | private var v2: UIView! 16 | 17 | private var constraints: [NSLayoutConstraint]? 18 | 19 | override func viewDidLoad() { 20 | super.viewDidLoad() 21 | v1 = createSubView(UIColor.greenColor()) 22 | v2 = createSubView(UIColor.cyanColor()) 23 | if view.bounds.size.height > view.bounds.size.width { 24 | setupPortrait() 25 | } 26 | else { 27 | setupLandscape() 28 | } 29 | } 30 | 31 | override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { 32 | super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator) 33 | if size.height > size.width { 34 | setupPortrait() 35 | } 36 | else { 37 | setupLandscape() 38 | } 39 | } 40 | 41 | private func createSubView(color: UIColor) -> UIView { 42 | let v = UIView() 43 | view.addSubview(v) 44 | v.translatesAutoresizingMaskIntoConstraints = false 45 | v.backgroundColor = color 46 | let size = min(view.bounds.size.width, view.bounds.size.height) / 3.0 47 | v.addConstraint(v[.Width] == size) 48 | v.addConstraint(v[.Height] == size) 49 | return v 50 | } 51 | 52 | private func setupPortrait() { 53 | if let cs = constraints { view.removeConstraints(cs) } 54 | let cs: [NSLayoutConstraint] = [ 55 | v1[.CenterX] == view[.CenterX], 56 | v2[.CenterX] == view[.CenterX], 57 | v1[.CenterY] == view[.CenterY] * (1.0 / 2.0), 58 | v2[.CenterY] == view[.CenterY] * (3.0 / 2.0), 59 | ] 60 | constraints = cs 61 | view.addConstraints(constraints!) 62 | } 63 | 64 | private func setupLandscape() { 65 | if let cs = constraints { view.removeConstraints(cs) } 66 | let cs: [NSLayoutConstraint] = [ 67 | v1[.CenterY] == view[.CenterY], 68 | v2[.CenterY] == view[.CenterY], 69 | v1[.CenterX] == view[.CenterX] * (1.0 / 2.0), 70 | v2[.CenterX] == view[.CenterX] * (3.0 / 2.0), 71 | ] 72 | constraints = cs 73 | view.addConstraints(constraints!) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SampleApp-Mac 4 | // 5 | // Created by fhisa on 2015/10/12. 6 | // Copyright (C) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import SwiftyLayout 11 | 12 | class SampleView: NSView { 13 | var backgroundColor: NSColor = NSColor.grayColor() 14 | 15 | override func drawRect(dirtyRect: NSRect) { 16 | super.drawRect(dirtyRect) 17 | let path = NSBezierPath(rect: dirtyRect) 18 | backgroundColor.set() 19 | path.fill() 20 | } 21 | } 22 | 23 | @NSApplicationMain 24 | class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate { 25 | 26 | @IBOutlet weak var window: NSWindow! 27 | 28 | 29 | func applicationDidFinishLaunching(aNotification: NSNotification) { 30 | window.delegate = self 31 | v1 = createSubView(NSColor.greenColor()) 32 | v2 = createSubView(NSColor.cyanColor()) 33 | setupLayout() 34 | } 35 | 36 | func applicationWillTerminate(aNotification: NSNotification) { 37 | // Insert code here to tear down your application 38 | } 39 | 40 | func windowDidResize(notification: NSNotification) { 41 | setupLayout() 42 | } 43 | 44 | private func setupLayout() { 45 | if window.frame.size.height > window.frame.size.width { 46 | setupPortrait() 47 | } 48 | else { 49 | setupLandscape() 50 | } 51 | } 52 | 53 | private var v1: SampleView! 54 | private var v2: SampleView! 55 | 56 | private var constraints: [NSLayoutConstraint]? 57 | 58 | private func createSubView(color: NSColor) -> SampleView { 59 | let v = SampleView() 60 | if let view = window.contentView { 61 | view.addSubview(v) 62 | v.translatesAutoresizingMaskIntoConstraints = false 63 | v.backgroundColor = color 64 | let size = min(view.bounds.size.width, view.bounds.size.height) / 3.0 65 | v.addConstraint(v[.Width] == size) 66 | v.addConstraint(v[.Height] == size) 67 | } 68 | return v 69 | } 70 | 71 | private func setupPortrait() { 72 | if let view = window.contentView { 73 | if let cs = constraints { view.removeConstraints(cs) } 74 | let cs: [NSLayoutConstraint] = [ 75 | v1[.CenterX] == view[.CenterX], 76 | v2[.CenterX] == view[.CenterX], 77 | v1[.CenterY] == view[.CenterY] * (1.0 / 2.0), 78 | v2[.CenterY] == view[.CenterY] * (3.0 / 2.0), 79 | ] 80 | constraints = cs 81 | view.addConstraints(constraints!) 82 | } 83 | } 84 | 85 | private func setupLandscape() { 86 | if let view = window.contentView { 87 | if let cs = constraints { view.removeConstraints(cs) } 88 | let cs: [NSLayoutConstraint] = [ 89 | v1[.CenterY] == view[.CenterY], 90 | v2[.CenterY] == view[.CenterY], 91 | v1[.CenterX] == view[.CenterX] * (1.0 / 2.0), 92 | v2[.CenterX] == view[.CenterX] * (3.0 / 2.0), 93 | ] 94 | constraints = cs 95 | view.addConstraints(constraints!) 96 | } 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /SwiftyLayout.xcodeproj/xcshareddata/xcschemes/SwiftyLayout-Mac.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /SwiftyLayout.xcodeproj/xcshareddata/xcschemes/SwiftyLayout-iOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /README-ja.md: -------------------------------------------------------------------------------- 1 | # SwiftyLayout 2 | 3 | [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/fhisa/SwiftyLayout/master/LICENSE) 4 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 5 | [![GitHub release](https://img.shields.io/github/release/fhisa/SwiftyLayout.svg)](https://github.com/fhisa/SwiftyLayout/releases) 6 | [![build passing](https://travis-ci.org/fhisa/SwiftyLayout.png?branch=master)](https://travis-ci.org/fhisa/SwiftyLayout) 7 | 8 | [![Join the chat at https://gitter.im/fhisa/SwiftyLayout](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fhisa/SwiftyLayout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 | SwiftyLayout は、Swiftプログラムにおいて、レイアウト制約(NSLayoutConstraint)を簡単な数式として定義できるようにするフレームワークです。 11 | 12 | ## バージョンについて 13 | 14 | - SwiftyLayout 3 は Swift 2 用です。 15 | - SwiftyLayout 4 は Swift 3 用です。 16 | 17 | 18 | ## コード例 19 | 20 | ### 基本的な使い方 21 | 「ビューAの横幅はビューBの横幅の50%から4.0引いたものと等しい」というレイアウト制約は、SwiftyLayoutフレームワークを使って: 22 | ```swift 23 | viewA[.Width] == 0.5 * viewB[.Width] - 4.0 24 | ``` 25 | のように記述できます。これは以下のコードと同じレイアウト制約を生成します: 26 | ```swift 27 | NSLayoutConstraint( 28 | item: viewA, attribute: .Width, 29 | relatedBy: .Equal, 30 | toItem: viewB, attribute: .Width, 31 | multiplier: 0.5, constant: -4.0) 32 | ``` 33 | 34 | ### 例)アスペクト比 35 | また「ビューAのサイズの縦横比は 3:4 に等しい」という制約は: 36 | ```swift 37 | viewA[.Width] * 3.0 == viewA[.Height] * 4.0 38 | ``` 39 | のように記述できます。これは以下のコードと同じレイアウト制約を生成します: 40 | ```swift 41 | NSLayoutConstraint( 42 | item: viewA, attribute: .Width, 43 | relatedBy: .Equal, 44 | toItem: viewA, attribute: .Height, 45 | multiplier: 4.0/3.0, constant: 0.0) 46 | ``` 47 | 48 | ### 例)優先順位の指定 49 | 50 | 二項演算子`~`を使ってレイアウト制約の優先順位を指定することができます: 51 | ```swift 52 | innerView[.Leading] == outerView[.Leading] + 4.0 ~ 750.0 53 | ``` 54 | この演算子は、レイアウト制約の優先順位を設定した上でそのレイアウト制約を返します: 55 | ```swift 56 | var constraint = NSLayoutConstraint( 57 | item: innerView, attribute: .Leading, 58 | relatedBy: .Equal, 59 | toItem: outerView, attribute: .Leading, 60 | multiplier: 1.0, constant: 4.0) 61 | constraint.priority = 750.0 62 | // -> constraint 63 | ``` 64 | 65 | [サンプルアプリ](https://github.com/fhisa/SwiftyLayout/blob/master/SampleApp/ViewController.swift)や[テストケース](https://github.com/fhisa/SwiftyLayout/blob/master/SwiftyLayoutTests/SwiftyLayoutTests.swift)のコードも参考にしてください。 66 | 67 | ## リファレンスガイド 68 | 69 | ### 制約項 (ConstraintTerm) 70 | 71 | 制約項(ConstraintTerm)とは、レイアウト制約の右辺または左辺で、ビューを含む項のことです。 72 | あるビュー`viewA`の横幅`.Width`を表す制約項は: 73 | ```swift 74 | viewA[.Width] 75 | ``` 76 | と記述します。`viewA`のところにはUIViewオブジェクトが、`.Width`のところには`NSLayoutAttribute`型の値が入ります。 77 | 制約項は、以下のような構造体として定義されています: 78 | ```swift 79 | public struct ConstraintTerm 80 | { 81 | let view: UIView? 82 | let attribute: NSLayoutAttribute 83 | var multiplier: CGFloat = 1.0 84 | var constant: CGFloat = 0.0 85 | } 86 | ``` 87 | 88 | ### 演算子 89 | 90 | *以下の表で「制約項」は`ConstraintTerm`型の値、「定数」は`CGFloat`型の値、「レイアウト制約」は`NSLayoutConstraint`オブジェクトを表します。* 91 | 92 | | 演算子 | 左辺 | 右辺 | 評価値 | 意味 | 93 | |:-----:|:------|:------|:-------|:--| 94 | | + | 制約項 | 定数 | 制約項 | 左辺の`constant`に右辺の値を加算 | 95 | | + | 定数 | 制約項 | 制約項 | 右辺の`constant`に左辺の値を加算 | 96 | | - | 制約項 | 定数 | 制約項 | 左辺の`constant`から右辺の値を減算 | 97 | | * | 制約項 | 定数 | 制約項 | 左辺の`multiplier`と`constant`に右辺の値を乗算 | 98 | | * | 定数 | 制約項 | 制約項 | 右辺の`multiplier`と`constant`に左辺の値を乗算 | 99 | | / | 制約項 | 定数 | 制約項 | 左辺の`multiplier`と`constant`を右辺の値で除算 | 100 | | == | 制約項 | 制約項 | レイアウト制約 | 「左辺と右辺の値が等しい」というレイアウト制約を生成 | 101 | | == | 制約項 | 定数 | レイアウト制約 | 同上 | 102 | | == | 定数 | 制約項 | レイアウト制約 | 同上 | 103 | | <= | 制約項 | 制約項 | レイアウト制約 | 「左辺の値は右辺の値より小さいか等しい」というレイアウト制約を生成 | 104 | | <= | 制約項 | 定数 | レイアウト制約 | 同上 | 105 | | <= | 定数 | 制約項 | レイアウト制約 | 同上 | 106 | | >= | 制約項 | 制約項 | レイアウト制約 | 「左辺の値は右辺の値より大きいか等しい」というレイアウト制約を生成 | 107 | | >= | 制約項 | 定数 | レイアウト制約 | 同上 | 108 | | >= | 定数 | 制約項 | レイアウト制約 | 同上 | 109 | | ~ | レイアウト制約 | 定数(Float型) | レイアウト制約 | レイアウト制約の優先度を変更して、そのレイアウト制約を返す | 110 | 111 | ## Requirements 112 | 113 | - Swift 2.0 (Xcode 7 以降) 114 | - iOS 8 以降 / iOS 7 (ソースコードを直接コピー) 115 | - iOS 116 | - iOS 8 以降 / iOS 7 (ソースコードを直接コピー) 117 | - Mac 118 | - Mac OS X 10.10 以降 / 10.9 以前での動作は不明 119 | 120 | ## インストール 121 | 122 | 2種類の方法があります。 123 | 124 | ### Carthage を使ってインストール 125 | 126 | SwiftyLayout は [Carthage](https://github.com/Carthage/Carthage) を使うと簡単にプロジェクトに追加できます。 127 | 128 | - Cartfile に `github "fhisa/SwiftyLayout"` の1行を追加 129 | - `carthage update` を実行 130 | - Carthage/Build の中にできたフレームワークをプロジェクトに追加 131 | 132 | ### ソースファイルを直接コピー (iOS 7) 133 | 134 | - Add this repository as a git submodule: 135 | ```shell 136 | $ git submodule add https://github.com/fhisa/SwiftyLayout.git PATH_TO_SUBMODULE 137 | // or 138 | $ carthage update --use-submodules 139 | ``` 140 | - Then just add references of SwiftyLayout/*.swift to your Xcode project. 141 | 142 | ## TODO 143 | 144 | - [CocoaPods](https://cocoapods.org) 対応 145 | 146 | ## ライセンス 147 | 148 | SwiftyLayout は [MIT license](https://github.com/fhisa/SwiftyLayout/blob/master/LICENSE) の元で配布しています。 149 | -------------------------------------------------------------------------------- /SwiftyLayoutTests/OperatorsWithUILayoutSupportTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperatorsWithUILayoutSupportTests.swift 3 | // SwiftyLayoutTests 4 | // 5 | // Created by fhisa on 2015/09/08. 6 | // Copyright (C) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | import XCTest 12 | import SwiftyLayout 13 | 14 | class OperatorsWithUILayoutSupportTests: XCTestCase { 15 | 16 | var view1: View! 17 | var view2: View! 18 | var vc: ViewController! 19 | var x: NSLayoutConstraint! 20 | 21 | override func setUp() { 22 | super.setUp() 23 | x = nil 24 | view1 = View() 25 | view2 = View() 26 | vc = ViewController() 27 | vc.view = View() 28 | view1.translatesAutoresizingMaskIntoConstraints = false 29 | view2.translatesAutoresizingMaskIntoConstraints = false 30 | } 31 | 32 | override func tearDown() { 33 | super.tearDown() 34 | } 35 | 36 | func test_priority_operator() { 37 | x = vc.topLayoutGuide[.width] == view2[.width] 38 | XCTAssertEqual(x.priority, UILayoutPriority(1000)) 39 | x = (vc.bottomLayoutGuide[.width] == view2[.width]) ~ 750 40 | XCTAssertEqual(x.priority, UILayoutPriority(750)) 41 | x = (view1[.width] == vc.topLayoutGuide[.width]) ~ 750.0 42 | XCTAssertEqual(x.priority, UILayoutPriority(750)) 43 | x = (view1[.width] == vc.bottomLayoutGuide[.width]) ~ 750.0 44 | XCTAssertEqual(x.priority, UILayoutPriority(750)) 45 | } 46 | 47 | func test_operator_term_add_constant() { 48 | x = vc.topLayoutGuide[.width] == view2[.width] + 20 49 | XCTAssertEqual(x.constant, CGFloat(20)) 50 | x = vc.bottomLayoutGuide[.width] == view2[.width] + 20.0 51 | XCTAssertEqual(x.constant, CGFloat(20)) 52 | x = view1[.width] == vc.topLayoutGuide[.width] + 10 + 20 53 | XCTAssertEqual(x.constant, CGFloat(30)) 54 | x = view1[.width] == vc.bottomLayoutGuide[.width] + 10.0 + 20 55 | XCTAssertEqual(x.constant, CGFloat(30)) 56 | } 57 | 58 | func test_operator_constant_add_term() { 59 | x = vc.topLayoutGuide[.width] == 20 + view2[.width] 60 | XCTAssertEqual(x.constant, CGFloat(20)) 61 | x = vc.bottomLayoutGuide[.width] == 20.0 + view2[.width] 62 | XCTAssertEqual(x.constant, CGFloat(20)) 63 | x = view1[.width] == 10 + 20 + vc.topLayoutGuide[.width] 64 | XCTAssertEqual(x.constant, CGFloat(30)) 65 | x = view1[.width] == 10.0 + 20 + vc.bottomLayoutGuide[.width] 66 | XCTAssertEqual(x.constant, CGFloat(30)) 67 | } 68 | 69 | func test_operator_term_multiply_constant() { 70 | x = vc.topLayoutGuide[.width] == view2[.width] * 2 71 | XCTAssertEqual(x.multiplier, CGFloat(2)) 72 | x = view1[.width] == vc.bottomLayoutGuide[.width] * 2.0 73 | XCTAssertEqual(x.multiplier, CGFloat(2)) 74 | } 75 | 76 | func test_operator_constant_multiply_term() { 77 | x = vc.topLayoutGuide[.width] == 2 * view2[.width] 78 | XCTAssertEqual(x.multiplier, CGFloat(2)) 79 | x = view1[.width] == 2.0 * vc.bottomLayoutGuide[.width] 80 | XCTAssertEqual(x.multiplier, CGFloat(2)) 81 | } 82 | 83 | func test_operator_multiply_for_ratio() { 84 | x = vc.topLayoutGuide[.height] * 4 == view1[.width] * 3 85 | XCTAssertEqual(x.multiplier, CGFloat(3.0 / 4.0)) 86 | x = view1[.height] * 16.0 == vc.bottomLayoutGuide[.width] * 9.0 87 | XCTAssertEqual(x.multiplier, CGFloat(9.0 / 16.0)) 88 | } 89 | 90 | func test_operator_term_subtract_constant() { 91 | x = vc.topLayoutGuide[.width] == view2[.width] - 2 92 | XCTAssertEqual(x.constant, CGFloat(-2)) 93 | x = view1[.width] == vc.bottomLayoutGuide[.width] - 2.0 94 | XCTAssertEqual(x.constant, CGFloat(-2.0)) 95 | } 96 | 97 | func test_operator_term_divde_constant() { 98 | x = vc.topLayoutGuide[.width] == view2[.width] / 2 99 | XCTAssertEqual(x.multiplier, CGFloat(0.5)) 100 | x = view1[.width] == vc.bottomLayoutGuide[.width] / 2.0 101 | XCTAssertEqual(x.multiplier, CGFloat(0.5)) 102 | } 103 | 104 | func test_operator_term_equal_term() { 105 | x = view1[.width] == 12 * vc.topLayoutGuide[.width] + 34 106 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 107 | XCTAssertTrue(view1.isEqual(x.firstItem)) 108 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 109 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 110 | XCTAssertTrue(vc.topLayoutGuide.isEqual(x.secondItem)) 111 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 112 | XCTAssertEqual(x.multiplier, CGFloat(12)) 113 | XCTAssertEqual(x.constant, CGFloat(34)) 114 | } 115 | 116 | func test_operator_term_less_than_or_equal_term() { 117 | x = view1[.width] <= 12 * vc.topLayoutGuide[.width] + 34 118 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 119 | XCTAssertTrue(view1.isEqual(x.firstItem)) 120 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 121 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 122 | XCTAssertTrue(vc.topLayoutGuide.isEqual(x.secondItem)) 123 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 124 | XCTAssertEqual(x.multiplier, CGFloat(12)) 125 | XCTAssertEqual(x.constant, CGFloat(34)) 126 | } 127 | 128 | func test_operator_term_greater_than_or_equal_term() { 129 | x = view1[.width] >= 12 * vc.bottomLayoutGuide[.width] + 34 130 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 131 | XCTAssertTrue(view1.isEqual(x.firstItem)) 132 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 133 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 134 | XCTAssertTrue(vc.bottomLayoutGuide.isEqual(x.secondItem)) 135 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 136 | XCTAssertEqual(x.multiplier, CGFloat(12)) 137 | XCTAssertEqual(x.constant, CGFloat(34)) 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftyLayout 2 | 3 | [![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://raw.githubusercontent.com/fhisa/SwiftyLayout/master/LICENSE) 4 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 5 | [![GitHub release](https://img.shields.io/github/release/fhisa/SwiftyLayout.svg)](https://github.com/fhisa/SwiftyLayout/releases) 6 | [![build passing](https://travis-ci.org/fhisa/SwiftyLayout.png?branch=master)](https://travis-ci.org/fhisa/SwiftyLayout) 7 | 8 | [![Join the chat at https://gitter.im/fhisa/SwiftyLayout](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/fhisa/SwiftyLayout?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 9 | 10 | SwiftyLayout is a framework that allows to describe layout constraints (ie NSLayoutConstraint) as a simple mathematical formula in a Swift program. 11 | 12 | ## About Version 13 | 14 | - SwiftyLayout 3 for Swift 2 15 | - SwiftyLayout 4 for Swift 3 16 | 17 | ## Code Examples 18 | 19 | ### Basic usage 20 | 21 | Using the framework, a layout constraint that "the width of the view A is equal to minus 4.0 to 50% of the width of the Views B" follows: 22 | ```swift 23 | viewA[.Width] == 0.5 * viewB[.Width] - 4.0 24 | ``` 25 | This is the same layout constraints with the following code: 26 | ```swift 27 | NSLayoutConstraint( 28 | item: viewA, attribute: .Width, 29 | relatedBy: .Equal, 30 | toItem: viewB, attribute: .Width, 31 | multiplier: 0.5, constant: -4.0) 32 | ``` 33 | 34 | ### e.g. Aspect ratio 35 | 36 | A layout constraint that "the aspect ratio of the view A is 3:4" follows: 37 | ```swift 38 | viewA[.Width] * 3.0 == viewA[.Height] * 4.0 39 | ``` 40 | This is the same layout constraints with the following code: 41 | ```swift 42 | NSLayoutConstraint( 43 | item: viewA, attribute: .Width, 44 | relatedBy: .Equal, 45 | toItem: viewA, attribute: .Height, 46 | multiplier: 4.0/3.0, constant: 0.0) 47 | ``` 48 | 49 | ### e.g. Specify the priority 50 | 51 | The framework has priority specification operator `~` like the following. 52 | ```swift 53 | innerView[.Leading] == outerView[.Leading] + 4.0 ~ 750.0 54 | ``` 55 | This is the same layout constraints with the following code: 56 | ```swift 57 | var constraint = NSLayoutConstraint( 58 | item: innerView, attribute: .Leading, 59 | relatedBy: .Equal, 60 | toItem: outerView, attribute: .Leading, 61 | multiplier: 1.0, constant: 4.0) 62 | constraint.priority = 750.0 63 | // -> constraint 64 | ``` 65 | 66 | Please refer to the code for the [sample application](https://github.com/fhisa/SwiftyLayout/blob/master/SampleApp/ViewController.swift) and [test case](https://github.com/fhisa/SwiftyLayout/blob/master/SwiftyLayoutTests/SwiftyLayoutTests.swift), too. 67 | 68 | ## Refrence Guide 69 | 70 | ### ConstraintTerm 71 | 72 | ConstraintTerm means a term that contains a view in the right side or the left side of a layout constraint. 73 | For example, a ConstraintTerm representing the width `.Width` of view `viewA`: 74 | ```swift 75 | viewA[.Width] 76 | ``` 77 | `viewA` is a UIView instance object, `.Width` is a `NSLayoutAttribute` value. 78 | ConstraintTerm is defined as a structure such as the following: 79 | ```swift 80 | public struct ConstraintTerm 81 | { 82 | let view: UIView? 83 | let attribute: NSLayoutAttribute 84 | var multiplier: CGFloat = 1.0 85 | var constant: CGFloat = 0.0 86 | } 87 | ``` 88 | 89 | ### Operators 90 | 91 | *The following table, CONSTANT means CGFloat value* 92 | 93 | | operator | lhs | rhs | value | semantics | 94 | |:-----:|:---------------|:---------------|:---------------|:--| 95 | | + | ConstraintTerm | CONSTANT | ConstraintTerm | add rhs value to lhs.constant | 96 | | + | CONSTANT | ConstraintTerm | ConstraintTerm | add lhs value to rhs.constant | 97 | | - | ConstraintTerm | CONSTANT | ConstraintTerm | subtract rhs value from lhs.constant | 98 | | * | ConstraintTerm | CONSTANT | ConstraintTerm | multiply rhs value to lhs.multiplier and lhs.constant | 99 | | * | CONSTANT | ConstraintTerm | ConstraintTerm | multiply lhs value to rhs.multiplier and rhs.constant | 100 | | / | ConstraintTerm | CONSTANT | ConstraintTerm | divide lhs.multiplier and lhs.constant by rhs value | 101 | | == | ConstraintTerm | ConstraintTerm | NSLayoutConstraint | create a layout constraint that "lhs is equal to lhs" | 102 | | == | ConstraintTerm | CONSTANT | NSLayoutConstraint | ditto | 103 | | == | CONSTANT | ConstraintTerm | NSLayoutConstraint | ditto | 104 | | <= | ConstraintTerm | ConstraintTerm | NSLayoutConstraint | create a layout constraint that "lhs is less than or equal to lhs" | 105 | | <= | ConstraintTerm | CONSTANT | NSLayoutConstraint | ditto | 106 | | <= | CONSTANT | ConstraintTerm | NSLayoutConstraint | ditto | 107 | | >= | ConstraintTerm | ConstraintTerm | NSLayoutConstraint | create a layout constraint that "lhs is greater than or equal to lhs" | 108 | | >= | ConstraintTerm | CONSTANT | NSLayoutConstraint | ditto | 109 | | >= | CONSTANT | ConstraintTerm | NSLayoutConstraint | ditto | 110 | | ~ | NSLayoutConstraint | CONSTANT(Float) | NSLayoutConstraint | Change the priority of a layout constraint, and return the constraint | 111 | 112 | ## Requirements 113 | 114 | - Swift 2.0 (Xcode 7 or later) 115 | - iOS 116 | - iOS 8 or later / iOS 7 (by coping the source files directly) 117 | - Mac 118 | - Mac OS X 10.10 or later 119 | 120 | ## Installation 121 | 122 | There are two options. 123 | 124 | ### Using Carthage 125 | 126 | Using [Carthage](https://github.com/Carthage/Carthage), it's easy to add SwiftyLayout to the project. 127 | 128 | - Add `github "fhisa/SwiftyLayout"` to your Cartfile. 129 | - Run `carthage update` 130 | - Add SwiftyLayout.framework in Carthage/Build/iOS to your Xcode project. 131 | 132 | ### Copying source files directly (iOS 7) 133 | 134 | - Add this repository as a git submodule: 135 | ```shell 136 | $ git submodule add https://github.com/fhisa/SwiftyLayout.git PATH_TO_SUBMODULE 137 | // or 138 | $ carthage update --use-submodules 139 | ``` 140 | - Then just add references of SwiftyLayout/*.swift to your Xcode project. 141 | 142 | ## TODO 143 | 144 | - [CocoaPods](https://cocoapods.org) support 145 | 146 | ## license 147 | 148 | SwiftyLayout is released under the [MIT license](https://github.com/fhisa/SwiftyLayout/blob/master/LICENSE). 149 | -------------------------------------------------------------------------------- /SwiftyLayout/SwiftyLayout/Operators.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.swift 3 | // SwiftyLayout 4 | // 5 | // Created by fhisa on 2015/09/02. 6 | // Copyright (c) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | 11 | import UIKit 12 | public typealias LayoutPriority = UILayoutPriority 13 | 14 | #else 15 | 16 | import AppKit 17 | public typealias LayoutPriority = NSLayoutPriority 18 | 19 | #endif 20 | 21 | precedencegroup LayoutPriorityPrecedence { 22 | associativity: right 23 | higherThan: AssignmentPrecedence 24 | } 25 | infix operator ~ : LayoutPriorityPrecedence 26 | 27 | 28 | public func ~ (lhs: NSLayoutConstraint, rhs: LayoutPriority) -> NSLayoutConstraint { 29 | lhs.priority = rhs 30 | return lhs 31 | } 32 | 33 | public func ~ (lhs: NSLayoutConstraint, rhs: Int) -> NSLayoutConstraint { 34 | return lhs ~ LayoutPriority(rhs) 35 | } 36 | 37 | public func ~ (lhs: NSLayoutConstraint, rhs: Double) -> NSLayoutConstraint { 38 | return lhs ~ LayoutPriority(rhs) 39 | } 40 | 41 | // MARK: - x + c 42 | public func +(lhs: ConstraintTerm, rhs: CGFloat) -> ConstraintTerm { 43 | var lhs = lhs 44 | lhs.constant += rhs 45 | return lhs 46 | } 47 | 48 | public func +(lhs: ConstraintTerm, rhs: Int) -> ConstraintTerm { 49 | return lhs + CGFloat(rhs) 50 | } 51 | 52 | public func +(lhs: ConstraintTerm, rhs: Double) -> ConstraintTerm { 53 | return lhs + CGFloat(rhs) 54 | } 55 | 56 | // MARK: - c + x 57 | public func +(lhs: CGFloat, rhs: ConstraintTerm) -> ConstraintTerm { 58 | return rhs + lhs 59 | } 60 | 61 | public func +(lhs: Int, rhs: ConstraintTerm) -> ConstraintTerm { 62 | return CGFloat(lhs) + rhs 63 | } 64 | 65 | public func +(lhs: Double, rhs: ConstraintTerm) -> ConstraintTerm { 66 | return CGFloat(lhs) + rhs 67 | } 68 | 69 | // MARK: - x * c 70 | public func * (lhs: ConstraintTerm, rhs: CGFloat) -> ConstraintTerm { 71 | var lhs = lhs 72 | lhs.multiplier *= rhs 73 | lhs.constant *= rhs 74 | return lhs 75 | } 76 | 77 | public func * (lhs: ConstraintTerm, rhs: Int) -> ConstraintTerm { 78 | return lhs * CGFloat(rhs) 79 | } 80 | 81 | public func * (lhs: ConstraintTerm, rhs: Double) -> ConstraintTerm { 82 | return lhs * CGFloat(rhs) 83 | } 84 | 85 | // MARK: - c * x 86 | public func * (lhs: CGFloat, rhs: ConstraintTerm) -> ConstraintTerm { 87 | return rhs * lhs 88 | } 89 | 90 | public func * (lhs: Int, rhs: ConstraintTerm) -> ConstraintTerm { 91 | return CGFloat(lhs) * rhs 92 | } 93 | 94 | public func * (lhs: Double, rhs: ConstraintTerm) -> ConstraintTerm { 95 | return CGFloat(lhs) * rhs 96 | } 97 | 98 | // MARK: - x - c 99 | public func - (lhs: ConstraintTerm, rhs: CGFloat) -> ConstraintTerm { 100 | var lhs = lhs 101 | lhs.constant -= rhs 102 | return lhs 103 | } 104 | 105 | public func - (lhs: ConstraintTerm, rhs: Int) -> ConstraintTerm { 106 | return lhs - CGFloat(rhs) 107 | } 108 | 109 | public func - (lhs: ConstraintTerm, rhs: Double) -> ConstraintTerm { 110 | return lhs - CGFloat(rhs) 111 | } 112 | 113 | // MARK: - x / c 114 | public func / (lhs: ConstraintTerm, rhs: CGFloat) -> ConstraintTerm { 115 | var lhs = lhs 116 | lhs.multiplier /= rhs 117 | lhs.constant /= rhs 118 | return lhs 119 | } 120 | 121 | public func / (lhs: ConstraintTerm, rhs: Int) -> ConstraintTerm { 122 | return lhs / CGFloat(rhs) 123 | } 124 | 125 | public func / (lhs: ConstraintTerm, rhs: Double) -> ConstraintTerm { 126 | return lhs / CGFloat(rhs) 127 | } 128 | 129 | // MARK: - x == y 130 | public func == (lhs: ConstraintTerm, rhs: ConstraintTerm) -> NSLayoutConstraint { 131 | return createLayoutConstraint(lhs: lhs, relatedBy: .equal, rhs: rhs) 132 | } 133 | 134 | // MARK: - x == c 135 | public func == (lhs: ConstraintTerm, rhs: CGFloat) -> NSLayoutConstraint { 136 | return createLayoutConstraint(lhs: lhs, relatedBy: .equal, rhs: rhs) 137 | } 138 | 139 | public func == (lhs: ConstraintTerm, rhs: Int) -> NSLayoutConstraint { 140 | return lhs == CGFloat(rhs) 141 | } 142 | 143 | public func == (lhs: ConstraintTerm, rhs: Double) -> NSLayoutConstraint { 144 | return lhs == CGFloat(rhs) 145 | } 146 | 147 | // MARK: - c == x 148 | public func == (lhs: CGFloat, rhs: ConstraintTerm) -> NSLayoutConstraint { 149 | return rhs == lhs 150 | } 151 | 152 | public func == (lhs: Int, rhs: ConstraintTerm) -> NSLayoutConstraint { 153 | return CGFloat(lhs) == rhs 154 | } 155 | 156 | public func == (lhs: Double, rhs: ConstraintTerm) -> NSLayoutConstraint { 157 | return CGFloat(lhs) == rhs 158 | } 159 | 160 | // MARK: - x <= y 161 | public func <= (lhs: ConstraintTerm, rhs: ConstraintTerm) -> NSLayoutConstraint { 162 | return createLayoutConstraint(lhs: lhs, relatedBy: .lessThanOrEqual, rhs: rhs) 163 | } 164 | 165 | // MARK: - x <= c 166 | public func <= (lhs: ConstraintTerm, rhs: CGFloat) -> NSLayoutConstraint { 167 | return createLayoutConstraint(lhs: lhs, relatedBy: .lessThanOrEqual, rhs: rhs) 168 | } 169 | 170 | public func <= (lhs: ConstraintTerm, rhs: Int) -> NSLayoutConstraint { 171 | return lhs <= CGFloat(rhs) 172 | } 173 | 174 | public func <= (lhs: ConstraintTerm, rhs: Double) -> NSLayoutConstraint { 175 | return lhs <= CGFloat(rhs) 176 | } 177 | 178 | // MARK: - c <= x 179 | public func <= (lhs: CGFloat, rhs: ConstraintTerm) -> NSLayoutConstraint { 180 | return rhs >= lhs 181 | } 182 | 183 | public func <= (lhs: Int, rhs: ConstraintTerm) -> NSLayoutConstraint { 184 | return CGFloat(lhs) <= rhs 185 | } 186 | 187 | public func <= (lhs: Double, rhs: ConstraintTerm) -> NSLayoutConstraint { 188 | return CGFloat(lhs) <= rhs 189 | } 190 | 191 | // MARK: - x >= y 192 | public func >= (lhs: ConstraintTerm, rhs: ConstraintTerm) -> NSLayoutConstraint { 193 | return createLayoutConstraint(lhs: lhs, relatedBy: .greaterThanOrEqual, rhs: rhs) 194 | } 195 | 196 | // MARK: - x >= c 197 | public func >= (lhs: ConstraintTerm, rhs: CGFloat) -> NSLayoutConstraint { 198 | return createLayoutConstraint(lhs: lhs, relatedBy: .greaterThanOrEqual, rhs: rhs) 199 | } 200 | 201 | public func >= (lhs: ConstraintTerm, rhs: Int) -> NSLayoutConstraint { 202 | return lhs >= CGFloat(rhs) 203 | } 204 | 205 | public func >= (lhs: ConstraintTerm, rhs: Double) -> NSLayoutConstraint { 206 | return lhs >= CGFloat(rhs) 207 | } 208 | 209 | // MARK: - c >= x 210 | public func >= (lhs: CGFloat, rhs: ConstraintTerm) -> NSLayoutConstraint { 211 | return rhs <= lhs 212 | } 213 | 214 | public func >= (lhs: Int, rhs: ConstraintTerm) -> NSLayoutConstraint { 215 | return CGFloat(lhs) >= rhs 216 | } 217 | 218 | public func >= (lhs: Double, rhs: ConstraintTerm) -> NSLayoutConstraint { 219 | return CGFloat(lhs) >= rhs 220 | } 221 | 222 | // MARK: - private function 223 | 224 | private func createLayoutConstraint(lhs: ConstraintTerm, relatedBy: NSLayoutRelation, rhs: ConstraintTerm) -> NSLayoutConstraint { 225 | let multiplier = rhs.multiplier / lhs.multiplier 226 | let constant = (rhs.constant - lhs.constant) / lhs.multiplier 227 | let constraint = NSLayoutConstraint( 228 | item: lhs.view!, attribute: lhs.attribute, 229 | relatedBy: relatedBy, 230 | toItem: rhs.view, attribute: rhs.attribute, 231 | multiplier: multiplier, constant: constant) 232 | return constraint 233 | } 234 | 235 | private func createLayoutConstraint(lhs: ConstraintTerm, relatedBy: NSLayoutRelation, rhs: CGFloat) -> NSLayoutConstraint { 236 | let constant = (rhs - lhs.constant) / lhs.multiplier 237 | let constraint = NSLayoutConstraint( 238 | item: lhs.view!, attribute: lhs.attribute, 239 | relatedBy: relatedBy, 240 | toItem: nil, attribute: .notAnAttribute, 241 | multiplier: 1.0, constant: constant) 242 | return constraint 243 | } 244 | -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CC885DE21BCB3CEE001B771F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885DE11BCB3CEE001B771F /* AppDelegate.swift */; }; 11 | CC885DE41BCB3CEE001B771F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CC885DE31BCB3CEE001B771F /* Assets.xcassets */; }; 12 | CC885DE71BCB3CEE001B771F /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = CC885DE51BCB3CEE001B771F /* MainMenu.xib */; }; 13 | CC885DFD1BCB3D13001B771F /* SwiftyLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC885DFA1BCB3D07001B771F /* SwiftyLayout.framework */; }; 14 | CC885DFE1BCB3D13001B771F /* SwiftyLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CC885DFA1BCB3D07001B771F /* SwiftyLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | CC885DF51BCB3D07001B771F /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 21 | proxyType = 2; 22 | remoteGlobalIDString = CC885D551BCB2AA8001B771F; 23 | remoteInfo = "SwiftyLayout-iOS"; 24 | }; 25 | CC885DF71BCB3D07001B771F /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 28 | proxyType = 2; 29 | remoteGlobalIDString = CC885D5F1BCB2AA8001B771F; 30 | remoteInfo = "SwiftyLayoutTests-iOS"; 31 | }; 32 | CC885DF91BCB3D07001B771F /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 35 | proxyType = 2; 36 | remoteGlobalIDString = CC885D741BCB2C69001B771F; 37 | remoteInfo = "SwiftyLayout-Mac"; 38 | }; 39 | CC885DFB1BCB3D07001B771F /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 42 | proxyType = 2; 43 | remoteGlobalIDString = CC885D7D1BCB2C69001B771F; 44 | remoteInfo = "SwiftyLayoutTests-Mac"; 45 | }; 46 | CC885DFF1BCB3D13001B771F /* PBXContainerItemProxy */ = { 47 | isa = PBXContainerItemProxy; 48 | containerPortal = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 49 | proxyType = 1; 50 | remoteGlobalIDString = CC885D731BCB2C69001B771F; 51 | remoteInfo = "SwiftyLayout-Mac"; 52 | }; 53 | /* End PBXContainerItemProxy section */ 54 | 55 | /* Begin PBXCopyFilesBuildPhase section */ 56 | CC885E011BCB3D13001B771F /* Embed Frameworks */ = { 57 | isa = PBXCopyFilesBuildPhase; 58 | buildActionMask = 2147483647; 59 | dstPath = ""; 60 | dstSubfolderSpec = 10; 61 | files = ( 62 | CC885DFE1BCB3D13001B771F /* SwiftyLayout.framework in Embed Frameworks */, 63 | ); 64 | name = "Embed Frameworks"; 65 | runOnlyForDeploymentPostprocessing = 0; 66 | }; 67 | /* End PBXCopyFilesBuildPhase section */ 68 | 69 | /* Begin PBXFileReference section */ 70 | CC885DDE1BCB3CEE001B771F /* SampleApp-Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SampleApp-Mac.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | CC885DE11BCB3CEE001B771F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 72 | CC885DE31BCB3CEE001B771F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 73 | CC885DE61BCB3CEE001B771F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 74 | CC885DE81BCB3CEE001B771F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 75 | CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyLayout.xcodeproj; path = ../SwiftyLayout.xcodeproj; sourceTree = ""; }; 76 | /* End PBXFileReference section */ 77 | 78 | /* Begin PBXFrameworksBuildPhase section */ 79 | CC885DDB1BCB3CEE001B771F /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | CC885DFD1BCB3D13001B771F /* SwiftyLayout.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | CC885DD51BCB3CEE001B771F = { 91 | isa = PBXGroup; 92 | children = ( 93 | CC885DE01BCB3CEE001B771F /* SampleApp-Mac */, 94 | CC885DDF1BCB3CEE001B771F /* Products */, 95 | CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */, 96 | ); 97 | sourceTree = ""; 98 | }; 99 | CC885DDF1BCB3CEE001B771F /* Products */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | CC885DDE1BCB3CEE001B771F /* SampleApp-Mac.app */, 103 | ); 104 | name = Products; 105 | sourceTree = ""; 106 | }; 107 | CC885DE01BCB3CEE001B771F /* SampleApp-Mac */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | CC885DE11BCB3CEE001B771F /* AppDelegate.swift */, 111 | CC885DE31BCB3CEE001B771F /* Assets.xcassets */, 112 | CC885DE51BCB3CEE001B771F /* MainMenu.xib */, 113 | CC885DE81BCB3CEE001B771F /* Info.plist */, 114 | ); 115 | path = "SampleApp-Mac"; 116 | sourceTree = ""; 117 | }; 118 | CC885DEF1BCB3D07001B771F /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | CC885DF61BCB3D07001B771F /* SwiftyLayout.framework */, 122 | CC885DF81BCB3D07001B771F /* SwiftyLayoutTests-iOS.xctest */, 123 | CC885DFA1BCB3D07001B771F /* SwiftyLayout.framework */, 124 | CC885DFC1BCB3D07001B771F /* SwiftyLayoutTests-Mac.xctest */, 125 | ); 126 | name = Products; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | CC885DDD1BCB3CEE001B771F /* SampleApp-Mac */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = CC885DEB1BCB3CEE001B771F /* Build configuration list for PBXNativeTarget "SampleApp-Mac" */; 135 | buildPhases = ( 136 | CC885DDA1BCB3CEE001B771F /* Sources */, 137 | CC885DDB1BCB3CEE001B771F /* Frameworks */, 138 | CC885DDC1BCB3CEE001B771F /* Resources */, 139 | CC885E011BCB3D13001B771F /* Embed Frameworks */, 140 | ); 141 | buildRules = ( 142 | ); 143 | dependencies = ( 144 | CC885E001BCB3D13001B771F /* PBXTargetDependency */, 145 | ); 146 | name = "SampleApp-Mac"; 147 | productName = "SampleApp-Mac"; 148 | productReference = CC885DDE1BCB3CEE001B771F /* SampleApp-Mac.app */; 149 | productType = "com.apple.product-type.application"; 150 | }; 151 | /* End PBXNativeTarget section */ 152 | 153 | /* Begin PBXProject section */ 154 | CC885DD61BCB3CEE001B771F /* Project object */ = { 155 | isa = PBXProject; 156 | attributes = { 157 | LastUpgradeCheck = 0800; 158 | ORGANIZATIONNAME = "Hisakuni Fujimoto"; 159 | TargetAttributes = { 160 | CC885DDD1BCB3CEE001B771F = { 161 | CreatedOnToolsVersion = 7.0.1; 162 | }; 163 | }; 164 | }; 165 | buildConfigurationList = CC885DD91BCB3CEE001B771F /* Build configuration list for PBXProject "SampleApp-Mac" */; 166 | compatibilityVersion = "Xcode 3.2"; 167 | developmentRegion = English; 168 | hasScannedForEncodings = 0; 169 | knownRegions = ( 170 | en, 171 | Base, 172 | ); 173 | mainGroup = CC885DD51BCB3CEE001B771F; 174 | productRefGroup = CC885DDF1BCB3CEE001B771F /* Products */; 175 | projectDirPath = ""; 176 | projectReferences = ( 177 | { 178 | ProductGroup = CC885DEF1BCB3D07001B771F /* Products */; 179 | ProjectRef = CC885DEE1BCB3D07001B771F /* SwiftyLayout.xcodeproj */; 180 | }, 181 | ); 182 | projectRoot = ""; 183 | targets = ( 184 | CC885DDD1BCB3CEE001B771F /* SampleApp-Mac */, 185 | ); 186 | }; 187 | /* End PBXProject section */ 188 | 189 | /* Begin PBXReferenceProxy section */ 190 | CC885DF61BCB3D07001B771F /* SwiftyLayout.framework */ = { 191 | isa = PBXReferenceProxy; 192 | fileType = wrapper.framework; 193 | path = SwiftyLayout.framework; 194 | remoteRef = CC885DF51BCB3D07001B771F /* PBXContainerItemProxy */; 195 | sourceTree = BUILT_PRODUCTS_DIR; 196 | }; 197 | CC885DF81BCB3D07001B771F /* SwiftyLayoutTests-iOS.xctest */ = { 198 | isa = PBXReferenceProxy; 199 | fileType = wrapper.cfbundle; 200 | path = "SwiftyLayoutTests-iOS.xctest"; 201 | remoteRef = CC885DF71BCB3D07001B771F /* PBXContainerItemProxy */; 202 | sourceTree = BUILT_PRODUCTS_DIR; 203 | }; 204 | CC885DFA1BCB3D07001B771F /* SwiftyLayout.framework */ = { 205 | isa = PBXReferenceProxy; 206 | fileType = wrapper.framework; 207 | path = SwiftyLayout.framework; 208 | remoteRef = CC885DF91BCB3D07001B771F /* PBXContainerItemProxy */; 209 | sourceTree = BUILT_PRODUCTS_DIR; 210 | }; 211 | CC885DFC1BCB3D07001B771F /* SwiftyLayoutTests-Mac.xctest */ = { 212 | isa = PBXReferenceProxy; 213 | fileType = wrapper.cfbundle; 214 | path = "SwiftyLayoutTests-Mac.xctest"; 215 | remoteRef = CC885DFB1BCB3D07001B771F /* PBXContainerItemProxy */; 216 | sourceTree = BUILT_PRODUCTS_DIR; 217 | }; 218 | /* End PBXReferenceProxy section */ 219 | 220 | /* Begin PBXResourcesBuildPhase section */ 221 | CC885DDC1BCB3CEE001B771F /* Resources */ = { 222 | isa = PBXResourcesBuildPhase; 223 | buildActionMask = 2147483647; 224 | files = ( 225 | CC885DE41BCB3CEE001B771F /* Assets.xcassets in Resources */, 226 | CC885DE71BCB3CEE001B771F /* MainMenu.xib in Resources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | /* End PBXResourcesBuildPhase section */ 231 | 232 | /* Begin PBXSourcesBuildPhase section */ 233 | CC885DDA1BCB3CEE001B771F /* Sources */ = { 234 | isa = PBXSourcesBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | CC885DE21BCB3CEE001B771F /* AppDelegate.swift in Sources */, 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | }; 241 | /* End PBXSourcesBuildPhase section */ 242 | 243 | /* Begin PBXTargetDependency section */ 244 | CC885E001BCB3D13001B771F /* PBXTargetDependency */ = { 245 | isa = PBXTargetDependency; 246 | name = "SwiftyLayout-Mac"; 247 | targetProxy = CC885DFF1BCB3D13001B771F /* PBXContainerItemProxy */; 248 | }; 249 | /* End PBXTargetDependency section */ 250 | 251 | /* Begin PBXVariantGroup section */ 252 | CC885DE51BCB3CEE001B771F /* MainMenu.xib */ = { 253 | isa = PBXVariantGroup; 254 | children = ( 255 | CC885DE61BCB3CEE001B771F /* Base */, 256 | ); 257 | name = MainMenu.xib; 258 | sourceTree = ""; 259 | }; 260 | /* End PBXVariantGroup section */ 261 | 262 | /* Begin XCBuildConfiguration section */ 263 | CC885DE91BCB3CEE001B771F /* Debug */ = { 264 | isa = XCBuildConfiguration; 265 | buildSettings = { 266 | ALWAYS_SEARCH_USER_PATHS = NO; 267 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 268 | CLANG_CXX_LIBRARY = "libc++"; 269 | CLANG_ENABLE_MODULES = YES; 270 | CLANG_ENABLE_OBJC_ARC = YES; 271 | CLANG_WARN_BOOL_CONVERSION = YES; 272 | CLANG_WARN_CONSTANT_CONVERSION = YES; 273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 274 | CLANG_WARN_EMPTY_BODY = YES; 275 | CLANG_WARN_ENUM_CONVERSION = YES; 276 | CLANG_WARN_INFINITE_RECURSION = YES; 277 | CLANG_WARN_INT_CONVERSION = YES; 278 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 279 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 280 | CLANG_WARN_UNREACHABLE_CODE = YES; 281 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 282 | CODE_SIGN_IDENTITY = "-"; 283 | COPY_PHASE_STRIP = NO; 284 | DEBUG_INFORMATION_FORMAT = dwarf; 285 | ENABLE_STRICT_OBJC_MSGSEND = YES; 286 | ENABLE_TESTABILITY = YES; 287 | GCC_C_LANGUAGE_STANDARD = gnu99; 288 | GCC_DYNAMIC_NO_PIC = NO; 289 | GCC_NO_COMMON_BLOCKS = YES; 290 | GCC_OPTIMIZATION_LEVEL = 0; 291 | GCC_PREPROCESSOR_DEFINITIONS = ( 292 | "DEBUG=1", 293 | "$(inherited)", 294 | ); 295 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 296 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 297 | GCC_WARN_UNDECLARED_SELECTOR = YES; 298 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 299 | GCC_WARN_UNUSED_FUNCTION = YES; 300 | GCC_WARN_UNUSED_VARIABLE = YES; 301 | MACOSX_DEPLOYMENT_TARGET = 10.10; 302 | MTL_ENABLE_DEBUG_INFO = YES; 303 | ONLY_ACTIVE_ARCH = YES; 304 | SDKROOT = macosx; 305 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 306 | SWIFT_VERSION = 2.3; 307 | }; 308 | name = Debug; 309 | }; 310 | CC885DEA1BCB3CEE001B771F /* Release */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_WARN_BOOL_CONVERSION = YES; 319 | CLANG_WARN_CONSTANT_CONVERSION = YES; 320 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 321 | CLANG_WARN_EMPTY_BODY = YES; 322 | CLANG_WARN_ENUM_CONVERSION = YES; 323 | CLANG_WARN_INFINITE_RECURSION = YES; 324 | CLANG_WARN_INT_CONVERSION = YES; 325 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 326 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 327 | CLANG_WARN_UNREACHABLE_CODE = YES; 328 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 329 | CODE_SIGN_IDENTITY = "-"; 330 | COPY_PHASE_STRIP = NO; 331 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 332 | ENABLE_NS_ASSERTIONS = NO; 333 | ENABLE_STRICT_OBJC_MSGSEND = YES; 334 | GCC_C_LANGUAGE_STANDARD = gnu99; 335 | GCC_NO_COMMON_BLOCKS = YES; 336 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 337 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 338 | GCC_WARN_UNDECLARED_SELECTOR = YES; 339 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 340 | GCC_WARN_UNUSED_FUNCTION = YES; 341 | GCC_WARN_UNUSED_VARIABLE = YES; 342 | MACOSX_DEPLOYMENT_TARGET = 10.10; 343 | MTL_ENABLE_DEBUG_INFO = NO; 344 | SDKROOT = macosx; 345 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 346 | SWIFT_VERSION = 2.3; 347 | }; 348 | name = Release; 349 | }; 350 | CC885DEC1BCB3CEE001B771F /* Debug */ = { 351 | isa = XCBuildConfiguration; 352 | buildSettings = { 353 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 354 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 355 | COMBINE_HIDPI_IMAGES = YES; 356 | INFOPLIST_FILE = "SampleApp-Mac/Info.plist"; 357 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 358 | PRODUCT_BUNDLE_IDENTIFIER = "com.fobj.SampleApp-Mac"; 359 | PRODUCT_NAME = "$(TARGET_NAME)"; 360 | SWIFT_VERSION = 2.3; 361 | }; 362 | name = Debug; 363 | }; 364 | CC885DED1BCB3CEE001B771F /* Release */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 368 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 369 | COMBINE_HIDPI_IMAGES = YES; 370 | INFOPLIST_FILE = "SampleApp-Mac/Info.plist"; 371 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 372 | PRODUCT_BUNDLE_IDENTIFIER = "com.fobj.SampleApp-Mac"; 373 | PRODUCT_NAME = "$(TARGET_NAME)"; 374 | SWIFT_VERSION = 2.3; 375 | }; 376 | name = Release; 377 | }; 378 | /* End XCBuildConfiguration section */ 379 | 380 | /* Begin XCConfigurationList section */ 381 | CC885DD91BCB3CEE001B771F /* Build configuration list for PBXProject "SampleApp-Mac" */ = { 382 | isa = XCConfigurationList; 383 | buildConfigurations = ( 384 | CC885DE91BCB3CEE001B771F /* Debug */, 385 | CC885DEA1BCB3CEE001B771F /* Release */, 386 | ); 387 | defaultConfigurationIsVisible = 0; 388 | defaultConfigurationName = Release; 389 | }; 390 | CC885DEB1BCB3CEE001B771F /* Build configuration list for PBXNativeTarget "SampleApp-Mac" */ = { 391 | isa = XCConfigurationList; 392 | buildConfigurations = ( 393 | CC885DEC1BCB3CEE001B771F /* Debug */, 394 | CC885DED1BCB3CEE001B771F /* Release */, 395 | ); 396 | defaultConfigurationIsVisible = 0; 397 | defaultConfigurationName = Release; 398 | }; 399 | /* End XCConfigurationList section */ 400 | }; 401 | rootObject = CC885DD61BCB3CEE001B771F /* Project object */; 402 | } 403 | -------------------------------------------------------------------------------- /SampleApp-iOS/SampleApp-iOS.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CC885DB01BCB3481001B771F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885DAF1BCB3481001B771F /* AppDelegate.swift */; }; 11 | CC885DB21BCB3481001B771F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885DB11BCB3481001B771F /* ViewController.swift */; }; 12 | CC885DB51BCB3481001B771F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CC885DB31BCB3481001B771F /* Main.storyboard */; }; 13 | CC885DB71BCB3481001B771F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = CC885DB61BCB3481001B771F /* Assets.xcassets */; }; 14 | CC885DBA1BCB3481001B771F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = CC885DB81BCB3481001B771F /* LaunchScreen.storyboard */; }; 15 | CC885DD01BCB3587001B771F /* SwiftyLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC885DC91BCB3537001B771F /* SwiftyLayout.framework */; }; 16 | CC885DD11BCB3587001B771F /* SwiftyLayout.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CC885DC91BCB3537001B771F /* SwiftyLayout.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | CC885DC81BCB3537001B771F /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 23 | proxyType = 2; 24 | remoteGlobalIDString = CC885D551BCB2AA8001B771F; 25 | remoteInfo = "SwiftyLayout-iOS"; 26 | }; 27 | CC885DCA1BCB3537001B771F /* PBXContainerItemProxy */ = { 28 | isa = PBXContainerItemProxy; 29 | containerPortal = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 30 | proxyType = 2; 31 | remoteGlobalIDString = CC885D5F1BCB2AA8001B771F; 32 | remoteInfo = "SwiftyLayoutTests-iOS"; 33 | }; 34 | CC885DCC1BCB3537001B771F /* PBXContainerItemProxy */ = { 35 | isa = PBXContainerItemProxy; 36 | containerPortal = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 37 | proxyType = 2; 38 | remoteGlobalIDString = CC885D741BCB2C69001B771F; 39 | remoteInfo = "SwiftyLayout-Mac"; 40 | }; 41 | CC885DCE1BCB3537001B771F /* PBXContainerItemProxy */ = { 42 | isa = PBXContainerItemProxy; 43 | containerPortal = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 44 | proxyType = 2; 45 | remoteGlobalIDString = CC885D7D1BCB2C69001B771F; 46 | remoteInfo = "SwiftyLayoutTests-Mac"; 47 | }; 48 | CC885DD21BCB3587001B771F /* PBXContainerItemProxy */ = { 49 | isa = PBXContainerItemProxy; 50 | containerPortal = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 51 | proxyType = 1; 52 | remoteGlobalIDString = CC885D541BCB2AA8001B771F; 53 | remoteInfo = "SwiftyLayout-iOS"; 54 | }; 55 | /* End PBXContainerItemProxy section */ 56 | 57 | /* Begin PBXCopyFilesBuildPhase section */ 58 | CC885DD41BCB3587001B771F /* Embed Frameworks */ = { 59 | isa = PBXCopyFilesBuildPhase; 60 | buildActionMask = 2147483647; 61 | dstPath = ""; 62 | dstSubfolderSpec = 10; 63 | files = ( 64 | CC885DD11BCB3587001B771F /* SwiftyLayout.framework in Embed Frameworks */, 65 | ); 66 | name = "Embed Frameworks"; 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXCopyFilesBuildPhase section */ 70 | 71 | /* Begin PBXFileReference section */ 72 | CC885DAC1BCB3481001B771F /* SampleApp-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "SampleApp-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 73 | CC885DAF1BCB3481001B771F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 74 | CC885DB11BCB3481001B771F /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 75 | CC885DB41BCB3481001B771F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 76 | CC885DB61BCB3481001B771F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 77 | CC885DB91BCB3481001B771F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 78 | CC885DBB1BCB3481001B771F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 79 | CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyLayout.xcodeproj; path = ../SwiftyLayout.xcodeproj; sourceTree = ""; }; 80 | /* End PBXFileReference section */ 81 | 82 | /* Begin PBXFrameworksBuildPhase section */ 83 | CC885DA91BCB3481001B771F /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | CC885DD01BCB3587001B771F /* SwiftyLayout.framework in Frameworks */, 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | /* End PBXFrameworksBuildPhase section */ 92 | 93 | /* Begin PBXGroup section */ 94 | CC885DA31BCB3481001B771F = { 95 | isa = PBXGroup; 96 | children = ( 97 | CC885DAE1BCB3481001B771F /* SampleApp-iOS */, 98 | CC885DAD1BCB3481001B771F /* Products */, 99 | CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */, 100 | ); 101 | sourceTree = ""; 102 | }; 103 | CC885DAD1BCB3481001B771F /* Products */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | CC885DAC1BCB3481001B771F /* SampleApp-iOS.app */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | CC885DAE1BCB3481001B771F /* SampleApp-iOS */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | CC885DAF1BCB3481001B771F /* AppDelegate.swift */, 115 | CC885DB11BCB3481001B771F /* ViewController.swift */, 116 | CC885DB31BCB3481001B771F /* Main.storyboard */, 117 | CC885DB61BCB3481001B771F /* Assets.xcassets */, 118 | CC885DB81BCB3481001B771F /* LaunchScreen.storyboard */, 119 | CC885DBB1BCB3481001B771F /* Info.plist */, 120 | ); 121 | path = "SampleApp-iOS"; 122 | sourceTree = ""; 123 | }; 124 | CC885DC21BCB3537001B771F /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | CC885DC91BCB3537001B771F /* SwiftyLayout.framework */, 128 | CC885DCB1BCB3537001B771F /* SwiftyLayoutTests-iOS.xctest */, 129 | CC885DCD1BCB3537001B771F /* SwiftyLayout.framework */, 130 | CC885DCF1BCB3537001B771F /* SwiftyLayoutTests-Mac.xctest */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | CC885DAB1BCB3481001B771F /* SampleApp-iOS */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = CC885DBE1BCB3481001B771F /* Build configuration list for PBXNativeTarget "SampleApp-iOS" */; 141 | buildPhases = ( 142 | CC885DA81BCB3481001B771F /* Sources */, 143 | CC885DA91BCB3481001B771F /* Frameworks */, 144 | CC885DAA1BCB3481001B771F /* Resources */, 145 | CC885DD41BCB3587001B771F /* Embed Frameworks */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | CC885DD31BCB3587001B771F /* PBXTargetDependency */, 151 | ); 152 | name = "SampleApp-iOS"; 153 | productName = "SampleApp-iOS"; 154 | productReference = CC885DAC1BCB3481001B771F /* SampleApp-iOS.app */; 155 | productType = "com.apple.product-type.application"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | CC885DA41BCB3481001B771F /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastUpgradeCheck = 0800; 164 | ORGANIZATIONNAME = "Hisakuni Fujimoto"; 165 | TargetAttributes = { 166 | CC885DAB1BCB3481001B771F = { 167 | CreatedOnToolsVersion = 7.0.1; 168 | }; 169 | }; 170 | }; 171 | buildConfigurationList = CC885DA71BCB3481001B771F /* Build configuration list for PBXProject "SampleApp-iOS" */; 172 | compatibilityVersion = "Xcode 3.2"; 173 | developmentRegion = English; 174 | hasScannedForEncodings = 0; 175 | knownRegions = ( 176 | en, 177 | Base, 178 | ); 179 | mainGroup = CC885DA31BCB3481001B771F; 180 | productRefGroup = CC885DAD1BCB3481001B771F /* Products */; 181 | projectDirPath = ""; 182 | projectReferences = ( 183 | { 184 | ProductGroup = CC885DC21BCB3537001B771F /* Products */; 185 | ProjectRef = CC885DC11BCB3537001B771F /* SwiftyLayout.xcodeproj */; 186 | }, 187 | ); 188 | projectRoot = ""; 189 | targets = ( 190 | CC885DAB1BCB3481001B771F /* SampleApp-iOS */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXReferenceProxy section */ 196 | CC885DC91BCB3537001B771F /* SwiftyLayout.framework */ = { 197 | isa = PBXReferenceProxy; 198 | fileType = wrapper.framework; 199 | path = SwiftyLayout.framework; 200 | remoteRef = CC885DC81BCB3537001B771F /* PBXContainerItemProxy */; 201 | sourceTree = BUILT_PRODUCTS_DIR; 202 | }; 203 | CC885DCB1BCB3537001B771F /* SwiftyLayoutTests-iOS.xctest */ = { 204 | isa = PBXReferenceProxy; 205 | fileType = wrapper.cfbundle; 206 | path = "SwiftyLayoutTests-iOS.xctest"; 207 | remoteRef = CC885DCA1BCB3537001B771F /* PBXContainerItemProxy */; 208 | sourceTree = BUILT_PRODUCTS_DIR; 209 | }; 210 | CC885DCD1BCB3537001B771F /* SwiftyLayout.framework */ = { 211 | isa = PBXReferenceProxy; 212 | fileType = wrapper.framework; 213 | path = SwiftyLayout.framework; 214 | remoteRef = CC885DCC1BCB3537001B771F /* PBXContainerItemProxy */; 215 | sourceTree = BUILT_PRODUCTS_DIR; 216 | }; 217 | CC885DCF1BCB3537001B771F /* SwiftyLayoutTests-Mac.xctest */ = { 218 | isa = PBXReferenceProxy; 219 | fileType = wrapper.cfbundle; 220 | path = "SwiftyLayoutTests-Mac.xctest"; 221 | remoteRef = CC885DCE1BCB3537001B771F /* PBXContainerItemProxy */; 222 | sourceTree = BUILT_PRODUCTS_DIR; 223 | }; 224 | /* End PBXReferenceProxy section */ 225 | 226 | /* Begin PBXResourcesBuildPhase section */ 227 | CC885DAA1BCB3481001B771F /* Resources */ = { 228 | isa = PBXResourcesBuildPhase; 229 | buildActionMask = 2147483647; 230 | files = ( 231 | CC885DBA1BCB3481001B771F /* LaunchScreen.storyboard in Resources */, 232 | CC885DB71BCB3481001B771F /* Assets.xcassets in Resources */, 233 | CC885DB51BCB3481001B771F /* Main.storyboard in Resources */, 234 | ); 235 | runOnlyForDeploymentPostprocessing = 0; 236 | }; 237 | /* End PBXResourcesBuildPhase section */ 238 | 239 | /* Begin PBXSourcesBuildPhase section */ 240 | CC885DA81BCB3481001B771F /* Sources */ = { 241 | isa = PBXSourcesBuildPhase; 242 | buildActionMask = 2147483647; 243 | files = ( 244 | CC885DB21BCB3481001B771F /* ViewController.swift in Sources */, 245 | CC885DB01BCB3481001B771F /* AppDelegate.swift in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin PBXTargetDependency section */ 252 | CC885DD31BCB3587001B771F /* PBXTargetDependency */ = { 253 | isa = PBXTargetDependency; 254 | name = "SwiftyLayout-iOS"; 255 | targetProxy = CC885DD21BCB3587001B771F /* PBXContainerItemProxy */; 256 | }; 257 | /* End PBXTargetDependency section */ 258 | 259 | /* Begin PBXVariantGroup section */ 260 | CC885DB31BCB3481001B771F /* Main.storyboard */ = { 261 | isa = PBXVariantGroup; 262 | children = ( 263 | CC885DB41BCB3481001B771F /* Base */, 264 | ); 265 | name = Main.storyboard; 266 | sourceTree = ""; 267 | }; 268 | CC885DB81BCB3481001B771F /* LaunchScreen.storyboard */ = { 269 | isa = PBXVariantGroup; 270 | children = ( 271 | CC885DB91BCB3481001B771F /* Base */, 272 | ); 273 | name = LaunchScreen.storyboard; 274 | sourceTree = ""; 275 | }; 276 | /* End PBXVariantGroup section */ 277 | 278 | /* Begin XCBuildConfiguration section */ 279 | CC885DBC1BCB3481001B771F /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ALWAYS_SEARCH_USER_PATHS = NO; 283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 284 | CLANG_CXX_LIBRARY = "libc++"; 285 | CLANG_ENABLE_MODULES = YES; 286 | CLANG_ENABLE_OBJC_ARC = YES; 287 | CLANG_WARN_BOOL_CONVERSION = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 290 | CLANG_WARN_EMPTY_BODY = YES; 291 | CLANG_WARN_ENUM_CONVERSION = YES; 292 | CLANG_WARN_INFINITE_RECURSION = YES; 293 | CLANG_WARN_INT_CONVERSION = YES; 294 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 295 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 296 | CLANG_WARN_UNREACHABLE_CODE = YES; 297 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 298 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 299 | COPY_PHASE_STRIP = NO; 300 | DEBUG_INFORMATION_FORMAT = dwarf; 301 | ENABLE_STRICT_OBJC_MSGSEND = YES; 302 | ENABLE_TESTABILITY = YES; 303 | GCC_C_LANGUAGE_STANDARD = gnu99; 304 | GCC_DYNAMIC_NO_PIC = NO; 305 | GCC_NO_COMMON_BLOCKS = YES; 306 | GCC_OPTIMIZATION_LEVEL = 0; 307 | GCC_PREPROCESSOR_DEFINITIONS = ( 308 | "DEBUG=1", 309 | "$(inherited)", 310 | ); 311 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 312 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 313 | GCC_WARN_UNDECLARED_SELECTOR = YES; 314 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 315 | GCC_WARN_UNUSED_FUNCTION = YES; 316 | GCC_WARN_UNUSED_VARIABLE = YES; 317 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 318 | MTL_ENABLE_DEBUG_INFO = YES; 319 | ONLY_ACTIVE_ARCH = YES; 320 | SDKROOT = iphoneos; 321 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 322 | SWIFT_VERSION = 2.3; 323 | TARGETED_DEVICE_FAMILY = "1,2"; 324 | }; 325 | name = Debug; 326 | }; 327 | CC885DBD1BCB3481001B771F /* Release */ = { 328 | isa = XCBuildConfiguration; 329 | buildSettings = { 330 | ALWAYS_SEARCH_USER_PATHS = NO; 331 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 332 | CLANG_CXX_LIBRARY = "libc++"; 333 | CLANG_ENABLE_MODULES = YES; 334 | CLANG_ENABLE_OBJC_ARC = YES; 335 | CLANG_WARN_BOOL_CONVERSION = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 338 | CLANG_WARN_EMPTY_BODY = YES; 339 | CLANG_WARN_ENUM_CONVERSION = YES; 340 | CLANG_WARN_INFINITE_RECURSION = YES; 341 | CLANG_WARN_INT_CONVERSION = YES; 342 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 343 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 344 | CLANG_WARN_UNREACHABLE_CODE = YES; 345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 347 | COPY_PHASE_STRIP = NO; 348 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 349 | ENABLE_NS_ASSERTIONS = NO; 350 | ENABLE_STRICT_OBJC_MSGSEND = YES; 351 | GCC_C_LANGUAGE_STANDARD = gnu99; 352 | GCC_NO_COMMON_BLOCKS = YES; 353 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 354 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 355 | GCC_WARN_UNDECLARED_SELECTOR = YES; 356 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 357 | GCC_WARN_UNUSED_FUNCTION = YES; 358 | GCC_WARN_UNUSED_VARIABLE = YES; 359 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 360 | MTL_ENABLE_DEBUG_INFO = NO; 361 | SDKROOT = iphoneos; 362 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 363 | SWIFT_VERSION = 2.3; 364 | TARGETED_DEVICE_FAMILY = "1,2"; 365 | VALIDATE_PRODUCT = YES; 366 | }; 367 | name = Release; 368 | }; 369 | CC885DBF1BCB3481001B771F /* Debug */ = { 370 | isa = XCBuildConfiguration; 371 | buildSettings = { 372 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 373 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 374 | INFOPLIST_FILE = "SampleApp-iOS/Info.plist"; 375 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 376 | PRODUCT_BUNDLE_IDENTIFIER = "com.fobj.SampleApp-iOS"; 377 | PRODUCT_NAME = "$(TARGET_NAME)"; 378 | }; 379 | name = Debug; 380 | }; 381 | CC885DC01BCB3481001B771F /* Release */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | INFOPLIST_FILE = "SampleApp-iOS/Info.plist"; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | PRODUCT_BUNDLE_IDENTIFIER = "com.fobj.SampleApp-iOS"; 389 | PRODUCT_NAME = "$(TARGET_NAME)"; 390 | }; 391 | name = Release; 392 | }; 393 | /* End XCBuildConfiguration section */ 394 | 395 | /* Begin XCConfigurationList section */ 396 | CC885DA71BCB3481001B771F /* Build configuration list for PBXProject "SampleApp-iOS" */ = { 397 | isa = XCConfigurationList; 398 | buildConfigurations = ( 399 | CC885DBC1BCB3481001B771F /* Debug */, 400 | CC885DBD1BCB3481001B771F /* Release */, 401 | ); 402 | defaultConfigurationIsVisible = 0; 403 | defaultConfigurationName = Release; 404 | }; 405 | CC885DBE1BCB3481001B771F /* Build configuration list for PBXNativeTarget "SampleApp-iOS" */ = { 406 | isa = XCConfigurationList; 407 | buildConfigurations = ( 408 | CC885DBF1BCB3481001B771F /* Debug */, 409 | CC885DC01BCB3481001B771F /* Release */, 410 | ); 411 | defaultConfigurationIsVisible = 0; 412 | defaultConfigurationName = Release; 413 | }; 414 | /* End XCConfigurationList section */ 415 | }; 416 | rootObject = CC885DA41BCB3481001B771F /* Project object */; 417 | } 418 | -------------------------------------------------------------------------------- /SwiftyLayoutTests/OperatorsWithViewTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OperatorsWithViewTestsTests.swift 3 | // SwiftyLayoutTests 4 | // 5 | // Created by fhisa on 2015/08/13. 6 | // Copyright (c) 2015 Hisakuni Fujimoto. All rights reserved. 7 | // 8 | 9 | #if os(iOS) 10 | import UIKit 11 | #else 12 | import AppKit 13 | #endif 14 | 15 | import XCTest 16 | import SwiftyLayout 17 | 18 | class OperatorsWithViewTests: XCTestCase { 19 | 20 | var view1: View! 21 | var view2: View! 22 | var x: NSLayoutConstraint! 23 | 24 | override func setUp() { 25 | super.setUp() 26 | x = nil 27 | view1 = View() 28 | view2 = View() 29 | view1.translatesAutoresizingMaskIntoConstraints = false 30 | view2.translatesAutoresizingMaskIntoConstraints = false 31 | } 32 | 33 | override func tearDown() { 34 | super.tearDown() 35 | } 36 | 37 | func test_priority_operator() { 38 | x = view1[.width] == view2[.width] 39 | XCTAssertEqual(x.priority, LayoutPriority(1000)) 40 | x = (view1[.width] == view2[.width]) ~ 750 41 | XCTAssertEqual(x.priority, LayoutPriority(750)) 42 | 43 | x = (view1[.width] == view2[.width]) ~ 750.0 44 | XCTAssertEqual(x.priority, LayoutPriority(750.0)) 45 | 46 | let intval = 750 47 | x = (view1[.width] == view2[.width]) ~ intval 48 | XCTAssertEqual(x.priority, LayoutPriority(intval)) 49 | 50 | let floatval = 750.0 51 | x = (view1[.width] == view2[.width]) ~ floatval 52 | XCTAssertEqual(x.priority, LayoutPriority(floatval)) 53 | } 54 | 55 | func test_operator_term_add_constant() { 56 | x = view1[.width] == view2[.width] + 20 57 | XCTAssertEqual(x.constant, CGFloat(20)) 58 | 59 | x = view1[.width] == view2[.width] + 20.0 60 | XCTAssertEqual(x.constant, CGFloat(20.0)) 61 | 62 | let intval = 20 63 | x = view1[.width] == view2[.width] + intval 64 | XCTAssertEqual(x.constant, CGFloat(intval)) 65 | x = view1[.width] == view2[.width] + intval + intval 66 | XCTAssertEqual(x.constant, CGFloat(intval * 2)) 67 | 68 | let floatval = 20.0 69 | x = view1[.width] == view2[.width] + floatval 70 | XCTAssertEqual(x.constant, CGFloat(floatval)) 71 | x = view1[.width] == view2[.width] + floatval + floatval 72 | XCTAssertEqual(x.constant, CGFloat(floatval * 2)) 73 | } 74 | 75 | func test_operator_constant_add_term() { 76 | x = view1[.width] == 20 + view2[.width] 77 | XCTAssertEqual(x.constant, CGFloat(20)) 78 | 79 | x = view1[.width] == 20.0 + view2[.width] 80 | XCTAssertEqual(x.constant, CGFloat(20.0)) 81 | 82 | let intval = 20 83 | x = view1[.width] == intval + view2[.width] 84 | XCTAssertEqual(x.constant, CGFloat(intval)) 85 | x = view1[.width] == intval + 20 + view2[.width] 86 | XCTAssertEqual(x.constant, CGFloat(intval + 20)) 87 | 88 | let floatval = 20.0 89 | x = view1[.width] == floatval + view2[.width] 90 | XCTAssertEqual(x.constant, CGFloat(floatval)) 91 | x = view1[.width] == 10.0 + floatval + view2[.width] 92 | XCTAssertEqual(x.constant, CGFloat(10.0 + floatval)) 93 | } 94 | 95 | func test_operator_term_multiply_constant() { 96 | x = view1[.width] == view2[.width] * 20 97 | XCTAssertEqual(x.multiplier, CGFloat(20)) 98 | 99 | x = view1[.width] == view2[.width] * 20.0 100 | XCTAssertEqual(x.multiplier, CGFloat(20.0)) 101 | 102 | let intval = 20 103 | x = view1[.width] == view2[.width] * intval 104 | XCTAssertEqual(x.multiplier, CGFloat(intval)) 105 | 106 | let floatval = 20.0 107 | x = view1[.width] == view2[.width] * floatval 108 | XCTAssertEqual(x.multiplier, CGFloat(floatval)) 109 | } 110 | 111 | func test_operator_constant_multiply_term() { 112 | x = view1[.width] == 20 * view2[.width] 113 | XCTAssertEqual(x.multiplier, CGFloat(20)) 114 | 115 | x = view1[.width] == 20.0 * view2[.width] 116 | XCTAssertEqual(x.multiplier, CGFloat(20.0)) 117 | 118 | let intval = 20 119 | x = view1[.width] == intval * view2[.width] 120 | XCTAssertEqual(x.multiplier, CGFloat(intval)) 121 | 122 | let floatval = 20.0 123 | x = view1[.width] == floatval * view2[.width] 124 | XCTAssertEqual(x.multiplier, CGFloat(floatval)) 125 | } 126 | 127 | func test_operator_multiply_for_ratio() { 128 | x = view1[.height] * 4 == view1[.width] * 3 129 | XCTAssertEqual(x.multiplier, CGFloat(3) / CGFloat(4)) 130 | x = view1[.height] * 16.0 == view1[.width] * 9.0 131 | XCTAssertEqual(x.multiplier, CGFloat(9.0) / CGFloat(16.0)) 132 | 133 | let intval_a = 4, intval_b = 3 134 | x = view1[.height] * intval_a == view1[.width] * intval_b 135 | XCTAssertEqual(x.multiplier, CGFloat(intval_b) / CGFloat(intval_a)) 136 | 137 | let floatval_a = 16.0, floatval_b = 9.0 138 | x = view1[.height] * floatval_a == view1[.width] * floatval_b 139 | XCTAssertEqual(x.multiplier, CGFloat(floatval_b / floatval_a)) 140 | } 141 | 142 | func test_operator_term_subtract_constant() { 143 | x = view1[.width] == view2[.width] - 20 144 | XCTAssertEqual(x.constant, CGFloat(-20)) 145 | 146 | x = view1[.width] == view2[.width] - 20.0 147 | XCTAssertEqual(x.constant, CGFloat(-20.0)) 148 | 149 | let intval = 20 150 | x = view1[.width] == view2[.width] - intval 151 | XCTAssertEqual(x.constant, CGFloat(-intval)) 152 | 153 | let floatval = 20.0 154 | x = view1[.width] == view2[.width] - floatval 155 | XCTAssertEqual(x.constant, CGFloat(-floatval)) 156 | } 157 | 158 | func test_operator_term_divide_constant() { 159 | x = view1[.width] == view2[.width] / 2 160 | XCTAssertEqual(x.multiplier, CGFloat(0.5)) 161 | 162 | x = view1[.width] == view2[.width] / 2.0 163 | XCTAssertEqual(x.multiplier, CGFloat(0.5)) 164 | 165 | let intval = 2 166 | x = view1[.width] == view2[.width] / intval 167 | XCTAssertEqual(x.multiplier, CGFloat(1) / CGFloat(intval)) 168 | 169 | let floatval = 2.0 170 | x = view1[.width] == view2[.width] / floatval 171 | XCTAssertEqual(x.multiplier, CGFloat(1.0 / floatval)) 172 | } 173 | 174 | func test_operator_divide_for_ratio() { 175 | x = view1[.height] / 3 == view1[.width] / 4 176 | XCTAssertEqual(x.multiplier, CGFloat(3) / CGFloat(4)) 177 | x = view1[.height] / 9.0 == view1[.width] / 16.0 178 | XCTAssertEqual(x.multiplier, CGFloat(9.0) / CGFloat(16.0)) 179 | 180 | let intval_a = 3, intval_b = 4 181 | x = view1[.height] / intval_a == view1[.width] / intval_b 182 | XCTAssertEqual(x.multiplier, CGFloat(intval_a) / CGFloat(intval_b)) 183 | 184 | let floatval_a = 9.0, floatval_b = 16.0 185 | x = view1[.height] / floatval_a == view1[.width] / floatval_b 186 | XCTAssertEqual(x.multiplier, CGFloat(floatval_a / floatval_b)) 187 | } 188 | 189 | func test_operator_term_equal_constant() { 190 | x = view1[.width] == 1234 191 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 192 | XCTAssertTrue(view1.isEqual(x.firstItem)) 193 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 194 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 195 | XCTAssertNil(x.secondItem) 196 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 197 | XCTAssertEqual(x.multiplier, CGFloat(1)) 198 | XCTAssertEqual(x.constant, CGFloat(1234)) 199 | 200 | let intval = 1234 201 | x = view1[.width] == intval 202 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 203 | XCTAssertTrue(view1.isEqual(x.firstItem)) 204 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 205 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 206 | XCTAssertNil(x.secondItem) 207 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 208 | XCTAssertEqual(x.multiplier, CGFloat(1)) 209 | XCTAssertEqual(x.constant, CGFloat(intval)) 210 | 211 | let floatval = 1234.0 212 | x = view1[.width] == floatval 213 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 214 | XCTAssertTrue(view1.isEqual(x.firstItem)) 215 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 216 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 217 | XCTAssertNil(x.secondItem) 218 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 219 | XCTAssertEqual(x.multiplier, CGFloat(1)) 220 | XCTAssertEqual(x.constant, CGFloat(floatval)) 221 | } 222 | 223 | func test_operator_constant_equal_term() { 224 | x = 1234 == view1[.width] 225 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 226 | XCTAssertTrue(view1.isEqual(x.firstItem)) 227 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 228 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 229 | XCTAssertNil(x.secondItem) 230 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 231 | XCTAssertEqual(x.multiplier, CGFloat(1)) 232 | XCTAssertEqual(x.constant, CGFloat(1234)) 233 | 234 | let intval = 1234 235 | x = intval == view1[.width] 236 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 237 | XCTAssertTrue(view1.isEqual(x.firstItem)) 238 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 239 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 240 | XCTAssertNil(x.secondItem) 241 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 242 | XCTAssertEqual(x.multiplier, CGFloat(1)) 243 | XCTAssertEqual(x.constant, CGFloat(intval)) 244 | 245 | let floatval = 1234.0 246 | x = intval == view1[.width] 247 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 248 | XCTAssertTrue(view1.isEqual(x.firstItem)) 249 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 250 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 251 | XCTAssertNil(x.secondItem) 252 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 253 | XCTAssertEqual(x.multiplier, CGFloat(1)) 254 | XCTAssertEqual(x.constant, CGFloat(floatval)) 255 | } 256 | 257 | func test_operator_term_equal_term() { 258 | x = view1[.width] == 12 * view2[.width] + 34 259 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 260 | XCTAssertTrue(view1.isEqual(x.firstItem)) 261 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 262 | XCTAssertEqual(x.relation, NSLayoutRelation.equal) 263 | XCTAssertTrue(view2.isEqual(x.secondItem)) 264 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 265 | XCTAssertEqual(x.multiplier, CGFloat(12)) 266 | XCTAssertEqual(x.constant, CGFloat(34)) 267 | } 268 | 269 | func test_operator_term_less_than_or_equal_constant() { 270 | x = view1[.width] <= 1234 271 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 272 | XCTAssertTrue(view1.isEqual(x.firstItem)) 273 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 274 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 275 | XCTAssertNil(x.secondItem) 276 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 277 | XCTAssertEqual(x.multiplier, CGFloat(1)) 278 | XCTAssertEqual(x.constant, CGFloat(1234)) 279 | 280 | let intval = 1234 281 | x = view1[.width] <= intval 282 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 283 | XCTAssertTrue(view1.isEqual(x.firstItem)) 284 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 285 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 286 | XCTAssertNil(x.secondItem) 287 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 288 | XCTAssertEqual(x.multiplier, CGFloat(1)) 289 | XCTAssertEqual(x.constant, CGFloat(intval)) 290 | 291 | let floatval = 1234.0 292 | x = view1[.width] <= intval 293 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 294 | XCTAssertTrue(view1.isEqual(x.firstItem)) 295 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 296 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 297 | XCTAssertNil(x.secondItem) 298 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 299 | XCTAssertEqual(x.multiplier, CGFloat(1)) 300 | XCTAssertEqual(x.constant, CGFloat(floatval)) 301 | } 302 | 303 | func test_operator_constant_less_than_or_equal_term() { 304 | x = 1234 <= view1[.width] 305 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 306 | XCTAssertTrue(view1.isEqual(x.firstItem)) 307 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 308 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 309 | XCTAssertNil(x.secondItem) 310 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 311 | XCTAssertEqual(x.multiplier, CGFloat(1)) 312 | XCTAssertEqual(x.constant, CGFloat(1234)) 313 | 314 | let intval = 1234 315 | x = intval <= view1[.width] 316 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 317 | XCTAssertTrue(view1.isEqual(x.firstItem)) 318 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 319 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 320 | XCTAssertNil(x.secondItem) 321 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 322 | XCTAssertEqual(x.multiplier, CGFloat(1)) 323 | XCTAssertEqual(x.constant, CGFloat(intval)) 324 | 325 | let floatval = 1234.0 326 | x = floatval <= view1[.width] 327 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 328 | XCTAssertTrue(view1.isEqual(x.firstItem)) 329 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 330 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 331 | XCTAssertNil(x.secondItem) 332 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 333 | XCTAssertEqual(x.multiplier, CGFloat(1)) 334 | XCTAssertEqual(x.constant, CGFloat(floatval)) 335 | } 336 | 337 | func test_operator_term_less_than_or_equal_term() { 338 | x = view1[.width] <= 12 * view2[.width] + 34 339 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 340 | XCTAssertTrue(view1.isEqual(x.firstItem)) 341 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 342 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 343 | XCTAssertTrue(view2.isEqual(x.secondItem)) 344 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 345 | XCTAssertEqual(x.multiplier, CGFloat(12)) 346 | XCTAssertEqual(x.constant, CGFloat(34)) 347 | } 348 | 349 | func test_operator_term_greater_than_or_equal_constant() { 350 | x = view1[.width] >= 1234 351 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 352 | XCTAssertTrue(view1.isEqual(x.firstItem)) 353 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 354 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 355 | XCTAssertNil(x.secondItem) 356 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 357 | XCTAssertEqual(x.multiplier, CGFloat(1)) 358 | XCTAssertEqual(x.constant, CGFloat(1234)) 359 | 360 | let intval = 1234 361 | x = view1[.width] >= intval 362 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 363 | XCTAssertTrue(view1.isEqual(x.firstItem)) 364 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 365 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 366 | XCTAssertNil(x.secondItem) 367 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 368 | XCTAssertEqual(x.multiplier, CGFloat(1)) 369 | XCTAssertEqual(x.constant, CGFloat(intval)) 370 | 371 | let floatval = 1234.0 372 | x = view1[.width] >= floatval 373 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 374 | XCTAssertTrue(view1.isEqual(x.firstItem)) 375 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 376 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 377 | XCTAssertNil(x.secondItem) 378 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 379 | XCTAssertEqual(x.multiplier, CGFloat(1)) 380 | XCTAssertEqual(x.constant, CGFloat(floatval)) 381 | } 382 | 383 | func test_operator_constant_greater_than_or_equal_term() { 384 | x = 1234 >= view1[.width] 385 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 386 | XCTAssertTrue(view1.isEqual(x.firstItem)) 387 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 388 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 389 | XCTAssertNil(x.secondItem) 390 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 391 | XCTAssertEqual(x.multiplier, CGFloat(1)) 392 | XCTAssertEqual(x.constant, CGFloat(1234)) 393 | 394 | let intval = 1234 395 | x = intval >= view1[.width] 396 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 397 | XCTAssertTrue(view1.isEqual(x.firstItem)) 398 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 399 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 400 | XCTAssertNil(x.secondItem) 401 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 402 | XCTAssertEqual(x.multiplier, CGFloat(1)) 403 | XCTAssertEqual(x.constant, CGFloat(intval)) 404 | 405 | let floatval = 1234.0 406 | x = floatval >= view1[.width] 407 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 408 | XCTAssertTrue(view1.isEqual(x.firstItem)) 409 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 410 | XCTAssertEqual(x.relation, NSLayoutRelation.lessThanOrEqual) 411 | XCTAssertNil(x.secondItem) 412 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.notAnAttribute) 413 | XCTAssertEqual(x.multiplier, CGFloat(1)) 414 | XCTAssertEqual(x.constant, CGFloat(floatval)) 415 | } 416 | 417 | func test_operator_term_greater_than_or_equal_term() { 418 | x = view1[.width] >= 12 * view2[.width] + 34 419 | XCTAssertTrue(x.isKind(of: NSLayoutConstraint.self)) 420 | XCTAssertTrue(view1.isEqual(x.firstItem)) 421 | XCTAssertEqual(x.firstAttribute, NSLayoutAttribute.width) 422 | XCTAssertEqual(x.relation, NSLayoutRelation.greaterThanOrEqual) 423 | XCTAssertTrue(view2.isEqual(x.secondItem)) 424 | XCTAssertEqual(x.secondAttribute, NSLayoutAttribute.width) 425 | XCTAssertEqual(x.multiplier, CGFloat(12)) 426 | XCTAssertEqual(x.constant, CGFloat(34)) 427 | } 428 | } 429 | -------------------------------------------------------------------------------- /SwiftyLayout.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | CC8814CC1E565AE100F0F2FB /* ConstraintTerm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814CB1E565AE100F0F2FB /* ConstraintTerm.swift */; }; 11 | CC8814CD1E565AE100F0F2FB /* ConstraintTerm.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814CB1E565AE100F0F2FB /* ConstraintTerm.swift */; }; 12 | CC8814D21E565BA000F0F2FB /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814D11E565BA000F0F2FB /* Operators.swift */; }; 13 | CC8814D31E565BA000F0F2FB /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814D11E565BA000F0F2FB /* Operators.swift */; }; 14 | CC8814D51E565BE300F0F2FB /* View+SwiftyLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814D41E565BE300F0F2FB /* View+SwiftyLayout.swift */; }; 15 | CC8814D61E565BE300F0F2FB /* View+SwiftyLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814D41E565BE300F0F2FB /* View+SwiftyLayout.swift */; }; 16 | CC8814D81E565C3C00F0F2FB /* UILayoutSupport+SwiftyLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC8814D71E565C3C00F0F2FB /* UILayoutSupport+SwiftyLayout.swift */; }; 17 | CC885D591BCB2AA8001B771F /* SwiftyLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = CC885D581BCB2AA8001B771F /* SwiftyLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 18 | CC885D601BCB2AA8001B771F /* SwiftyLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC885D551BCB2AA8001B771F /* SwiftyLayout.framework */; }; 19 | CC885D7E1BCB2C6A001B771F /* SwiftyLayout.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC885D741BCB2C69001B771F /* SwiftyLayout.framework */; }; 20 | CC885D961BCB322B001B771F /* SwiftyLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = CC885D581BCB2AA8001B771F /* SwiftyLayout.h */; settings = {ATTRIBUTES = (Public, ); }; }; 21 | CC885D9E1BCB32A1001B771F /* OperatorsWithUILayoutSupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885D9D1BCB32A1001B771F /* OperatorsWithUILayoutSupportTests.swift */; }; 22 | CC885D9F1BCB32AC001B771F /* OperatorsWithViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885D971BCB3283001B771F /* OperatorsWithViewTests.swift */; }; 23 | CC885DA01BCB32AD001B771F /* OperatorsWithViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885D971BCB3283001B771F /* OperatorsWithViewTests.swift */; }; 24 | CC885DA11BCB32B7001B771F /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885D981BCB3283001B771F /* TestHelper.swift */; }; 25 | CC885DA21BCB32B8001B771F /* TestHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = CC885D981BCB3283001B771F /* TestHelper.swift */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | CC885D611BCB2AA8001B771F /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = CC885D4C1BCB2AA8001B771F /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = CC885D541BCB2AA8001B771F; 34 | remoteInfo = SwiftyLayout; 35 | }; 36 | CC885D7F1BCB2C6A001B771F /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = CC885D4C1BCB2AA8001B771F /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = CC885D731BCB2C69001B771F; 41 | remoteInfo = SwiftyLayout; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | CC8814CB1E565AE100F0F2FB /* ConstraintTerm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ConstraintTerm.swift; path = SwiftyLayout/ConstraintTerm.swift; sourceTree = ""; }; 47 | CC8814D11E565BA000F0F2FB /* Operators.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Operators.swift; path = SwiftyLayout/Operators.swift; sourceTree = ""; }; 48 | CC8814D41E565BE300F0F2FB /* View+SwiftyLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "View+SwiftyLayout.swift"; path = "SwiftyLayout/View+SwiftyLayout.swift"; sourceTree = ""; }; 49 | CC8814D71E565C3C00F0F2FB /* UILayoutSupport+SwiftyLayout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UILayoutSupport+SwiftyLayout.swift"; path = "SwiftyLayout/UILayoutSupport+SwiftyLayout.swift"; sourceTree = ""; }; 50 | CC885D551BCB2AA8001B771F /* SwiftyLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | CC885D581BCB2AA8001B771F /* SwiftyLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SwiftyLayout.h; sourceTree = ""; }; 52 | CC885D5A1BCB2AA8001B771F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | CC885D5F1BCB2AA8001B771F /* SwiftyLayoutTests-iOS.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftyLayoutTests-iOS.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | CC885D661BCB2AA8001B771F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 55 | CC885D741BCB2C69001B771F /* SwiftyLayout.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyLayout.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 56 | CC885D7D1BCB2C69001B771F /* SwiftyLayoutTests-Mac.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftyLayoutTests-Mac.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | CC885D971BCB3283001B771F /* OperatorsWithViewTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperatorsWithViewTests.swift; sourceTree = ""; }; 58 | CC885D981BCB3283001B771F /* TestHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHelper.swift; sourceTree = ""; }; 59 | CC885D9D1BCB32A1001B771F /* OperatorsWithUILayoutSupportTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OperatorsWithUILayoutSupportTests.swift; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | CC885D511BCB2AA8001B771F /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | CC885D5C1BCB2AA8001B771F /* Frameworks */ = { 71 | isa = PBXFrameworksBuildPhase; 72 | buildActionMask = 2147483647; 73 | files = ( 74 | CC885D601BCB2AA8001B771F /* SwiftyLayout.framework in Frameworks */, 75 | ); 76 | runOnlyForDeploymentPostprocessing = 0; 77 | }; 78 | CC885D701BCB2C69001B771F /* Frameworks */ = { 79 | isa = PBXFrameworksBuildPhase; 80 | buildActionMask = 2147483647; 81 | files = ( 82 | ); 83 | runOnlyForDeploymentPostprocessing = 0; 84 | }; 85 | CC885D7A1BCB2C69001B771F /* Frameworks */ = { 86 | isa = PBXFrameworksBuildPhase; 87 | buildActionMask = 2147483647; 88 | files = ( 89 | CC885D7E1BCB2C6A001B771F /* SwiftyLayout.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | /* End PBXFrameworksBuildPhase section */ 94 | 95 | /* Begin PBXGroup section */ 96 | CC8814CA1E565A5100F0F2FB /* SwiftyLayout */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | CC8814CB1E565AE100F0F2FB /* ConstraintTerm.swift */, 100 | CC8814D11E565BA000F0F2FB /* Operators.swift */, 101 | CC8814D41E565BE300F0F2FB /* View+SwiftyLayout.swift */, 102 | CC8814D71E565C3C00F0F2FB /* UILayoutSupport+SwiftyLayout.swift */, 103 | ); 104 | name = SwiftyLayout; 105 | sourceTree = ""; 106 | }; 107 | CC885D4B1BCB2AA8001B771F = { 108 | isa = PBXGroup; 109 | children = ( 110 | CC885D571BCB2AA8001B771F /* SwiftyLayout */, 111 | CC885D631BCB2AA8001B771F /* SwiftyLayoutTests */, 112 | CC885D561BCB2AA8001B771F /* Products */, 113 | ); 114 | sourceTree = ""; 115 | }; 116 | CC885D561BCB2AA8001B771F /* Products */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | CC885D551BCB2AA8001B771F /* SwiftyLayout.framework */, 120 | CC885D5F1BCB2AA8001B771F /* SwiftyLayoutTests-iOS.xctest */, 121 | CC885D741BCB2C69001B771F /* SwiftyLayout.framework */, 122 | CC885D7D1BCB2C69001B771F /* SwiftyLayoutTests-Mac.xctest */, 123 | ); 124 | name = Products; 125 | sourceTree = ""; 126 | }; 127 | CC885D571BCB2AA8001B771F /* SwiftyLayout */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | CC8814CA1E565A5100F0F2FB /* SwiftyLayout */, 131 | CC885D581BCB2AA8001B771F /* SwiftyLayout.h */, 132 | CC885D5A1BCB2AA8001B771F /* Info.plist */, 133 | ); 134 | path = SwiftyLayout; 135 | sourceTree = ""; 136 | }; 137 | CC885D631BCB2AA8001B771F /* SwiftyLayoutTests */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | CC885D971BCB3283001B771F /* OperatorsWithViewTests.swift */, 141 | CC885D9D1BCB32A1001B771F /* OperatorsWithUILayoutSupportTests.swift */, 142 | CC885D981BCB3283001B771F /* TestHelper.swift */, 143 | CC885D661BCB2AA8001B771F /* Info.plist */, 144 | ); 145 | path = SwiftyLayoutTests; 146 | sourceTree = ""; 147 | }; 148 | /* End PBXGroup section */ 149 | 150 | /* Begin PBXHeadersBuildPhase section */ 151 | CC885D521BCB2AA8001B771F /* Headers */ = { 152 | isa = PBXHeadersBuildPhase; 153 | buildActionMask = 2147483647; 154 | files = ( 155 | CC885D591BCB2AA8001B771F /* SwiftyLayout.h in Headers */, 156 | ); 157 | runOnlyForDeploymentPostprocessing = 0; 158 | }; 159 | CC885D711BCB2C69001B771F /* Headers */ = { 160 | isa = PBXHeadersBuildPhase; 161 | buildActionMask = 2147483647; 162 | files = ( 163 | CC885D961BCB322B001B771F /* SwiftyLayout.h in Headers */, 164 | ); 165 | runOnlyForDeploymentPostprocessing = 0; 166 | }; 167 | /* End PBXHeadersBuildPhase section */ 168 | 169 | /* Begin PBXNativeTarget section */ 170 | CC885D541BCB2AA8001B771F /* SwiftyLayout-iOS */ = { 171 | isa = PBXNativeTarget; 172 | buildConfigurationList = CC885D691BCB2AA8001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayout-iOS" */; 173 | buildPhases = ( 174 | CC885D501BCB2AA8001B771F /* Sources */, 175 | CC885D511BCB2AA8001B771F /* Frameworks */, 176 | CC885D521BCB2AA8001B771F /* Headers */, 177 | CC885D531BCB2AA8001B771F /* Resources */, 178 | ); 179 | buildRules = ( 180 | ); 181 | dependencies = ( 182 | ); 183 | name = "SwiftyLayout-iOS"; 184 | productName = SwiftyLayout; 185 | productReference = CC885D551BCB2AA8001B771F /* SwiftyLayout.framework */; 186 | productType = "com.apple.product-type.framework"; 187 | }; 188 | CC885D5E1BCB2AA8001B771F /* SwiftyLayoutTests-iOS */ = { 189 | isa = PBXNativeTarget; 190 | buildConfigurationList = CC885D6C1BCB2AA8001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayoutTests-iOS" */; 191 | buildPhases = ( 192 | CC885D5B1BCB2AA8001B771F /* Sources */, 193 | CC885D5C1BCB2AA8001B771F /* Frameworks */, 194 | CC885D5D1BCB2AA8001B771F /* Resources */, 195 | ); 196 | buildRules = ( 197 | ); 198 | dependencies = ( 199 | CC885D621BCB2AA8001B771F /* PBXTargetDependency */, 200 | ); 201 | name = "SwiftyLayoutTests-iOS"; 202 | productName = SwiftyLayoutTests; 203 | productReference = CC885D5F1BCB2AA8001B771F /* SwiftyLayoutTests-iOS.xctest */; 204 | productType = "com.apple.product-type.bundle.unit-test"; 205 | }; 206 | CC885D731BCB2C69001B771F /* SwiftyLayout-Mac */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = CC885D891BCB2C6A001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayout-Mac" */; 209 | buildPhases = ( 210 | CC885D6F1BCB2C69001B771F /* Sources */, 211 | CC885D701BCB2C69001B771F /* Frameworks */, 212 | CC885D711BCB2C69001B771F /* Headers */, 213 | CC885D721BCB2C69001B771F /* Resources */, 214 | ); 215 | buildRules = ( 216 | ); 217 | dependencies = ( 218 | ); 219 | name = "SwiftyLayout-Mac"; 220 | productName = SwiftyLayout; 221 | productReference = CC885D741BCB2C69001B771F /* SwiftyLayout.framework */; 222 | productType = "com.apple.product-type.framework"; 223 | }; 224 | CC885D7C1BCB2C69001B771F /* SwiftyLayoutTests-Mac */ = { 225 | isa = PBXNativeTarget; 226 | buildConfigurationList = CC885D8A1BCB2C6A001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayoutTests-Mac" */; 227 | buildPhases = ( 228 | CC885D791BCB2C69001B771F /* Sources */, 229 | CC885D7A1BCB2C69001B771F /* Frameworks */, 230 | CC885D7B1BCB2C69001B771F /* Resources */, 231 | ); 232 | buildRules = ( 233 | ); 234 | dependencies = ( 235 | CC885D801BCB2C6A001B771F /* PBXTargetDependency */, 236 | ); 237 | name = "SwiftyLayoutTests-Mac"; 238 | productName = SwiftyLayoutTests; 239 | productReference = CC885D7D1BCB2C69001B771F /* SwiftyLayoutTests-Mac.xctest */; 240 | productType = "com.apple.product-type.bundle.unit-test"; 241 | }; 242 | /* End PBXNativeTarget section */ 243 | 244 | /* Begin PBXProject section */ 245 | CC885D4C1BCB2AA8001B771F /* Project object */ = { 246 | isa = PBXProject; 247 | attributes = { 248 | LastSwiftUpdateCheck = 0700; 249 | LastUpgradeCheck = 0820; 250 | ORGANIZATIONNAME = "Hisakuni Fujimoto"; 251 | TargetAttributes = { 252 | CC885D541BCB2AA8001B771F = { 253 | CreatedOnToolsVersion = 7.0.1; 254 | LastSwiftMigration = 0800; 255 | }; 256 | CC885D5E1BCB2AA8001B771F = { 257 | CreatedOnToolsVersion = 7.0.1; 258 | LastSwiftMigration = 0800; 259 | }; 260 | CC885D731BCB2C69001B771F = { 261 | CreatedOnToolsVersion = 7.0.1; 262 | }; 263 | CC885D7C1BCB2C69001B771F = { 264 | CreatedOnToolsVersion = 7.0.1; 265 | }; 266 | }; 267 | }; 268 | buildConfigurationList = CC885D4F1BCB2AA8001B771F /* Build configuration list for PBXProject "SwiftyLayout" */; 269 | compatibilityVersion = "Xcode 3.2"; 270 | developmentRegion = English; 271 | hasScannedForEncodings = 0; 272 | knownRegions = ( 273 | en, 274 | ); 275 | mainGroup = CC885D4B1BCB2AA8001B771F; 276 | productRefGroup = CC885D561BCB2AA8001B771F /* Products */; 277 | projectDirPath = ""; 278 | projectRoot = ""; 279 | targets = ( 280 | CC885D541BCB2AA8001B771F /* SwiftyLayout-iOS */, 281 | CC885D5E1BCB2AA8001B771F /* SwiftyLayoutTests-iOS */, 282 | CC885D731BCB2C69001B771F /* SwiftyLayout-Mac */, 283 | CC885D7C1BCB2C69001B771F /* SwiftyLayoutTests-Mac */, 284 | ); 285 | }; 286 | /* End PBXProject section */ 287 | 288 | /* Begin PBXResourcesBuildPhase section */ 289 | CC885D531BCB2AA8001B771F /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | runOnlyForDeploymentPostprocessing = 0; 295 | }; 296 | CC885D5D1BCB2AA8001B771F /* Resources */ = { 297 | isa = PBXResourcesBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | runOnlyForDeploymentPostprocessing = 0; 302 | }; 303 | CC885D721BCB2C69001B771F /* Resources */ = { 304 | isa = PBXResourcesBuildPhase; 305 | buildActionMask = 2147483647; 306 | files = ( 307 | ); 308 | runOnlyForDeploymentPostprocessing = 0; 309 | }; 310 | CC885D7B1BCB2C69001B771F /* Resources */ = { 311 | isa = PBXResourcesBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | }; 317 | /* End PBXResourcesBuildPhase section */ 318 | 319 | /* Begin PBXSourcesBuildPhase section */ 320 | CC885D501BCB2AA8001B771F /* Sources */ = { 321 | isa = PBXSourcesBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | CC8814D21E565BA000F0F2FB /* Operators.swift in Sources */, 325 | CC8814D51E565BE300F0F2FB /* View+SwiftyLayout.swift in Sources */, 326 | CC8814D81E565C3C00F0F2FB /* UILayoutSupport+SwiftyLayout.swift in Sources */, 327 | CC8814CC1E565AE100F0F2FB /* ConstraintTerm.swift in Sources */, 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | }; 331 | CC885D5B1BCB2AA8001B771F /* Sources */ = { 332 | isa = PBXSourcesBuildPhase; 333 | buildActionMask = 2147483647; 334 | files = ( 335 | CC885DA21BCB32B8001B771F /* TestHelper.swift in Sources */, 336 | CC885D9F1BCB32AC001B771F /* OperatorsWithViewTests.swift in Sources */, 337 | CC885D9E1BCB32A1001B771F /* OperatorsWithUILayoutSupportTests.swift in Sources */, 338 | ); 339 | runOnlyForDeploymentPostprocessing = 0; 340 | }; 341 | CC885D6F1BCB2C69001B771F /* Sources */ = { 342 | isa = PBXSourcesBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | CC8814D61E565BE300F0F2FB /* View+SwiftyLayout.swift in Sources */, 346 | CC8814CD1E565AE100F0F2FB /* ConstraintTerm.swift in Sources */, 347 | CC8814D31E565BA000F0F2FB /* Operators.swift in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | CC885D791BCB2C69001B771F /* Sources */ = { 352 | isa = PBXSourcesBuildPhase; 353 | buildActionMask = 2147483647; 354 | files = ( 355 | CC885DA01BCB32AD001B771F /* OperatorsWithViewTests.swift in Sources */, 356 | CC885DA11BCB32B7001B771F /* TestHelper.swift in Sources */, 357 | ); 358 | runOnlyForDeploymentPostprocessing = 0; 359 | }; 360 | /* End PBXSourcesBuildPhase section */ 361 | 362 | /* Begin PBXTargetDependency section */ 363 | CC885D621BCB2AA8001B771F /* PBXTargetDependency */ = { 364 | isa = PBXTargetDependency; 365 | target = CC885D541BCB2AA8001B771F /* SwiftyLayout-iOS */; 366 | targetProxy = CC885D611BCB2AA8001B771F /* PBXContainerItemProxy */; 367 | }; 368 | CC885D801BCB2C6A001B771F /* PBXTargetDependency */ = { 369 | isa = PBXTargetDependency; 370 | target = CC885D731BCB2C69001B771F /* SwiftyLayout-Mac */; 371 | targetProxy = CC885D7F1BCB2C6A001B771F /* PBXContainerItemProxy */; 372 | }; 373 | /* End PBXTargetDependency section */ 374 | 375 | /* Begin XCBuildConfiguration section */ 376 | CC885D671BCB2AA8001B771F /* Debug */ = { 377 | isa = XCBuildConfiguration; 378 | buildSettings = { 379 | ALWAYS_SEARCH_USER_PATHS = NO; 380 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 381 | CLANG_CXX_LIBRARY = "libc++"; 382 | CLANG_ENABLE_MODULES = YES; 383 | CLANG_ENABLE_OBJC_ARC = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_CONSTANT_CONVERSION = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INFINITE_RECURSION = YES; 390 | CLANG_WARN_INT_CONVERSION = YES; 391 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 392 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 393 | CLANG_WARN_UNREACHABLE_CODE = YES; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 396 | COPY_PHASE_STRIP = NO; 397 | CURRENT_PROJECT_VERSION = 402; 398 | DEBUG_INFORMATION_FORMAT = dwarf; 399 | ENABLE_STRICT_OBJC_MSGSEND = YES; 400 | ENABLE_TESTABILITY = YES; 401 | GCC_C_LANGUAGE_STANDARD = gnu99; 402 | GCC_DYNAMIC_NO_PIC = NO; 403 | GCC_NO_COMMON_BLOCKS = YES; 404 | GCC_OPTIMIZATION_LEVEL = 0; 405 | GCC_PREPROCESSOR_DEFINITIONS = ( 406 | "DEBUG=1", 407 | "$(inherited)", 408 | ); 409 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 410 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 411 | GCC_WARN_UNDECLARED_SELECTOR = YES; 412 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 413 | GCC_WARN_UNUSED_FUNCTION = YES; 414 | GCC_WARN_UNUSED_VARIABLE = YES; 415 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 416 | MACOSX_DEPLOYMENT_TARGET = 10.10; 417 | MTL_ENABLE_DEBUG_INFO = YES; 418 | ONLY_ACTIVE_ARCH = YES; 419 | SDKROOT = iphoneos; 420 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 421 | TARGETED_DEVICE_FAMILY = "1,2"; 422 | VERSIONING_SYSTEM = "apple-generic"; 423 | VERSION_INFO_PREFIX = ""; 424 | }; 425 | name = Debug; 426 | }; 427 | CC885D681BCB2AA8001B771F /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | buildSettings = { 430 | ALWAYS_SEARCH_USER_PATHS = NO; 431 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 432 | CLANG_CXX_LIBRARY = "libc++"; 433 | CLANG_ENABLE_MODULES = YES; 434 | CLANG_ENABLE_OBJC_ARC = YES; 435 | CLANG_WARN_BOOL_CONVERSION = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_EMPTY_BODY = YES; 439 | CLANG_WARN_ENUM_CONVERSION = YES; 440 | CLANG_WARN_INFINITE_RECURSION = YES; 441 | CLANG_WARN_INT_CONVERSION = YES; 442 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 443 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 444 | CLANG_WARN_UNREACHABLE_CODE = YES; 445 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 446 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 447 | COPY_PHASE_STRIP = NO; 448 | CURRENT_PROJECT_VERSION = 402; 449 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 450 | ENABLE_NS_ASSERTIONS = NO; 451 | ENABLE_STRICT_OBJC_MSGSEND = YES; 452 | GCC_C_LANGUAGE_STANDARD = gnu99; 453 | GCC_NO_COMMON_BLOCKS = YES; 454 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 455 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 456 | GCC_WARN_UNDECLARED_SELECTOR = YES; 457 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 458 | GCC_WARN_UNUSED_FUNCTION = YES; 459 | GCC_WARN_UNUSED_VARIABLE = YES; 460 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 461 | MACOSX_DEPLOYMENT_TARGET = 10.10; 462 | MTL_ENABLE_DEBUG_INFO = NO; 463 | SDKROOT = iphoneos; 464 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 465 | TARGETED_DEVICE_FAMILY = "1,2"; 466 | VALIDATE_PRODUCT = YES; 467 | VERSIONING_SYSTEM = "apple-generic"; 468 | VERSION_INFO_PREFIX = ""; 469 | }; 470 | name = Release; 471 | }; 472 | CC885D6A1BCB2AA8001B771F /* Debug */ = { 473 | isa = XCBuildConfiguration; 474 | buildSettings = { 475 | CLANG_ENABLE_MODULES = YES; 476 | CODE_SIGN_IDENTITY = "iPhone Developer"; 477 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 478 | DEFINES_MODULE = YES; 479 | DYLIB_COMPATIBILITY_VERSION = 1; 480 | DYLIB_CURRENT_VERSION = 402; 481 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 482 | INFOPLIST_FILE = SwiftyLayout/Info.plist; 483 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 484 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 485 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayout; 486 | PRODUCT_NAME = SwiftyLayout; 487 | SKIP_INSTALL = YES; 488 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 489 | SWIFT_VERSION = 3.0; 490 | }; 491 | name = Debug; 492 | }; 493 | CC885D6B1BCB2AA8001B771F /* Release */ = { 494 | isa = XCBuildConfiguration; 495 | buildSettings = { 496 | CLANG_ENABLE_MODULES = YES; 497 | CODE_SIGN_IDENTITY = "iPhone Distribution"; 498 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 499 | DEFINES_MODULE = YES; 500 | DYLIB_COMPATIBILITY_VERSION = 1; 501 | DYLIB_CURRENT_VERSION = 402; 502 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 503 | INFOPLIST_FILE = SwiftyLayout/Info.plist; 504 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 505 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 506 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayout; 507 | PRODUCT_NAME = SwiftyLayout; 508 | SKIP_INSTALL = YES; 509 | SWIFT_VERSION = 3.0; 510 | }; 511 | name = Release; 512 | }; 513 | CC885D6D1BCB2AA8001B771F /* Debug */ = { 514 | isa = XCBuildConfiguration; 515 | buildSettings = { 516 | CLANG_ENABLE_MODULES = YES; 517 | INFOPLIST_FILE = SwiftyLayoutTests/Info.plist; 518 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 519 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayoutTests; 520 | PRODUCT_NAME = "$(TARGET_NAME)"; 521 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 522 | SWIFT_VERSION = 3.0; 523 | }; 524 | name = Debug; 525 | }; 526 | CC885D6E1BCB2AA8001B771F /* Release */ = { 527 | isa = XCBuildConfiguration; 528 | buildSettings = { 529 | CLANG_ENABLE_MODULES = YES; 530 | INFOPLIST_FILE = SwiftyLayoutTests/Info.plist; 531 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 532 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayoutTests; 533 | PRODUCT_NAME = "$(TARGET_NAME)"; 534 | SWIFT_VERSION = 3.0; 535 | }; 536 | name = Release; 537 | }; 538 | CC885D851BCB2C6A001B771F /* Debug */ = { 539 | isa = XCBuildConfiguration; 540 | buildSettings = { 541 | CLANG_ENABLE_MODULES = YES; 542 | COMBINE_HIDPI_IMAGES = YES; 543 | DEFINES_MODULE = YES; 544 | DYLIB_COMPATIBILITY_VERSION = 1; 545 | DYLIB_CURRENT_VERSION = 402; 546 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 547 | FRAMEWORK_VERSION = A; 548 | INFOPLIST_FILE = SwiftyLayout/Info.plist; 549 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 550 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 551 | MACOSX_DEPLOYMENT_TARGET = 10.10; 552 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayout; 553 | PRODUCT_NAME = SwiftyLayout; 554 | SDKROOT = macosx; 555 | SKIP_INSTALL = YES; 556 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 557 | SWIFT_VERSION = 3.0; 558 | }; 559 | name = Debug; 560 | }; 561 | CC885D861BCB2C6A001B771F /* Release */ = { 562 | isa = XCBuildConfiguration; 563 | buildSettings = { 564 | CLANG_ENABLE_MODULES = YES; 565 | COMBINE_HIDPI_IMAGES = YES; 566 | DEFINES_MODULE = YES; 567 | DYLIB_COMPATIBILITY_VERSION = 1; 568 | DYLIB_CURRENT_VERSION = 402; 569 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 570 | FRAMEWORK_VERSION = A; 571 | INFOPLIST_FILE = SwiftyLayout/Info.plist; 572 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 573 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 574 | MACOSX_DEPLOYMENT_TARGET = 10.10; 575 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayout; 576 | PRODUCT_NAME = SwiftyLayout; 577 | SDKROOT = macosx; 578 | SKIP_INSTALL = YES; 579 | SWIFT_VERSION = 3.0; 580 | }; 581 | name = Release; 582 | }; 583 | CC885D871BCB2C6A001B771F /* Debug */ = { 584 | isa = XCBuildConfiguration; 585 | buildSettings = { 586 | COMBINE_HIDPI_IMAGES = YES; 587 | INFOPLIST_FILE = SwiftyLayoutTests/Info.plist; 588 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 589 | MACOSX_DEPLOYMENT_TARGET = 10.11; 590 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayoutTests; 591 | PRODUCT_NAME = "$(TARGET_NAME)"; 592 | SDKROOT = macosx; 593 | SWIFT_VERSION = 3.0; 594 | }; 595 | name = Debug; 596 | }; 597 | CC885D881BCB2C6A001B771F /* Release */ = { 598 | isa = XCBuildConfiguration; 599 | buildSettings = { 600 | COMBINE_HIDPI_IMAGES = YES; 601 | INFOPLIST_FILE = SwiftyLayoutTests/Info.plist; 602 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; 603 | MACOSX_DEPLOYMENT_TARGET = 10.11; 604 | PRODUCT_BUNDLE_IDENTIFIER = com.fobj.SwiftyLayoutTests; 605 | PRODUCT_NAME = "$(TARGET_NAME)"; 606 | SDKROOT = macosx; 607 | SWIFT_VERSION = 3.0; 608 | }; 609 | name = Release; 610 | }; 611 | /* End XCBuildConfiguration section */ 612 | 613 | /* Begin XCConfigurationList section */ 614 | CC885D4F1BCB2AA8001B771F /* Build configuration list for PBXProject "SwiftyLayout" */ = { 615 | isa = XCConfigurationList; 616 | buildConfigurations = ( 617 | CC885D671BCB2AA8001B771F /* Debug */, 618 | CC885D681BCB2AA8001B771F /* Release */, 619 | ); 620 | defaultConfigurationIsVisible = 0; 621 | defaultConfigurationName = Release; 622 | }; 623 | CC885D691BCB2AA8001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayout-iOS" */ = { 624 | isa = XCConfigurationList; 625 | buildConfigurations = ( 626 | CC885D6A1BCB2AA8001B771F /* Debug */, 627 | CC885D6B1BCB2AA8001B771F /* Release */, 628 | ); 629 | defaultConfigurationIsVisible = 0; 630 | defaultConfigurationName = Release; 631 | }; 632 | CC885D6C1BCB2AA8001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayoutTests-iOS" */ = { 633 | isa = XCConfigurationList; 634 | buildConfigurations = ( 635 | CC885D6D1BCB2AA8001B771F /* Debug */, 636 | CC885D6E1BCB2AA8001B771F /* Release */, 637 | ); 638 | defaultConfigurationIsVisible = 0; 639 | defaultConfigurationName = Release; 640 | }; 641 | CC885D891BCB2C6A001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayout-Mac" */ = { 642 | isa = XCConfigurationList; 643 | buildConfigurations = ( 644 | CC885D851BCB2C6A001B771F /* Debug */, 645 | CC885D861BCB2C6A001B771F /* Release */, 646 | ); 647 | defaultConfigurationIsVisible = 0; 648 | defaultConfigurationName = Release; 649 | }; 650 | CC885D8A1BCB2C6A001B771F /* Build configuration list for PBXNativeTarget "SwiftyLayoutTests-Mac" */ = { 651 | isa = XCConfigurationList; 652 | buildConfigurations = ( 653 | CC885D871BCB2C6A001B771F /* Debug */, 654 | CC885D881BCB2C6A001B771F /* Release */, 655 | ); 656 | defaultConfigurationIsVisible = 0; 657 | defaultConfigurationName = Release; 658 | }; 659 | /* End XCConfigurationList section */ 660 | }; 661 | rootObject = CC885D4C1BCB2AA8001B771F /* Project object */; 662 | } 663 | -------------------------------------------------------------------------------- /SampleApp-Mac/SampleApp-Mac/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | Default 539 | 540 | 541 | 542 | 543 | 544 | 545 | Left to Right 546 | 547 | 548 | 549 | 550 | 551 | 552 | Right to Left 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | Default 564 | 565 | 566 | 567 | 568 | 569 | 570 | Left to Right 571 | 572 | 573 | 574 | 575 | 576 | 577 | Right to Left 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | --------------------------------------------------------------------------------