3lvis / Form

The most flexible and powerful way to build a form on iOS

Home Page:http://hyper.no

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build in Xcode 8 due to Hex pod's use of old Swift syntax

iosdev-republicofapps opened this issue · comments

This Form pod is awesome, and I'm eager to use it! Thanks so much for sharing it. :-)

I'm trying to build in Xcode 8.2.1 (8C1002) on OS X 10.12.3. My app has an iOS 10 target and is pure Objective-C.

When I add the Form pod, Xcode asks if it can convert the Hex pod from Swift 2.3 to Swift 3. I tell it no, because I don't want to convert a Pod dependency since I should treat local pods as readonly. Then Xcode warns me that due to Hex's outdated Swift syntax, it won't be able to build properly and that certain "editor features" may not work right ...

I tried to build but got the error:

Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Xcode is talking about Hex here, as a Form dependency.

I looked at the Hex pod and it's a short super-simple hex converter for colors. I have categories that do this ... Any chance you'd be willing to accept a PR to remove Hex as a dependency of Form and accept my contribution of an objective C replacement? :-)

Or alternatively, are there replacements for Hex or a newer version of Hex that won't have this issue?

As it stands, I can't build Form in Objective-C in Xcode 8 for an iOS 10 target.

Thanks! I'm happy to help however I can

OK, this seems to fix it http://www.ios-blog.co.uk/tutorials/xcode/quick-tip-fix-use-legacy-swift-issue-in-xcode-8-beta-3/ but it would still be nice to remove Hex if possible since it's such a small dependency and an Objective-C replacement would clear this up for others ... :-) What are your thoughts on this?

Basically, I had to add the following to the end of my Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

That feels gross, but it works!

Thanks again!

@iosdev-republicofapps Makes sense, I'm gonna drop it!

Thanks @3lvis ! I will upgrade to 3.13.0.