diff --git a/ParallaxHeader.xcodeproj/project.pbxproj b/ParallaxHeader.xcodeproj/project.pbxproj index ec502e6..fec95e8 100644 --- a/ParallaxHeader.xcodeproj/project.pbxproj +++ b/ParallaxHeader.xcodeproj/project.pbxproj @@ -462,6 +462,7 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, Base, ); @@ -791,7 +792,7 @@ SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -814,7 +815,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_SWIFT3_OBJC_INFERENCE = On; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; diff --git a/ParallaxHeader/ParallaxHeader.swift b/ParallaxHeader/ParallaxHeader.swift index 1ab049a..49483f2 100644 --- a/ParallaxHeader/ParallaxHeader.swift +++ b/ParallaxHeader/ParallaxHeader.swift @@ -14,8 +14,8 @@ public typealias ParallaxHeaderHandlerBlock = (_ parallaxHeader: ParallaxHeader) private let parallaxHeaderKVOContext = UnsafeMutableRawPointer.allocate( - bytes: 4, - alignedTo: 1 + byteCount: 4, + alignment: 1 ) class ParallaxView: UIView { @@ -225,7 +225,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -233,7 +233,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -250,7 +250,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -258,7 +258,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:|[v(==height)]", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: metrics, views: binding ) @@ -276,7 +276,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -284,7 +284,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:|[v(>=height)]-0.0@highPriority-|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: metrics, views: binding ) @@ -298,7 +298,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -307,10 +307,10 @@ public class ParallaxHeader: NSObject { contentView.addConstraint( NSLayoutConstraint( item: view, - attribute: NSLayoutAttribute.centerY, - relatedBy: NSLayoutRelation.equal, + attribute: NSLayoutConstraint.Attribute.centerY, + relatedBy: NSLayoutConstraint.Relation.equal, toItem: contentView, - attribute: NSLayoutAttribute.centerY, + attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0 ) @@ -318,10 +318,10 @@ public class ParallaxHeader: NSObject { contentView.addConstraint( NSLayoutConstraint( item: view, - attribute: NSLayoutAttribute.centerX, - relatedBy: NSLayoutRelation.equal, + attribute: NSLayoutConstraint.Attribute.centerX, + relatedBy: NSLayoutConstraint.Relation.equal, toItem: contentView, - attribute: NSLayoutAttribute.centerX, + attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0 ) @@ -339,7 +339,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -347,7 +347,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:|-0@highPriority-[v(>=height)]-0@highPriority-|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: metrics, views: binding ) @@ -356,10 +356,10 @@ public class ParallaxHeader: NSObject { contentView.addConstraint( NSLayoutConstraint( item: view, - attribute: NSLayoutAttribute.centerY, - relatedBy: NSLayoutRelation.equal, + attribute: NSLayoutConstraint.Attribute.centerY, + relatedBy: NSLayoutConstraint.Relation.equal, toItem: contentView, - attribute: NSLayoutAttribute.centerY, + attribute: NSLayoutConstraint.Attribute.centerY, multiplier: 1, constant: 0 ) @@ -367,10 +367,10 @@ public class ParallaxHeader: NSObject { contentView.addConstraint( NSLayoutConstraint( item: view, - attribute: NSLayoutAttribute.centerX, - relatedBy: NSLayoutRelation.equal, + attribute: NSLayoutConstraint.Attribute.centerX, + relatedBy: NSLayoutConstraint.Relation.equal, toItem: contentView, - attribute: NSLayoutAttribute.centerX, + attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0 ) @@ -387,7 +387,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -395,7 +395,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:[v(==height)]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: metrics, views: binding ) @@ -413,7 +413,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "H:|[v]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: nil, views: binding ) @@ -421,7 +421,7 @@ public class ParallaxHeader: NSObject { contentView.addConstraints( NSLayoutConstraint.constraints( withVisualFormat: "V:|-0.0@highPriority-[v(>=height)]|", - options: NSLayoutFormatOptions(rawValue: 0), + options: NSLayoutConstraint.FormatOptions(rawValue: 0), metrics: metrics, views: binding )