Skip to content
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

[NEW] Add support for swift 4.2 #30

Merged
merged 1 commit into from
Sep 17, 2018

Conversation

Sameesunkaria
Copy link
Contributor

Now that swift 4.2 has been finalized and will be officially released shortly, I believe it is imperative that DifferenceKit supports it. The UIKit extensions were the only place where a change was needed.

NOTE: The code will still compile with swift 4.1, as language versions checks are being used to selectively compile the code.

The example project has not been updated to support swift 4.2, and should only be done when Xcode 10 is officially released.

Copy link
Owner

@ra1028 ra1028 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Sameesunkaria
Please check some comments.

typealias RowAnimation = UITableView.RowAnimation
#else
typealias RowAnimation = UITableViewRowAnimation
#endif
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the way to go, but is typealias RowAnimation = UITableView.RowAnimation needed in the Swift 4.2 or over?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. Added just to create symmetry.

@@ -2,6 +2,13 @@
import UIKit

public extension UITableView {

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] Please remove this empty line.

@@ -2,6 +2,12 @@
import UIKit

public extension UITableView {
#if swift(>=4.2)
// Do nothing. UITableView has a RowAnimation enum
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this comment is not needed.

#if swift(>=4.2)
#else
typealias RowAnimation = UITableViewRowAnimation
#endif

After fixed, please squash your commits into one commit. (git rebase -i)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ra1028
Copy link
Owner

ra1028 commented Sep 17, 2018

@Sameesunkaria
Nicely done. Thanks!

@ra1028 ra1028 merged commit fe8bead into ra1028:master Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants