0001 // 0002 // SnapKit 0003 // 0004 // Copyright (c) 2011-2015 SnapKit Team - https://github.com/SnapKit 0005 // 0006 // Permission is hereby granted, free of charge, to any person obtaining a copy 0007 // of this software and associated documentation files (the "Software"), to deal 0008 // in the Software without restriction, including without limitation the rights 0009 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 0010 // copies of the Software, and to permit persons to whom the Software is 0011 // furnished to do so, subject to the following conditions: 0012 // 0013 // The above copyright notice and this permission notice shall be included in 0014 // all copies or substantial portions of the Software. 0015 // 0016 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 0017 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 0018 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 0019 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 0020 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 0021 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 0022 // THE SOFTWARE. 0023 0024 #if os(iOS) || os(tvOS) 0025 import UIKit 0026 #else 0027 import AppKit 0028 #endif 0029 0030 /** 0031 Used to define `NSLayoutRelation` 0032 */ 0033 internal enum ConstraintRelation: Int { 0034 case Equal
Constraint.swift:174 private let relation: ConstraintRelationConstraint.swift:198 internal init(fromItem: ConstraintItem, toItem: ConstraintItem, relation: ConstraintRelation, constant: Any, multiplier: Float, priority: Float) {ConstraintDescription.swift:505 private var relation: ConstraintRelation? {ConstraintDescription.swift:542 private func constrainTo(other: ConstraintItem, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:559 private func constrainTo(other: View, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:564 private func constrainTo(other: LayoutSupport, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:569 private func constrainTo(other: NSLayoutAnchor, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:573 private func constrainTo(other: Float, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:578 private func constrainTo(other: Double, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:583 private func constrainTo(other: CGSize, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:588 private func constrainTo(other: CGPoint, relation: ConstraintRelation) -> ConstraintDescription {ConstraintDescription.swift:593 private func constrainTo(other: EdgeInsets, relation: ConstraintRelation) -> ConstraintDescription {= 1, LessThanOrEqualTo
ConstraintDescription.swift:224 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:227 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:231 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:235 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:238 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:241 return self.constrainTo(Float(other), relation: .Equal)ConstraintDescription.swift:244 return self.constrainTo(Float(other), relation: .Equal)ConstraintDescription.swift:247 return self.constrainTo(Float(other), relation: .Equal)ConstraintDescription.swift:250 return self.constrainTo(Float(other), relation: .Equal)ConstraintDescription.swift:253 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:256 return self.constrainTo(other, relation: .Equal)ConstraintDescription.swift:259 return self.constrainTo(other, relation: .Equal), GreaterThanOrEqualTo
ConstraintDescription.swift:265 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:268 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:272 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:276 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:279 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:282 return self.constrainTo(Float(other), relation: .LessThanOrEqualTo)ConstraintDescription.swift:285 return self.constrainTo(Float(other), relation: .LessThanOrEqualTo)ConstraintDescription.swift:288 return self.constrainTo(Float(other), relation: .LessThanOrEqualTo)ConstraintDescription.swift:291 return self.constrainTo(Float(other), relation: .LessThanOrEqualTo)ConstraintDescription.swift:294 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:297 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:300 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintDescription.swift:317 return self.constrainTo(other, relation: .LessThanOrEqualTo)ConstraintRelation.swift:39 case .LessThanOrEqualTo:0035 0036 internal var layoutRelation
ConstraintDescription.swift:306 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:309 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:313 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:320 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:323 return self.constrainTo(Float(other), relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:326 return self.constrainTo(Float(other), relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:329 return self.constrainTo(Float(other), relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:332 return self.constrainTo(Float(other), relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:335 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:338 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintDescription.swift:341 return self.constrainTo(other, relation: .GreaterThanOrEqualTo)ConstraintRelation.swift:41 case .GreaterThanOrEqualTo:: NSLayoutRelation { 0037 get { 0038 switch(self) { 0039 case .LessThanOrEqualTo: 0040 return .LessThanOrEqual 0041 case .GreaterThanOrEqualTo: 0042 return .GreaterThanOrEqual 0043 default: 0044 return .Equal 0045 } 0046 } 0047 } 0048 }
Constraint.swift:244 let layoutRelation: NSLayoutRelation = self.relation.layoutRelation