luispadron / UIEmptyState

An empty state control to give visually appealing context when building iOS applications.
MIT License
178 stars 34 forks source link

Cannot build with Swift 4.1 #25

Closed igorkulman closed 6 years ago

igorkulman commented 6 years ago

Adding the library to a Xcode 9.4.1 (Swift 4.1) project using Carthage results in an error when building

    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -emit-bc /Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src/UIEmptyState/UIViewController+UIEmptyState.swift /Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src/UIEmptyState/UIEmptyStateDataSource.swift /Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src/UIEmptyState/UIEmptyStateDelegate.swift /Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src/UIEmptyState/UIEmptyStateView.swift -target armv7-apple-ios9.0 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -I /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/BuildProductsPath/Release-iphoneos -F /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/BuildProductsPath/Release-iphoneos -g -import-underlying-module -module-cache-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/ModuleCache.noindex -swift-version 4 -O -serialize-debugging-options -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/UIEmptyState-generated-files.hmap -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/UIEmptyState-own-target-headers.hmap -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/UIEmptyState-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/UIEmptyState-project-headers.hmap -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/BuildProductsPath/Release-iphoneos/include -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/DerivedSources/armv7 -Xcc -I/Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/DerivedSources -Xcc -ivfsoverlay -Xcc /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src -emit-module-doc-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyState.swiftdoc -serialize-diagnostics-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIViewController+UIEmptyState.dia -module-name UIEmptyState -emit-module-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyState.swiftmodule -emit-objc-header-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyState-Swift.h -emit-dependencies-path /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIViewController+UIEmptyState.d -num-threads 4 -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIViewController+UIEmptyState.bc -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyStateDataSource.bc -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyStateDelegate.bc -o /Users/igorkulman/Library/Caches/org.carthage.CarthageKit/DerivedData/9.4.1_9F2000/UIEmptyState/v4.0.0/Build/Intermediates.noindex/ArchiveIntermediates/UIEmptyState/IntermediateBuildFilesPath/UIEmptyState.build/Release-iphoneos/UIEmptyState.build/Objects-normal/armv7/UIEmptyStateView.bc
/Users/igorkulman/Projects/Teamwire/iOS/Teamwire/Carthage/Checkouts/UIEmptyState/src/UIEmptyState/UIViewController+UIEmptyState.swift:228:18: error: 'bringSubviewToFront' has been renamed to 'bringSubview(toFront:)'
            view.bringSubviewToFront(newView)
                 ^~~~~~~~~~~~~~~~~~~
                 bringSubview        toFront: 
UIKit.UIView:17:15: note: 'bringSubviewToFront' was obsoleted in Swift 3
    open func bringSubviewToFront(_ view: UIView)
              ^

This should be fixed just by renaming view.bringSubviewToFront(newView) to view.bringSubview(toFront: newView) here https://github.com/luispadron/UIEmptyState/blob/master/src/UIEmptyState/UIViewController%2BUIEmptyState.swift#L228

luispadron commented 6 years ago

Version 4.0 only works with Swift 4.2