Info | Value |
-------------------------|-------------------------------------|
Platform | iOS
Platform Version | iOS 12 Developer Beta
SnapKit Version | 4.0.0
Integration Method | cocoapods
When using SnapKit 4.0.0 with Xcode 10 Beta and swift 4, the project can not be compiled successfully. The error message is 'NSLayoutAttribute' has been renamed to 'NSLayoutConstraint.Attribute'. I have tried to clean build folder, but still error.
The error is caused by API changes in iOS 12. The commit #516 may has solved the problem.
Any idea about a new release for iOS 12 ? The recent version 4.0 is released on Sep 2017.
Until this is solved with an official iOS 12 / Swift 4.2 release, you can add something like this to your Podfile to ensure SnapKit continues to use Swift 4.1:
swift_4_1_pod_targets = ['SnapKit']
post_install do | installer |
installer.pods_project.targets.each do |target|
if swift_4_1_pod_targets.include?(target.name)
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '4.1'
end
end
end
end
Most helpful comment
Until this is solved with an official iOS 12 / Swift 4.2 release, you can add something like this to your Podfile to ensure SnapKit continues to use Swift 4.1: