Skip to content

Commit e766351

Browse files
committed
Add availability indicator to XMLElement to indicate correct function.
The implementation of setAttributesAs was deprecated bfeore the API was copied over to the Linux implementation, and won't be implemented. By adding an availability marker coupled with a new name, we allow for a fix-it to run and use the new name in future compiled code.
1 parent c55741b commit e766351

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Foundation/NSXMLElement.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,10 @@ open class XMLElement: XMLNode {
327327

328328
extension XMLElement {
329329
/*!
330-
@method setAttributesAsDictionary:
330+
@method setAttributesAs:
331331
@abstract Set the attributes base on a name-value dictionary.
332-
@discussion This method is deprecated and does not function correctly. Use -setAttributesWithDictionary: instead.
332+
@discussion This method is deprecated and does not function correctly. Use -setAttributesWith: instead.
333333
*/
334+
@available(*, unavailable, renamed:"setAttributesWith")
334335
public func setAttributesAs(_ attributes: [NSObject : AnyObject]) { NSUnimplemented() }
335336
}

0 commit comments

Comments
 (0)