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

Swift 4.2 #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Swift 4.2 #10

wants to merge 3 commits into from

Conversation

JackoPlane
Copy link

Adds Swift 4.2 Support

@@ -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] {
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