-
Notifications
You must be signed in to change notification settings - Fork 1.2k
NSAttributedString: Align methods with Darwin. #1281
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
NSAttributedString: Align methods with Darwin. #1281
Conversation
- Add struct NSAttributedStringKey and use for the attribute key instead of String.
@swift-ci please test |
1 similar comment
@swift-ci please test |
Foundation/NSAttributedString.swift
Outdated
open func attributes(at location: Int, effectiveRange range: NSRangePointer) -> [String : Any] { | ||
|
||
/// Returns the attributes for the character at a given index. | ||
open func attributes(at location: Int, effectiveRange range: NSRangePointer) -> [NSAttributedStringKey : 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.
The NSRangePointer
should be optional: https://developer.apple.com/documentation/foundation/nsattributedstring/1415682-attributes
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.
fixed
Foundation/NSAttributedString.swift
Outdated
CFRunArrayInsert(_attributeArray, range, attrs._cfObject) | ||
var _attrs: [String: Any] = [:] | ||
for (key, value) in attrs { | ||
_attrs[key.rawValue] = value |
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.
Bleh.
@swift-ci please test |
@swift-ci please test |
@swift-ci please test and merge |
instead of String.