Esqarrouth / EZSwiftExtensions

:smirk: How Swift standard types and classes were supposed to work.
MIT License
3k stars 381 forks source link

Support for Swift 4.2 #494

Open sunilprajapatisa opened 6 years ago

sunilprajapatisa commented 6 years ago

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

qiter commented 5 years ago

thx please pod install 4.2 Lib! soon! thx!

Khalian commented 5 years ago

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.

Esqarrouth commented 5 years ago

Sure, ping me when it's complete

ashislaha commented 5 years ago

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

Khalian commented 5 years ago

@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 commented 5 years ago

@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.

isimple4 commented 5 years ago

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

Khalian commented 5 years ago

@isimple4 Definitely helped but theres a new issue now

pod lib lint -> EZSwiftExtensions (2.0)

I will take a look at this new nonsense tomorrow.

isimple4 commented 5 years ago

@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.

Khalian commented 5 years ago

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.))

isimple4 commented 5 years ago

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

Khalian commented 5 years ago

@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.

isimple4 commented 5 years ago

@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.

relsirc commented 5 years ago

any update on this?

lenvonsam commented 5 years ago

how to work on swift4.2

Esqarrouth commented 5 years ago

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.

Sampri21 commented 3 years ago

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

Esqarrouth commented 3 years ago

Please open or review a PR with the wanted changes