Skip to content

Conversation

@JackoPlane
Copy link

Adds Swift 4.2 Support

}

open func attributesForLevel(_ level: Int) -> [NSAttributedStringKey: Any] {
open func attributesForLevel(_ level: Int) -> [NSAttributedString.Key: Any] {
Copy link
Collaborator

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.

Copy link
Owner

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"?>
Copy link
Collaborator

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.

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.

3 participants