@@ -41,14 +41,14 @@ extension CGPoint: NSSpecialValueCoding {
41
41
guard aDecoder. allowsKeyedCoding else {
42
42
preconditionFailure ( " Unkeyed coding is unsupported. " )
43
43
}
44
- self = aDecoder. decodePointForKey ( " NS.pointval " )
44
+ self = aDecoder. decodePoint ( forKey : " NS.pointval " )
45
45
}
46
46
47
47
func encodeWithCoder( _ aCoder: NSCoder ) {
48
48
guard aCoder. allowsKeyedCoding else {
49
49
preconditionFailure ( " Unkeyed coding is unsupported. " )
50
50
}
51
- aCoder. encodePoint ( self , forKey: " NS.pointval " )
51
+ aCoder. encode ( self , forKey: " NS.pointval " )
52
52
}
53
53
54
54
static func objCType( ) -> String {
@@ -104,14 +104,14 @@ extension CGSize: NSSpecialValueCoding {
104
104
guard aDecoder. allowsKeyedCoding else {
105
105
preconditionFailure ( " Unkeyed coding is unsupported. " )
106
106
}
107
- self = aDecoder. decodeSizeForKey ( " NS.sizeval " )
107
+ self = aDecoder. decodeSize ( forKey : " NS.sizeval " )
108
108
}
109
109
110
110
func encodeWithCoder( _ aCoder: NSCoder ) {
111
111
guard aCoder. allowsKeyedCoding else {
112
112
preconditionFailure ( " Unkeyed coding is unsupported. " )
113
113
}
114
- aCoder. encodeSize ( self , forKey: " NS.sizeval " )
114
+ aCoder. encode ( self , forKey: " NS.sizeval " )
115
115
}
116
116
117
117
static func objCType( ) -> String {
@@ -186,14 +186,14 @@ extension CGRect: NSSpecialValueCoding {
186
186
guard aDecoder. allowsKeyedCoding else {
187
187
preconditionFailure ( " Unkeyed coding is unsupported. " )
188
188
}
189
- self = aDecoder. decodeRectForKey ( " NS.rectval " )
189
+ self = aDecoder. decodeRect ( forKey : " NS.rectval " )
190
190
}
191
191
192
192
func encodeWithCoder( _ aCoder: NSCoder ) {
193
193
guard aCoder. allowsKeyedCoding else {
194
194
preconditionFailure ( " Unkeyed coding is unsupported. " )
195
195
}
196
- aCoder. encodeRect ( self , forKey: " NS.rectval " )
196
+ aCoder. encode ( self , forKey: " NS.rectval " )
197
197
}
198
198
199
199
static func objCType( ) -> String {
@@ -807,7 +807,7 @@ extension NSValue {
807
807
808
808
extension NSCoder {
809
809
810
- public func encodePoint ( _ point: NSPoint ) {
810
+ public func encode ( _ point: NSPoint ) {
811
811
self . _encodeCGFloat ( point. x)
812
812
self . _encodeCGFloat ( point. y)
813
813
}
@@ -816,7 +816,7 @@ extension NSCoder {
816
816
return NSPoint ( x: _decodeCGFloat ( ) , y: _decodeCGFloat ( ) )
817
817
}
818
818
819
- public func encodeSize ( _ size: NSSize ) {
819
+ public func encode ( _ size: NSSize ) {
820
820
self . _encodeCGFloat ( size. width)
821
821
self . _encodeCGFloat ( size. height)
822
822
}
@@ -825,9 +825,9 @@ extension NSCoder {
825
825
return NSSize ( width: _decodeCGFloat ( ) , height: _decodeCGFloat ( ) )
826
826
}
827
827
828
- public func encodeRect ( _ rect: NSRect ) {
829
- self . encodePoint ( rect. origin)
830
- self . encodeSize ( rect. size)
828
+ public func encode ( _ rect: NSRect ) {
829
+ self . encode ( rect. origin)
830
+ self . encode ( rect. size)
831
831
}
832
832
833
833
public func decodeRect( ) -> NSRect {
@@ -837,35 +837,35 @@ extension NSCoder {
837
837
838
838
extension NSCoder {
839
839
840
- public func encodePoint ( _ point: NSPoint , forKey key: String ) {
840
+ public func encode ( _ point: NSPoint , forKey key: String ) {
841
841
self . encode ( NSStringFromPoint ( point) . _bridgeToObjectiveC ( ) , forKey: key)
842
842
}
843
843
844
- public func encodeSize ( _ size: NSSize , forKey key: String ) {
844
+ public func encode ( _ size: NSSize , forKey key: String ) {
845
845
self . encode ( NSStringFromSize ( size) . _bridgeToObjectiveC ( ) , forKey: key)
846
846
}
847
847
848
- public func encodeRect ( _ rect: NSRect , forKey key: String ) {
848
+ public func encode ( _ rect: NSRect , forKey key: String ) {
849
849
self . encode ( NSStringFromRect ( rect) . _bridgeToObjectiveC ( ) , forKey: key)
850
850
}
851
851
852
- public func decodePointForKey ( _ key: String ) -> NSPoint {
852
+ public func decodePoint ( forKey key: String ) -> NSPoint {
853
853
if let string = self . decodeObject ( of: NSString . self, forKey: key) {
854
854
return NSPointFromString ( String . _unconditionallyBridgeFromObjectiveC ( string) )
855
855
} else {
856
856
return NSPoint ( )
857
857
}
858
858
}
859
859
860
- public func decodeSizeForKey ( _ key: String ) -> NSSize {
860
+ public func decodeSize ( forKey key: String ) -> NSSize {
861
861
if let string = self . decodeObject ( of: NSString . self, forKey: key) {
862
862
return NSSizeFromString ( String . _unconditionallyBridgeFromObjectiveC ( string) )
863
863
} else {
864
864
return NSSize ( )
865
865
}
866
866
}
867
867
868
- public func decodeRectForKey ( _ key: String ) -> NSRect {
868
+ public func decodeRect ( forKey key: String ) -> NSRect {
869
869
if let string = self . decodeObject ( of: NSString . self, forKey: key) {
870
870
return NSRectFromString ( String . _unconditionallyBridgeFromObjectiveC ( string) )
871
871
} else {
0 commit comments