Snapkit: Unable to build in Xcode 9 GM

Created on 17 Sep 2017  Â·  10Comments  Â·  Source: SnapKit/SnapKit

New Issue Checklist

🚫 If this template is not filled out your issue will be closed with no comment. 🚫

  • [x] I have looked at the Documentation
  • [x] I have read the F.A.Q.
  • [x] I have filled out this issue template.

Issue Info

Info | Value |
-------------------------|-------------------------------------|
Platform | ios
Platform Version | 11.0 / Xcode 9 GM
SnapKit Version | 4.0.0
Integration Method | cocoapods

Issue Description

So I am using the latest Xcode 9 GM and when I try to build and run, it got below fatal errors

  1. ConstraintViewDSL.swift
self.view.contentHuggingPriority(for: .horizontal).rawValue 

Error: Value of type 'UILayoutPriority' (aka 'Float') has no member 'rawValue'
  1. ConstraintViewDSL.swift
self.view.setContentHuggingPriority(LayoutPriority(rawValue: newValue), for: .horizontal)

Error: Argument labels '(rawValue:)' do not match any available overloads
  1. Constraint.swift
if (layoutConstraint.priority.hashValue < requiredPriority), (self.priority.constraintPriorityTargetValue != requiredPriority) {
    layoutConstraint.priority = LayoutPriority(rawValue: self.priority.constraintPriorityTargetValue)
}

Error1 : Binary operator '<' cannot be applied to operands of type 'Int' and 'Float' at line 246   
Error2 : Argument labels '(rawValue:)' do not match any available overloads at line 247
  1. Debugging.swift
if self.priority.rawValue != 1000.0 {
    description += " ^\(self.priority)"
}

Error: Value of type 'UILayoutPriority' (aka 'Float') has no member 'rawValue'

Most helpful comment

@leandromperez I have the same issue, and I tried to install 3.2.0 it worked.

pod 'SnapKit', '~> 3.2.0'

All 10 comments

I am seeing this same issue, why closed?

Make sure you clean your DerivedData folder and are using the tagged v4.0.0 release. It should be great!

I cleaned DerivedData and Installed SnapKit 4.0.0 (was 3.2.0), but I have the same issue

@dkorkin how are you integrating it? Does it work if you just download a .tar.gz from this repo and load up the project file and build it?

@robertjpayne I used cocoapods, pod cache --all clean and pod install

@robertjpayne downloaded repo perfectly works

@dkorkin sounds like Cocoapods cannot support both Swift 4.0 and Swift 3.2 at the same time, you need to continue to use version 3.2.0 until all your pods are Swift 4.0.

For what it's worth functionally there is zero difference…

@robertjpayne yes, just got this solution, thanks!

@dkorkin did you manage to solve it? I am facing the same issue and cannot find a solution.
@robertjpayne Perhaps you could point me in the right direction?

Swift 4
XCode Version 9.0 (9A235)
this is in my podfile:

platform :ios, '10.0'
...
use_frameworks!
...
pod 'SnapKit', '~> 4.0.0' #Layout constraints made easy

@leandromperez I have the same issue, and I tried to install 3.2.0 it worked.

pod 'SnapKit', '~> 3.2.0'
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sprint84 picture sprint84  Â·  16Comments

cooler333 picture cooler333  Â·  5Comments

fcy picture fcy  Â·  10Comments

mortyccp picture mortyccp  Â·  26Comments

swiftli picture swiftli  Â·  9Comments