-
Notifications
You must be signed in to change notification settings - Fork 21
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
Swift 4.2 #10
base: master
Are you sure you want to change the base?
Swift 4.2 #10
Conversation
@@ -34,11 +34,11 @@ open class MarkdownHeader: MarkdownLevelElement { | |||
attributedString.deleteCharacters(in: range) | |||
} | |||
|
|||
open func attributesForLevel(_ level: Int) -> [NSAttributedStringKey: Any] { | |||
open func attributesForLevel(_ level: Int) -> [NSAttributedString.Key: Any] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This alone will break compatibility with Swift 4.1: better also declare a compatibility layer with previous Swift version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe create a typealias like this.
#if swift(>=4.2)
public typealias MarkdownAttribute = [NSAttributedString.Key: Any]
#else
public typealias MarkdownAttribute = [NSAttributedStringKey: Any]
#endif
@@ -0,0 +1,8 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good, but can be done in an independant pull request.
Adds Swift 4.2 Support