Skip to content

Commit 0e2dfdf

Browse files
committed
Add underline color to ColorType.
1 parent 0ff7c21 commit 0e2dfdf

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Attributed/ColorType+Attributes.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,28 @@ public extension ColorType
6363
{
6464
return Attribute(NSBackgroundColorAttributeName, self, strings)
6565
}
66+
67+
/**
68+
Applies an underline color attribute to the enclosed attributed strings.
69+
70+
The underline color will not override an underline color set deeper in the hierarchy.
71+
72+
- parameter strings: The attributed strings to apply the underline color to.
73+
*/
74+
public func underlineAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
75+
{
76+
return Attribute(NSUnderlineColorAttributeName, self, strings)
77+
}
78+
79+
/**
80+
Applies an underline color attribute to the enclosed attributed strings.
81+
82+
The underline color will not override an underline color set deeper in the hierarchy.
83+
84+
- parameter strings: The attributed strings to apply the underline color to.
85+
*/
86+
public func underlineAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
87+
{
88+
return Attribute(NSUnderlineColorAttributeName, self, strings)
89+
}
6690
}

0 commit comments

Comments
 (0)