romansorochak / ParallaxHeader

Simple way to add parallax header to UIScrollView/UITableView written in Swift.
MIT License
1.03k stars 131 forks source link

Swift 4.2 Compiler Error #37

Open evyasafm opened 5 years ago

evyasafm commented 5 years ago

Swift 4.2 compiler error: 'NSLayoutFormatOptions' has been renamed to 'NSLayoutConstraint.FormatOptions'

ericdesa commented 5 years ago

As a workaround, I add the code bellow at the end of my Podfile to force the ParallaxHeader swift version

post_install do |installer|
    swift4_0_targets = ["ParallaxHeader"]

    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
             if swift4_0_targets.include? target.name
                config.build_settings['SWIFT_VERSION'] = '4.0'
            end
        end
    end
end
asadjamil commented 5 years ago

I have changed older version swift code to latest swift version and it works fine.