Skip to content

Commit c4a6636

Browse files
committed
Downcase free functions.
This could cause a lot of name collisions if people want to use the names as local names, but it matches Swift style better.
1 parent a01e5f5 commit c4a6636

11 files changed

+36
-36
lines changed

Attributed/ColorType+Attributes.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension ColorType
2525
*/
2626
public func foregroundAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSForegroundColorAttributeName, self, strings)
28+
return Attributed.attribute(NSForegroundColorAttributeName, self, strings)
2929
}
3030

3131
/**
@@ -37,7 +37,7 @@ public extension ColorType
3737
*/
3838
public func foregroundAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSForegroundColorAttributeName, self, strings)
40+
return Attributed.attribute(NSForegroundColorAttributeName, self, strings)
4141
}
4242

4343
/**
@@ -49,7 +49,7 @@ public extension ColorType
4949
*/
5050
public func backgroundAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
5151
{
52-
return Attribute(NSBackgroundColorAttributeName, self, strings)
52+
return Attributed.attribute(NSBackgroundColorAttributeName, self, strings)
5353
}
5454

5555
/**
@@ -61,7 +61,7 @@ public extension ColorType
6161
*/
6262
public func backgroundAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
6363
{
64-
return Attribute(NSBackgroundColorAttributeName, self, strings)
64+
return Attributed.attribute(NSBackgroundColorAttributeName, self, strings)
6565
}
6666

6767
/**
@@ -73,7 +73,7 @@ public extension ColorType
7373
*/
7474
public func underlineAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
7575
{
76-
return Attribute(NSUnderlineColorAttributeName, self, strings)
76+
return Attributed.attribute(NSUnderlineColorAttributeName, self, strings)
7777
}
7878

7979
/**
@@ -85,7 +85,7 @@ public extension ColorType
8585
*/
8686
public func underlineAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
8787
{
88-
return Attribute(NSUnderlineColorAttributeName, self, strings)
88+
return Attributed.attribute(NSUnderlineColorAttributeName, self, strings)
8989
}
9090

9191
/**
@@ -97,7 +97,7 @@ public extension ColorType
9797
*/
9898
public func strikethroughAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
9999
{
100-
return Attribute(NSStrikethroughColorAttributeName, self, strings)
100+
return Attributed.attribute(NSStrikethroughColorAttributeName, self, strings)
101101
}
102102

103103
/**
@@ -109,6 +109,6 @@ public extension ColorType
109109
*/
110110
public func strikethroughAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
111111
{
112-
return Attribute(NSStrikethroughColorAttributeName, self, strings)
112+
return Attributed.attribute(NSStrikethroughColorAttributeName, self, strings)
113113
}
114114
}

Attributed/FontType+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension FontType
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSFontAttributeName, self, strings)
28+
return Attributed.attribute(NSFontAttributeName, self, strings)
2929
}
3030

3131
/**
@@ -37,6 +37,6 @@ public extension FontType
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSFontAttributeName, self, strings)
40+
return Attributed.attribute(NSFontAttributeName, self, strings)
4141
}
4242
}

Attributed/Functions.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
- parameter attributes: The attributes to apply.
1717
- parameter strings: The convertible strings.
1818
*/
19-
public func Attributes(attributes: [String:AnyObject?], _ strings: AttributedStringConvertible...)
19+
public func attributes(attributes: [String:AnyObject?], _ strings: AttributedStringConvertible...)
2020
-> AttributedStringConvertible
2121
{
22-
return Attributes(attributes, strings)
22+
return Attributed.attributes(attributes, strings)
2323
}
2424

2525
/**
@@ -30,7 +30,7 @@ public func Attributes(attributes: [String:AnyObject?], _ strings: AttributedStr
3030
- parameter attributes: The attributes to apply.
3131
- parameter strings: The convertible strings.
3232
*/
33-
public func Attributes(attributes: [String:AnyObject?], _ strings: [AttributedStringConvertible])
33+
public func attributes(attributes: [String:AnyObject?], _ strings: [AttributedStringConvertible])
3434
-> AttributedStringConvertible
3535
{
3636
return NestedAttributedString(attributes: attributes, children: strings)
@@ -45,10 +45,10 @@ public func Attributes(attributes: [String:AnyObject?], _ strings: [AttributedSt
4545
- parameter value: The attribute value to apply.
4646
- parameter strings: The convertible strings.
4747
*/
48-
public func Attribute(attribute: String, _ value: AnyObject?, _ strings: AttributedStringConvertible...)
48+
public func attribute(attribute: String, _ value: AnyObject?, _ strings: AttributedStringConvertible...)
4949
-> AttributedStringConvertible
5050
{
51-
return Attribute(attribute, value, strings)
51+
return Attributed.attribute(attribute, value, strings)
5252
}
5353

5454
/**
@@ -60,8 +60,8 @@ public func Attribute(attribute: String, _ value: AnyObject?, _ strings: Attribu
6060
- parameter value: The attribute value to apply.
6161
- parameter strings: The convertible strings.
6262
*/
63-
public func Attribute(attribute: String, _ value: AnyObject?, _ strings: [AttributedStringConvertible])
63+
public func attribute(attribute: String, _ value: AnyObject?, _ strings: [AttributedStringConvertible])
6464
-> AttributedStringConvertible
6565
{
66-
return Attributes([attribute: value], strings)
66+
return Attributed.attributes([attribute: value], strings)
6767
}

Attributed/Ligature+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension Ligature
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSLigatureAttributeName, self.rawValue, strings)
28+
return Attributed.attribute(NSLigatureAttributeName, self.rawValue, strings)
2929
}
3030

3131
/**
@@ -37,6 +37,6 @@ public extension Ligature
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSLigatureAttributeName, self.rawValue, strings)
40+
return Attributed.attribute(NSLigatureAttributeName, self.rawValue, strings)
4141
}
4242
}

Attributed/NSNumberConvertible+Attributes.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public extension NSNumberConvertible
2626
*/
2727
public func baselineOffsetAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2828
{
29-
return Attribute(NSBaselineOffsetAttributeName, self.NSNumberValue, strings)
29+
return Attributed.attribute(NSBaselineOffsetAttributeName, self.NSNumberValue, strings)
3030
}
3131

3232
/**
@@ -38,7 +38,7 @@ public extension NSNumberConvertible
3838
*/
3939
public func baselineOffsetAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
4040
{
41-
return Attribute(NSBaselineOffsetAttributeName, self.NSNumberValue, strings)
41+
return Attributed.attribute(NSBaselineOffsetAttributeName, self.NSNumberValue, strings)
4242
}
4343

4444
// MARK: - Kern
@@ -51,7 +51,7 @@ public extension NSNumberConvertible
5151
*/
5252
func kernAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
5353
{
54-
return Attribute(NSKernAttributeName, self.NSNumberValue, strings)
54+
return Attributed.attribute(NSKernAttributeName, self.NSNumberValue, strings)
5555
}
5656

5757
/**
@@ -63,6 +63,6 @@ public extension NSNumberConvertible
6363
*/
6464
func kernAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
6565
{
66-
return Attribute(NSKernAttributeName, self.NSNumberValue, strings)
66+
return Attributed.attribute(NSKernAttributeName, self.NSNumberValue, strings)
6767
}
6868
}

Attributed/NSParagraphStyle+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension NSParagraphStyle
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSParagraphStyleAttributeName, self, strings)
28+
return Attributed.attribute(NSParagraphStyleAttributeName, self, strings)
2929
}
3030

3131
/**
@@ -37,6 +37,6 @@ public extension NSParagraphStyle
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSParagraphStyleAttributeName, self, strings)
40+
return Attributed.attribute(NSParagraphStyleAttributeName, self, strings)
4141
}
4242
}

Attributed/NSShadow+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension NSShadow
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSShadowAttributeName, self, strings)
28+
return Attributed.attribute(NSShadowAttributeName, self, strings)
2929
}
3030

3131
/**
@@ -37,6 +37,6 @@ public extension NSShadow
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSShadowAttributeName, self, strings)
40+
return Attributed.attribute(NSShadowAttributeName, self, strings)
4141
}
4242
}

Attributed/NSTextAttachment+Attributes.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension NSTextAttachment
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSAttachmentAttributeName, self, strings)
28+
return Attributed.attribute(NSAttachmentAttributeName, self, strings)
2929
}
3030

3131
/**
@@ -37,6 +37,6 @@ public extension NSTextAttachment
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSAttachmentAttributeName, self, strings)
40+
return Attributed.attribute(NSAttachmentAttributeName, self, strings)
4141
}
4242
}

Attributed/NSUnderlineStyle+Attributes.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public extension NSUnderlineStyle
2525
*/
2626
public func attribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
2727
{
28-
return Attribute(NSUnderlineStyleAttributeName, self.rawValue, strings)
28+
return Attributed.attribute(NSUnderlineStyleAttributeName, self.rawValue, strings)
2929
}
3030

3131
/**
@@ -37,7 +37,7 @@ public extension NSUnderlineStyle
3737
*/
3838
public func attribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
3939
{
40-
return Attribute(NSUnderlineStyleAttributeName, self.rawValue, strings)
40+
return Attributed.attribute(NSUnderlineStyleAttributeName, self.rawValue, strings)
4141
}
4242

4343
/**
@@ -49,7 +49,7 @@ public extension NSUnderlineStyle
4949
*/
5050
public func strikethroughAttribute(strings: AttributedStringConvertible...) -> AttributedStringConvertible
5151
{
52-
return Attribute(NSStrikethroughStyleAttributeName, self.rawValue, strings)
52+
return Attributed.attribute(NSStrikethroughStyleAttributeName, self.rawValue, strings)
5353
}
5454

5555
/**
@@ -61,6 +61,6 @@ public extension NSUnderlineStyle
6161
*/
6262
public func strikethroughAttribute(strings: [AttributedStringConvertible]) -> AttributedStringConvertible
6363
{
64-
return Attribute(NSStrikethroughStyleAttributeName, self.rawValue, strings)
64+
return Attributed.attribute(NSStrikethroughStyleAttributeName, self.rawValue, strings)
6565
}
6666
}

AttributedTests/AttributedTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class AttributedTests: XCTestCase
6464
{
6565
let attributed = ColorType.blueColor().foregroundAttribute(
6666
"Test",
67-
Attribute(NSForegroundColorAttributeName, nil,
67+
attribute(NSForegroundColorAttributeName, nil,
6868
"Test",
6969
ColorType.greenColor().foregroundAttribute("Test")
7070
)

0 commit comments

Comments
 (0)