Rename an API that has the same name as a new API in iOS SDK#1400
Rename an API that has the same name as a new API in iOS SDK#1400crazytonyli wants to merge 7 commits intodevelopfrom
Conversation
| fileprivate(set) var saveButton: UIBarButtonItem = { | ||
| let saveTitle = NSLocalizedString("Save", comment: "Save Action") | ||
| return UIBarButtonItem(title: saveTitle, style: .plain, target: self, action: #selector(saveWasPressed)) | ||
| return UIBarButtonItem(title: saveTitle, style: .plain, target: UnknownEditorViewController.self, action: #selector(saveWasPressed)) |
There was a problem hiding this comment.
This doesn't seem right 🤔
It's now setting a class as a target.
There was a problem hiding this comment.
Good catch! These are Xcode's code suggestions, which I blindly took... Addressed in fc8861a.
| /// Helper Initializer: returns an Attributed String, with the specified attachment, styled with a given | ||
| /// collection of attributes. | ||
| /// | ||
| public convenience init(attachment: NSTextAttachment, attributes: [NSAttributedString.Key: Any], aztec: Void) { |
There was a problem hiding this comment.
(nit) I would suggest converting it to a factory method with a prefix: NSAttributedString.aztec_make(attachment:attributes:). Does it need to be public?
There was a problem hiding this comment.
This initialiser is available to both NSAttributedString and NSMutableAttributedString. It's not very straightforward to make a static function to return an instance of its receiver.
Does it need to be public?
I'm not sure. But I don't want to change the public API as part of this PR though, which is why I marked the original function as deprecated.
|
The unit test failures are not related to this PR. #1392 seems to fix them. |
iOS 18 SDK has a new API
NSAttributedString.init(attachment:attributes:). This library has a public API that has the same name.This PR did a quick fix which adds a meaning less
aztec: Voidargument to the API, so that the library get to keep the existing functionality and won't affect library consumers in using iOS 18 SDK.CHANGELOG.mdif necessary.