Skip to content

Commit d5f64e0

Browse files
committed
Remove variadic functions, use array-based functions only.
1 parent f16d66c commit d5f64e0

13 files changed

+32
-229
lines changed

Attributed/ColorType+Attributes.swift

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ public extension ColorType
1818
{
1919
// MARK: - Foreground Color
2020

21-
/**
22-
Applies a foreground color attribute to the enclosed attributed strings.
23-
24-
The foreground color will not override a foreground color set deeper in the hierarchy.
25-
26-
- parameter strings: The attributed strings to apply the foreground color to.
27-
*/
28-
public func foregroundAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
29-
{
30-
return Attributed.attribute(NSForegroundColorAttributeName, self, strings)
31-
}
32-
3321
/**
3422
Applies a foreground color attribute to the enclosed attributed strings.
3523

@@ -44,18 +32,6 @@ public extension ColorType
4432

4533
// MARK: - Background Color
4634

47-
/**
48-
Applies a background color attribute to the enclosed attributed strings.
49-
50-
The background color will not override a background color set deeper in the hierarchy.
51-
52-
- parameter strings: The attributed strings to apply the background color to.
53-
*/
54-
public func backgroundAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
55-
{
56-
return Attributed.attribute(NSBackgroundColorAttributeName, self, strings)
57-
}
58-
5935
/**
6036
Applies a background color attribute to the enclosed attributed strings.
6137

@@ -70,18 +46,6 @@ public extension ColorType
7046

7147
// MARK: - Underline Color
7248

73-
/**
74-
Applies an underline color attribute to the enclosed attributed strings.
75-
76-
The underline color will not override an underline color set deeper in the hierarchy.
77-
78-
- parameter strings: The attributed strings to apply the underline color to.
79-
*/
80-
public func underlineAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
81-
{
82-
return Attributed.attribute(NSUnderlineColorAttributeName, self, strings)
83-
}
84-
8549
/**
8650
Applies an underline color attribute to the enclosed attributed strings.
8751

@@ -96,18 +60,6 @@ public extension ColorType
9660

9761
// MARK: - Strikethrough Color
9862

99-
/**
100-
Applies an strikethrough color attribute to the enclosed attributed strings.
101-
102-
The strikethrough color will not override an strikethrough color set deeper in the hierarchy.
103-
104-
- parameter strings: The attributed strings to apply the strikethrough color to.
105-
*/
106-
public func strikethroughAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
107-
{
108-
return Attributed.attribute(NSStrikethroughColorAttributeName, self, strings)
109-
}
110-
11163
/**
11264
Applies an strikethrough color attribute to the enclosed attributed strings.
11365

Attributed/FontType+Attributes.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,7 @@
1616

1717
public extension FontType
1818
{
19-
/**
20-
Applies a font attribute to the enclosed attributed strings.
21-
22-
The font will not override a font set deeper in the hierarchy.
23-
24-
- parameter strings: The attributed strings to apply the font to.
25-
*/
26-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
27-
{
28-
return Attributed.attribute(NSFontAttributeName, self, strings)
29-
}
19+
// MARK: - Attributes
3020

3121
/**
3222
Applies a font attribute to the enclosed attributed strings.

Attributed/Functions.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,6 @@
88
// You should have received a copy of the CC0 Public Domain Dedication along with
99
// this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
1010

11-
/**
12-
Returns an attributed string convertible with the specified attributes applied at the root level.
13-
14-
The attributes will not override matching attributes deeper in the hierarchy.
15-
16-
- parameter attributes: The attributes to apply.
17-
- parameter strings: The convertible strings.
18-
*/
19-
public func attributes(attributes: [String:AnyObject?], _ strings: AttributedStringConvertible...)
20-
-> AttributedStringConvertible
21-
{
22-
return Attributed.attributes(attributes, strings)
23-
}
24-
2511
/**
2612
Returns an attributed string convertible with the specified attributes applied at the root level.
2713

@@ -36,21 +22,6 @@ public func attributes(attributes: [String:AnyObject?], _ strings: [AttributedSt
3622
return NestedAttributedString(attributes: attributes, children: strings)
3723
}
3824

39-
/**
40-
Returns an attributed string convertible with the specified attribute applied at the root level.
41-
42-
The attribute value will not override a matching attribute deeper in the hierarchy.
43-
44-
- parameter attribute: The attribute name to apply.
45-
- parameter value: The attribute value to apply.
46-
- parameter strings: The convertible strings.
47-
*/
48-
public func attribute(attribute: String, _ value: AnyObject?, _ strings: AttributedStringConvertible...)
49-
-> AttributedStringConvertible
50-
{
51-
return Attributed.attribute(attribute, value, strings)
52-
}
53-
5425
/**
5526
Returns an attributed string convertible with the specified attribute applied at the root level.
5627

Attributed/Ligature+Attributes.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ public extension Ligature
1818
{
1919
// MARK: - Attributes
2020

21-
/**
22-
Applies a ligature setting to the enclosed attributed strings.
23-
24-
The ligature setting will not override a ligature setting set deeper in the hierarchy.
25-
26-
- parameter strings: The attributed strings to apply the ligature setting to.
27-
*/
28-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
29-
{
30-
return Attributed.attribute(NSLigatureAttributeName, self.rawValue, strings)
31-
}
32-
3321
/**
3422
Applies a ligature setting to the enclosed attributed strings.
3523

Attributed/NSCursor+Attributes.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,7 @@ import AppKit
1414

1515
extension NSCursor
1616
{
17-
/**
18-
Applies a cursor to the enclosed attributed strings.
19-
20-
The cursor will not override a cursor set deeper in the hierarchy.
21-
22-
- parameter strings: The attributed strings to apply the shadow to.
23-
*/
24-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
25-
{
26-
return Attributed.attribute(NSCursorAttributeName, self, strings)
27-
}
17+
// MARK: - Attributes
2818

2919
/**
3020
Applies a cursor to the enclosed attributed strings.

Attributed/NSNumberConvertible+Attributes.swift

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717
public extension NSNumberConvertible
1818
{
1919
// MARK: - Baseline Offset
20-
/**
21-
Applies a baseline offset attribute to the enclosed attributed strings.
22-
23-
The baseline offset value will not override a baseline offset value set deeper in the hierarchy.
24-
25-
- parameter strings: The attributed strings to apply the baseline offset to.
26-
*/
27-
public func baselineOffsetAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
28-
{
29-
return Attributed.attribute(NSBaselineOffsetAttributeName, self.NSNumberValue, strings)
30-
}
3120

3221
/**
3322
Applies a baseline offset attribute to the enclosed attributed strings.
@@ -42,17 +31,6 @@ public extension NSNumberConvertible
4231
}
4332

4433
// MARK: - Kern
45-
/**
46-
Applies a kerning attribute to the enclosed attributed strings.
47-
48-
The kerning value will not override a kerning value set deeper in the hierarchy.
49-
50-
- parameter strings: The attributed strings to apply the kerning attribute to.
51-
*/
52-
func kernAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
53-
{
54-
return Attributed.attribute(NSKernAttributeName, self.NSNumberValue, strings)
55-
}
5634

5735
/**
5836
Applies a kerning attribute to the enclosed attributed strings.

Attributed/NSParagraphStyle+Attributes.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,7 @@
1616

1717
public extension NSParagraphStyle
1818
{
19-
/**
20-
Applies a paragraph style to the enclosed attributed strings.
21-
22-
The paragraph style will not override a paragraph style set deeper n the hierarchy.
23-
24-
- parameter strings: The attributed strings to apply the paragraph style to.
25-
*/
26-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
27-
{
28-
return Attributed.attribute(NSParagraphStyleAttributeName, self, strings)
29-
}
19+
// MARK: - Attributes
3020

3121
/**
3222
Applies a paragraph style to the enclosed attributed strings.

Attributed/NSShadow+Attributes.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,7 @@
1616

1717
public extension NSShadow
1818
{
19-
/**
20-
Applies a shadow to the enclosed attributed strings.
21-
22-
The shadow will not override a shadow set deeper n the hierarchy.
23-
24-
- parameter strings: The attributed strings to apply the shadow to.
25-
*/
26-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
27-
{
28-
return Attributed.attribute(NSShadowAttributeName, self, strings)
29-
}
19+
// MARK: - Attributes
3020

3121
/**
3222
Applies a shadow to the enclosed attributed strings.

Attributed/NSTextAttachment+Attributes.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,7 @@
1616

1717
public extension NSTextAttachment
1818
{
19-
/**
20-
Applies a text attachment attribute to the enclosed attributed strings.
21-
22-
The text attachment value will not override a text attachment value set deeper in the hierarchy.
23-
24-
- parameter strings: The attributed strings to apply the text attachment to.
25-
*/
26-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
27-
{
28-
return Attributed.attribute(NSAttachmentAttributeName, self, strings)
29-
}
19+
// MARK: - Attributes
3020

3121
/**
3222
Applies a text attachment attribute to the enclosed attributed strings.

Attributed/NSUnderlineStyle+Attributes.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,6 @@ public extension NSUnderlineStyle
1818
{
1919
// MARK: - Underline
2020

21-
/**
22-
Applies an underline style attribute to the enclosed attributed strings.
23-
24-
The underline style will not override an underline style set deeper in the hierarchy.
25-
26-
- parameter strings: The attributed strings to apply the underline style to.
27-
*/
28-
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
29-
{
30-
return Attributed.attribute(NSUnderlineStyleAttributeName, self.rawValue, strings)
31-
}
32-
3321
/**
3422
Applies an underline style attribute to the enclosed attributed strings.
3523

@@ -44,18 +32,6 @@ public extension NSUnderlineStyle
4432

4533
// MARK: - Strikethrough
4634

47-
/**
48-
Applies a strikethrough style attribute to the enclosed attributed strings.
49-
50-
The strikethrough style will not override a strikethrough style set deeper in the hierarchy.
51-
52-
- parameter strings: The attributed strings to apply the strikethrough style to.
53-
*/
54-
public func strikethroughAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
55-
{
56-
return Attributed.attribute(NSStrikethroughStyleAttributeName, self.rawValue, strings)
57-
}
58-
5935
/**
6036
Applies a strikethrough style attribute to the enclosed attributed strings.
6137

0 commit comments

Comments
 (0)