Skip to content

Commit 8c4beab

Browse files
author
Harlan Haskins
committed
[SE-0046] Implemented consistent function labels
1 parent d1643b5 commit 8c4beab

File tree

111 files changed

+1673
-1673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+1673
-1673
lines changed

Foundation/FoundationErrors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public extension NSCocoaError {
249249
import Glibc
250250
#endif
251251

252-
internal func _NSErrorWithErrno(posixErrno : Int32, reading : Bool, path : String? = nil, url : NSURL? = nil, extraUserInfo : [String : Any]? = nil) -> NSError {
252+
internal func _NSErrorWithErrno(_ posixErrno : Int32, reading : Bool, path : String? = nil, url : NSURL? = nil, extraUserInfo : [String : Any]? = nil) -> NSError {
253253
var cocoaError : NSCocoaError
254254
if reading {
255255
switch posixErrno {

Foundation/NSAffineTransform.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ public struct NSAffineTransformStruct {
3333

3434
public class NSAffineTransform : NSObject, NSCopying, NSSecureCoding {
3535

36-
public func encodeWithCoder(aCoder: NSCoder) {
36+
public func encodeWithCoder(_ aCoder: NSCoder) {
3737
NSUnimplemented()
3838
}
39-
public func copyWithZone(zone: NSZone) -> AnyObject {
39+
public func copyWithZone(_ zone: NSZone) -> AnyObject {
4040
return NSAffineTransform(transform: self)
4141
}
4242
// Necessary because `NSObject.copy()` returns `self`.
@@ -65,30 +65,30 @@ public class NSAffineTransform : NSObject, NSCopying, NSSecureCoding {
6565
}
6666

6767
// Translating
68-
public func translateXBy(deltaX: CGFloat, yBy deltaY: CGFloat) {
68+
public func translateXBy(_ deltaX: CGFloat, yBy deltaY: CGFloat) {
6969
let translation = NSAffineTransformStruct.translation(tX: deltaX, tY: deltaY)
7070

7171
transformStruct = translation.concat(transformStruct)
7272
}
7373

7474
// Rotating
75-
public func rotateByDegrees(angle: CGFloat) {
75+
public func rotateByDegrees(_ angle: CGFloat) {
7676
let rotation = NSAffineTransformStruct.rotation(degrees: angle)
7777

7878
transformStruct = rotation.concat(transformStruct)
7979
}
80-
public func rotateByRadians(angle: CGFloat) {
80+
public func rotateByRadians(_ angle: CGFloat) {
8181
let rotation = NSAffineTransformStruct.rotation(radians: angle)
8282

8383
transformStruct = rotation.concat(transformStruct)
8484
}
8585

8686
// Scaling
87-
public func scaleBy(scale: CGFloat) {
87+
public func scaleBy(_ scale: CGFloat) {
8888
scaleXBy(scale, yBy: scale)
8989
}
9090

91-
public func scaleXBy(scaleX: CGFloat, yBy scaleY: CGFloat) {
91+
public func scaleXBy(_ scaleX: CGFloat, yBy scaleY: CGFloat) {
9292
let scale = NSAffineTransformStruct.scale(sX: scaleX, sY: scaleY)
9393

9494
transformStruct = scale.concat(transformStruct)
@@ -105,19 +105,19 @@ public class NSAffineTransform : NSObject, NSCopying, NSSecureCoding {
105105
}
106106

107107
// Transforming with transform
108-
public func appendTransform(transform: NSAffineTransform) {
108+
public func appendTransform(_ transform: NSAffineTransform) {
109109
transformStruct = transformStruct.concat(transform.transformStruct)
110110
}
111-
public func prependTransform(transform: NSAffineTransform) {
111+
public func prependTransform(_ transform: NSAffineTransform) {
112112
transformStruct = transform.transformStruct.concat(transformStruct)
113113
}
114114

115115
// Transforming points and sizes
116-
public func transformPoint(aPoint: NSPoint) -> NSPoint {
116+
public func transformPoint(_ aPoint: NSPoint) -> NSPoint {
117117
return transformStruct.applied(toPoint: aPoint)
118118
}
119119

120-
public func transformSize(aSize: NSSize) -> NSSize {
120+
public func transformSize(_ aSize: NSSize) -> NSSize {
121121
return transformStruct.applied(toSize: aSize)
122122
}
123123

@@ -214,7 +214,7 @@ private extension NSAffineTransformStruct {
214214
= [ (m21_T*m11_M + m22_T*m21_M) (m21_T*m12_M + m22_T*m22_M) 0 ]
215215
[ (tX_T*m11_M + tY_T*m21_M + tX_M) (tX_T*m12_M + tY_T*m22_M + tY_M) 1 ]
216216
*/
217-
func concat(transformStruct: NSAffineTransformStruct) -> NSAffineTransformStruct {
217+
func concat(_ transformStruct: NSAffineTransformStruct) -> NSAffineTransformStruct {
218218
let (t, m) = (self, transformStruct)
219219

220220
return NSAffineTransformStruct(

Foundation/NSArray.swift

Lines changed: 60 additions & 60 deletions
Large diffs are not rendered by default.

Foundation/NSAttributedString.swift

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
1414
NSUnimplemented()
1515
}
1616

17-
public func encodeWithCoder(aCoder: NSCoder) {
17+
public func encodeWithCoder(_ aCoder: NSCoder) {
1818
NSUnimplemented()
1919
}
2020

@@ -26,36 +26,36 @@ public class NSAttributedString : NSObject, NSCopying, NSMutableCopying, NSSecur
2626
return copyWithZone(nil)
2727
}
2828

29-
public func copyWithZone(zone: NSZone) -> AnyObject {
29+
public func copyWithZone(_ zone: NSZone) -> AnyObject {
3030
NSUnimplemented()
3131
}
3232

3333
public override func mutableCopy() -> AnyObject {
3434
return mutableCopyWithZone(nil)
3535
}
3636

37-
public func mutableCopyWithZone(zone: NSZone) -> AnyObject {
37+
public func mutableCopyWithZone(_ zone: NSZone) -> AnyObject {
3838
NSUnimplemented()
3939
}
4040

4141
public var string: String { NSUnimplemented() }
42-
public func attributesAtIndex(location: Int, effectiveRange range: NSRangePointer) -> [String : AnyObject] { NSUnimplemented() }
42+
public func attributesAtIndex(_ location: Int, effectiveRange range: NSRangePointer) -> [String : AnyObject] { NSUnimplemented() }
4343

4444
public var length: Int { NSUnimplemented() }
45-
public func attribute(attrName: String, atIndex location: Int, effectiveRange range: NSRangePointer) -> AnyObject? { NSUnimplemented() }
46-
public func attributedSubstringFromRange(range: NSRange) -> NSAttributedString { NSUnimplemented() }
45+
public func attribute(_ attrName: String, atIndex location: Int, effectiveRange range: NSRangePointer) -> AnyObject? { NSUnimplemented() }
46+
public func attributedSubstringFromRange(_ range: NSRange) -> NSAttributedString { NSUnimplemented() }
4747

48-
public func attributesAtIndex(location: Int, longestEffectiveRange range: NSRangePointer, inRange rangeLimit: NSRange) -> [String : AnyObject] { NSUnimplemented() }
49-
public func attribute(attrName: String, atIndex location: Int, longestEffectiveRange range: NSRangePointer, inRange rangeLimit: NSRange) -> AnyObject? { NSUnimplemented() }
48+
public func attributesAtIndex(_ location: Int, longestEffectiveRange range: NSRangePointer, inRange rangeLimit: NSRange) -> [String : AnyObject] { NSUnimplemented() }
49+
public func attribute(_ attrName: String, atIndex location: Int, longestEffectiveRange range: NSRangePointer, inRange rangeLimit: NSRange) -> AnyObject? { NSUnimplemented() }
5050

51-
public func isEqualToAttributedString(other: NSAttributedString) -> Bool { NSUnimplemented() }
51+
public func isEqualToAttributedString(_ other: NSAttributedString) -> Bool { NSUnimplemented() }
5252

5353
public init(string str: String) { NSUnimplemented() }
5454
public init(string str: String, attributes attrs: [String : AnyObject]?) { NSUnimplemented() }
5555
public init(attributedString attrStr: NSAttributedString) { NSUnimplemented() }
5656

57-
public func enumerateAttributesInRange(enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: ([String : AnyObject], NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }
58-
public func enumerateAttribute(attrName: String, inRange enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: (AnyObject?, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }
57+
public func enumerateAttributesInRange(_ enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: ([String : AnyObject], NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }
58+
public func enumerateAttribute(_ attrName: String, inRange enumerationRange: NSRange, options opts: NSAttributedStringEnumerationOptions, usingBlock block: (AnyObject?, NSRange, UnsafeMutablePointer<ObjCBool>) -> Void) { NSUnimplemented() }
5959
}
6060

6161
public struct NSAttributedStringEnumerationOptions : OptionSet {
@@ -69,21 +69,21 @@ public struct NSAttributedStringEnumerationOptions : OptionSet {
6969

7070
public class NSMutableAttributedString : NSAttributedString {
7171

72-
public func replaceCharactersInRange(range: NSRange, withString str: String) { NSUnimplemented() }
73-
public func setAttributes(attrs: [String : AnyObject]?, range: NSRange) { NSUnimplemented() }
72+
public func replaceCharactersInRange(_ range: NSRange, withString str: String) { NSUnimplemented() }
73+
public func setAttributes(_ attrs: [String : AnyObject]?, range: NSRange) { NSUnimplemented() }
7474

7575

7676
public var mutableString: NSMutableString { NSUnimplemented() }
7777

78-
public func addAttribute(name: String, value: AnyObject, range: NSRange) { NSUnimplemented() }
79-
public func addAttributes(attrs: [String : AnyObject], range: NSRange) { NSUnimplemented() }
80-
public func removeAttribute(name: String, range: NSRange) { NSUnimplemented() }
78+
public func addAttribute(_ name: String, value: AnyObject, range: NSRange) { NSUnimplemented() }
79+
public func addAttributes(_ attrs: [String : AnyObject], range: NSRange) { NSUnimplemented() }
80+
public func removeAttribute(_ name: String, range: NSRange) { NSUnimplemented() }
8181

82-
public func replaceCharactersInRange(range: NSRange, withAttributedString attrString: NSAttributedString) { NSUnimplemented() }
83-
public func insertAttributedString(attrString: NSAttributedString, atIndex loc: Int) { NSUnimplemented() }
84-
public func appendAttributedString(attrString: NSAttributedString) { NSUnimplemented() }
85-
public func deleteCharactersInRange(range: NSRange) { NSUnimplemented() }
86-
public func setAttributedString(attrString: NSAttributedString) { NSUnimplemented() }
82+
public func replaceCharactersInRange(_ range: NSRange, withAttributedString attrString: NSAttributedString) { NSUnimplemented() }
83+
public func insertAttributedString(_ attrString: NSAttributedString, atIndex loc: Int) { NSUnimplemented() }
84+
public func appendAttributedString(_ attrString: NSAttributedString) { NSUnimplemented() }
85+
public func deleteCharactersInRange(_ range: NSRange) { NSUnimplemented() }
86+
public func setAttributedString(_ attrString: NSAttributedString) { NSUnimplemented() }
8787

8888
public func beginEditing() { NSUnimplemented() }
8989
public func endEditing() { NSUnimplemented() }

0 commit comments

Comments
 (0)