Skip to content

[NEW] Add support for swift 4.2#30

Merged
ra1028 merged 1 commit intora1028:masterfrom
Sameesunkaria:support-swift-4.2
Sep 17, 2018
Merged

[NEW] Add support for swift 4.2#30
ra1028 merged 1 commit intora1028:masterfrom
Sameesunkaria:support-swift-4.2

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.

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.


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