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

addAttributes conflict with Swift 4 #891

Closed
theolof opened this issue Oct 4, 2017 · 4 comments
Closed

addAttributes conflict with Swift 4 #891

theolof opened this issue Oct 4, 2017 · 4 comments
Assignees

Comments

@theolof
Copy link

theolof commented Oct 4, 2017

In Material+NSMutableAttributedString.swift:

open func addAttributes(_ keys: [NSAttributedStringKey: Any], range: NSRange) {
        for (k, v) in keys {
            addAttribute(k, value: v, range: range)
        }
    }

This conflicts with addAttributes in Foundation.NSAttributedString.swift:

open func addAttributes(_ attrs: [NSAttributedStringKey : Any] = [:], range: NSRange)

A workaround is to use updateAttributes until it's fixed.

@daniel-jonathan
Copy link
Member

Hmm... can you show me the error for this. I don't see it when I compile. Thank you!

@titiphoque
Copy link

titiphoque commented Oct 5, 2017

I have the same issue :

Material.NSMutableAttributedString:7:15: note: found this candidate
    open func addAttributes(_ keys: [NSAttributedStringKey : Any], range: NSRange)
              ^
Foundation.NSMutableAttributedString:4:15: note: found this candidate
    open func addAttributes(_ attrs: [NSAttributedStringKey : Any] = [:], range: NSRange)

Why do you have this method in your extension ? This method exists since iOS 3.2+ (see: https://developer.apple.com/documentation/foundation/nsmutableattributedstring/1414304-addattributes)

@theolof
Copy link
Author

theolof commented Oct 5, 2017

Compilation error:

/Users/...ActivityCell.swift:237:9: Ambiguous use of 'addAttributes(_:range:)'

@daniel-jonathan
Copy link
Member

I removed that function :) in this release Material 2.10.4. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants