File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -27,27 +27,35 @@ public protocol AttributedStringConvertible
2727}
2828
2929// MARK: - String
30+
31+ /// Swift's `String` is extended to conform to `AttributedStringConvertible`.
3032extension String : AttributedStringConvertible
3133{
34+ /// Required to conform to `AttributedStringConvertible`.
3235 public var attributedString : NSAttributedString
3336 {
3437 return NSAttributedString ( string: self )
3538 }
3639
40+ /// Required to conform to `AttributedStringConvertible`.
3741 public func attributedStringWithAddedAttributes( attributes: [ String : AnyObject ] ) -> NSAttributedString
3842 {
3943 return NSAttributedString ( string: self , attributes: attributes)
4044 }
4145}
4246
4347// MARK: - NSAttributedString
48+
49+ /// Foundation's `NSAttributedString` is extended to conform to `AttributedStringConvertible`.
4450extension NSAttributedString : AttributedStringConvertible
4551{
52+ /// Required to conform to `AttributedStringConvertible`.
4653 public var attributedString : NSAttributedString
4754 {
4855 return self
4956 }
5057
58+ /// Required to conform to `AttributedStringConvertible`.
5159 public func attributedStringWithAddedAttributes( attributes: [ String : AnyObject ] ) -> NSAttributedString
5260 {
5361 let mutable = NSMutableAttributedString ( attributedString: self )
You can’t perform that action at this time.
0 commit comments