File tree Expand file tree Collapse file tree
Sources/InterposeKit/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,11 +32,10 @@ class InterposeSubclass {
3232 /// If we make a dynamic subclass over KVO, invalidating the token crashes in cache_getImp.
3333 init ( object: AnyObject ) throws {
3434 self . object = object
35- dynamicClass = type ( of: object) // satisfy set to something
36- dynamicClass = try getExistingSubclass ( ) ?? createSubclass ( )
35+ self . dynamicClass = try Self . getExistingSubclass ( object: object) ?? Self . createSubclass ( object: object)
3736 }
3837
39- private func createSubclass( ) throws -> AnyClass {
38+ private static func createSubclass( object : AnyObject ) throws -> AnyClass {
4039 let perceivedClass : AnyClass = type ( of: object)
4140 let actualClass : AnyClass = object_getClass ( object) !
4241
@@ -68,15 +67,15 @@ class InterposeSubclass {
6867 }
6968
7069 /// We need to reuse a dynamic subclass if the object already has one.
71- private func getExistingSubclass( ) -> AnyClass ? {
70+ private static func getExistingSubclass( object : AnyObject ) -> AnyClass ? {
7271 let actualClass : AnyClass = object_getClass ( object) !
7372 if NSStringFromClass ( actualClass) . hasPrefix ( Constants . subclassSuffix) {
7473 return actualClass
7574 }
7675 return nil
7776 }
7877
79- private func replaceGetClass( in class: AnyClass , decoy perceivedClass: AnyClass ) {
78+ private static func replaceGetClass( in class: AnyClass , decoy perceivedClass: AnyClass ) {
8079 let getClass : @convention ( block) ( AnyObject ) -> AnyClass = { _ in
8180 perceivedClass
8281 }
You can’t perform that action at this time.
0 commit comments