-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for Swift 4 #2507
Changes for Swift 4 #2507
Conversation
Any news on swift 4 version? |
This is the least working change now. Waiting for Xcode 9 release and finalize it |
so basically not before September.... |
To clarify, SE-0160 doesn't make any recommendations as to where to put |
@jjatie here: https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Attributes.html#//apple_ref/doc/uid/TP40014097-CH35-ID348
it seems do not suggest add |
any update on Swift 4 conversion? |
|
@mrafayfarooq if you're looking for a Swift 4 version, there is a fully functional one here without objective-c compatibility. I haven't run into any bugs yet, and am migrating more and more to a "pure Swift" implementation, keeping the same API until at least Swift 5. |
extension NSString for func size(attributes attrs: [String : Any]? = nil) -> NSSize is deleted due to iOS uses size(withAttributes: attrs) now
If CI passes then this should be good to go! |
Codecov Report
@@ Coverage Diff @@
## master #2507 +/- ##
=========================================
+ Coverage 19.67% 19.77% +0.1%
=========================================
Files 113 113
Lines 13772 14137 +365
=========================================
+ Hits 2710 2796 +86
- Misses 11062 11341 +279
Continue to review full report at Codecov.
|
@petester42 we almost add
Not sure if adding |
It will increase the binary size but the functionality will be exactly the same as someone using swift 3. So it should not break someone's objective-c code written with an older version of the library. |
Is there going to be an update to the CocoaPod? |
When this is merged yes. |
When is this likely to be merged with main branch? |
Can we merge this now that XCode 9 is available? |
I will check with latest Xcode9 and merge later if no issue found |
Build via Xcode9 and no build time errors, a green light to merge! |
Are all these |
Many of them are not. Only those types, properties, and methods that consumers of the framework need access to in objective-c require the |
I may be wrong on this one, but another good example is all of the I'd be happy to audit the framework for cases like this, and PR the corresponding changes. I don't want to take it on if it's not desired though. |
|
Maybe Apple will do this automatically in the future as a refactoring feature. |
They give you a option when migrating to swift 4 but picking the one with less caused too many errors. You can toggle it off in the project settings and it will give warnings for the onces that aren’t needed. |
The documentation on the changes to @danielgindi Dox explains why this can't be a refactoring feature. |
Changes for Swift 4
Thanks to Swift 4's compatibility, this year is easier to upgrade on our own pace. But still works to do :(
Part I
modify All
NSAttributedStringKey
related methods for Swift 4Note:
extension NSString for func size(attributes attrs: [String : Any]? = nil) -> NSSize
is deleted due to iOS 11 uses
size(withAttributes: attrs)
nowKnown issues:
@objc
usage, a new enhancement to reduce binary size since Swift 4, which is quite confusing, still waiting for newer Xcode 9 beta to see if it can help and investigating a better solution. Related SE: SE-0160. One SO Thread discuss it