EZSwiftExtensions icon indicating copy to clipboard operation
EZSwiftExtensions copied to clipboard

Support for Swift 4.2

Open sunilprajapatisa opened this issue 5 years ago • 18 comments

Currently supporting latest branch to swift 4.2 ? or any other branch ?

sunilprajapatisa avatar Oct 30 '18 11:10 sunilprajapatisa

thx please pod install 4.2 Lib! soon! thx!

qiter avatar Nov 08 '18 02:11 qiter

The official effort to update to swift 4.2 is now underway : https://github.com/goktugyil/EZSwiftExtensions/pull/496 which also includes the old PRs that attempt to migrate it. Please review the changes.

Sorry for the delay. I had some issues migrating to later versions of XCodes, but that is now fixed, so you can expect faster response cycles from me on version updates.

Also @goktugyil I would need your final sign off before merging this.

Khalian avatar Nov 08 '18 04:11 Khalian

Sure, ping me when it's complete

Esqarrouth avatar Nov 08 '18 15:11 Esqarrouth

Any idea when it will be upgraded into swift 4.2. @Khalian any update from your side?

ashislaha avatar Nov 12 '18 06:11 ashislaha

@goktugyil I got the Ios stuff to build, but not the mac and tvos targets, and I cannot reproduce it on my local environment. Can you take a look? https://github.com/goktugyil/EZSwiftExtensions/pull/496.

Khalian avatar Nov 12 '18 08:11 Khalian

@goktugyil referencing https://travis-ci.org/goktugyil/EZSwiftExtensions/builds/453835156?utm_source=github_status&utm_medium=notification.

- ERROR | xcodebuild:  /Users/travis/build/goktugyil/EZSwiftExtensions/Sources/EZSwiftFunctions.swift:205:75: error: 'userDidTakeScreenshotNotification' has been renamed to 'NSNotification.Name.UIApplicationUserDidTakeScreenshot'

There is a whole bunch of UIKit naming changes crap that is a part of swift 4.2 for some reason. This is weird because.

  1. This actually builds fine for both ios and tvos, and just falls apart of macOS on travis.
  2. All targets and tests run fine on XCode 10.1 on my system.

I really am not an expert with anything related with UIKit and this is beyond my expertise (particularly because of the fact that I might some cause some sort of regression, we dont have particularly good unit test overage on the non Foundation classes).

ANY HELP FROM ANYONE ON THIS BRANCH WOULD BE APPRECIATED RIGHT NOW.

You would think that Swift and Apple would care for backwards compatibility on all its platform, but whoever designs these APIs appear to be horribly brain damaged.

Khalian avatar Nov 12 '18 08:11 Khalian

@Khalian Update the .swift-version file to 4.2 should fix those pod lint errors, just tried on my repo.

isimple4 avatar Nov 13 '18 06:11 isimple4

@isimple4 Definitely helped but theres a new issue now

pod lib lint -> EZSwiftExtensions (2.0) - NOTE | xcodebuild: note: Using new build system - NOTE | xcodebuild: note: Planning build - NOTE | xcodebuild: note: Constructing build description - NOTE | xcodebuild: warning: Capabilities for App may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the build settings editor. (in target 'App') - NOTE | xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')

I will take a look at this new nonsense tomorrow.

Khalian avatar Nov 13 '18 07:11 Khalian

@Khalian There are some issues still around after Xcode 10. Check https://github.com/CocoaPods/CocoaPods/issues/8116 and https://github.com/CocoaPods/CocoaPods/issues/8125 for more information.

isimple4 avatar Nov 13 '18 08:11 isimple4

Also this

Touching EZSwiftExtensionsTest.xctest (in target: EZSwiftExtensionsTests-tvOS) 2018-11-13 07:40:30.300 xcodebuild[20376:33770] [MT] IDETestOperationsObserverDebug: (0A7B4361-8B94-4CFE-A3D5-CA56B3E650AF) Beginning test session EZSwiftExtensionsTest-0A7B4361-8B94-4CFE-A3D5-CA56B3E650AF at 2018-11-13 07:40:30.300 with Xcode 10B61 on target <DVTiPhoneSimulator: 0x7f89d73599b0> { SimDevice: Apple TV 1080p (6A5E7CD5-0C3D-486B-9DCF-84B7850285C1, tvOS 10.0, Shutdown) } (10.0 (14T328)) 2018-11-13 07:40:30.301 xcodebuild[20376:34449] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/travis/Library/Developer/Xcode/DerivedData/EZSwiftExtensions-cknupuhyerhvhtfuqvigkfkoxukr/Logs/Test/Run-EZSwiftExtensions-tvOS-2018.11.13_07-40-07-+0000.xcresult/3_Test/Diagnostics/EZSwiftExtensionsTest-38C78983-BC9F-44CD-8C0D-19E259BE74FB/EZSwiftExtensionsTest-1A1D803C-CCA5-4D3B-8F9E-EDB0BEDFB56F/Session-EZSwiftExtensionsTest-2018-11-13_074030-Vsd5Ji.log 2018-11-13 07:40:41.622 xcodebuild[20376:34449] Connection peer refused channel request for "dtxproxy:XCTestManager_IDEInterface:XCTestManager_DaemonConnectionInterface"; channel canceled <DTXChannel: 0x7f89d75f2530> 2018-11-13 07:40:41.624 xcodebuild[20376:33770] [MT] IDETestOperationsObserverDebug: 11.335 elapsed -- Testing started completed. 2018-11-13 07:40:41.624 xcodebuild[20376:33770] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start 2018-11-13 07:40:41.624 xcodebuild[20376:33770] [MT] IDETestOperationsObserverDebug: 11.335 sec, +11.335 sec -- end 2018-11-13 07:40:41.625 xcodebuild[20376:33770] Error Domain=IDETestOperationsObserverErrorDomain Code=6 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted, NSUnderlyingError=0x7f89d7148700 {Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Test runner exited before starting test execution." UserInfo={NSLocalizedDescription=Test runner exited before starting test execution., NSLocalizedRecoverySuggestion=If you believe this error represents a bug, please attach the result bundle at /Users/travis/Library/Developer/Xcode/DerivedData/EZSwiftExtensions-cknupuhyerhvhtfuqvigkfkoxukr/Logs/Test/Run-EZSwiftExtensions-tvOS-2018.11.13_07-40-07-+0000.xcresult}}} Testing failed: xctest (20536) encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying error: Test runner exited before starting test execution.))

Khalian avatar Nov 13 '18 08:11 Khalian

That might be an issue of Travis when simulator was interrupted before starting tests. Not able to reproduce locally.

isimple4 avatar Nov 13 '18 08:11 isimple4

@isimple4 Neither can I. And retries do not seem to help. I raised a forum issue on the travis community forum for guidance. https://travis-ci.community/t/cant-run-unit-tests-on-swift-4-2-xcode-10/848. Maybe we can ask for more powerful travis workers or something like that.

Khalian avatar Nov 13 '18 08:11 Khalian

@Khalian There is an issue https://github.com/travis-ci/travis-ci/issues/6675 discussing about it for couple of years but leaving no official solution. IMHO we could ship it after fixing pod warnings since everything looks locally good to go.

isimple4 avatar Nov 13 '18 08:11 isimple4

any update on this?

relsirc avatar Apr 01 '19 13:04 relsirc

how to work on swift4.2

lenvonsam avatar May 13 '19 16:05 lenvonsam

An update for 5 is coming: https://github.com/goktugyil/EZSwiftExtensions/pull/501

To work on swift4.2 you can change the version of your pod to 3. You can have separate swift versions in different frameworks you use in the project.

Esqarrouth avatar May 13 '19 17:05 Esqarrouth

@goktugyil Can you please update for Swift4.2 in replacing UIWebview to WKWebView..as apple is rejecting the app's

Sampri21 avatar Feb 03 '21 10:02 Sampri21

Please open or review a PR with the wanted changes

Esqarrouth avatar Feb 03 '21 11:02 Esqarrouth