diff --git a/Constrainable.xcodeproj/project.pbxproj b/Constrainable.xcodeproj/project.pbxproj index efde415..844e466 100644 --- a/Constrainable.xcodeproj/project.pbxproj +++ b/Constrainable.xcodeproj/project.pbxproj @@ -97,7 +97,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0920; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = SimoneConnola; TargetAttributes = { 1D0F27BE2032F1610081802A = { @@ -161,6 +161,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -168,6 +169,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; @@ -221,6 +223,7 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_EMPTY_BODY = YES; @@ -228,6 +231,7 @@ CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; diff --git a/Constrainable.xcodeproj/xcshareddata/xcschemes/Constrainable.xcscheme b/Constrainable.xcodeproj/xcshareddata/xcschemes/Constrainable.xcscheme index 6ed0c0f..e222278 100644 --- a/Constrainable.xcodeproj/xcshareddata/xcschemes/Constrainable.xcscheme +++ b/Constrainable.xcodeproj/xcshareddata/xcschemes/Constrainable.xcscheme @@ -1,6 +1,6 @@ NSLayoutConstraint { - let constraint = bind(constraintDescription) - NSLayoutConstraint.activate([constraint]) - return constraint + + @discardableResult func activate(_ constraintDescriptions: Constraint...) -> [NSLayoutConstraint] { + let constraints = bind(constraintDescriptions) + NSLayoutConstraint.activate(constraints) + return constraints } @discardableResult func bind(_ constraintDescriptions: [Constraint]) -> [NSLayoutConstraint] { @@ -48,13 +48,13 @@ public extension Constrainable { let constraints = constraintDescriptions.map { $0(self) } return constraints } - - @discardableResult func bind(_ constraintDescription: Constraint) -> NSLayoutConstraint { + + @discardableResult func bind(_ constraintDescriptions: Constraint...) -> [NSLayoutConstraint] { if let view = self as? UIView { view.translatesAutoresizingMaskIntoConstraints = false } - let constraint = constraintDescription(self) - return constraint + let constraints = constraintDescriptions.map { $0(self) } + return constraints } } diff --git a/Constrainable/Info.plist b/Constrainable/Info.plist index 8d28050..eaff526 100644 --- a/Constrainable/Info.plist +++ b/Constrainable/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.1.6 + 0.1.7 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass