File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -72,18 +72,18 @@ final public class Interpose {
7272 }
7373
7474 /// Initialize with a single object to interpose.
75- public convenience init ( _ object: NSObject , builder: ( ( Interpose ) throws -> Void ) ? = nil ) throws {
76- try self . init ( . strong( object) , builder: builder)
75+ public convenience init ( _ object: NSObject , bypass : Bool = false , builder: ( ( Interpose ) throws -> Void ) ? = nil ) throws {
76+ try self . init ( . strong( object) , bypass : bypass , builder: builder)
7777 }
7878
7979 /// Initialize with a single object to interpose.
80- public init ( _ objectContainer: AnyObjectContainer , builder: ( ( Interpose ) throws -> Void ) ? = nil ) throws {
80+ public init ( _ objectContainer: AnyObjectContainer , bypass : Bool = false , builder: ( ( Interpose ) throws -> Void ) ? = nil ) throws {
8181 self . objectContainer = objectContainer
8282 self . class = type ( of: objectContainer. object)
8383
8484 let object = objectContainer. object
8585
86- if let actualClass = checkObjectPosingAsDifferentClass ( object) {
86+ if !bypass , let actualClass = checkObjectPosingAsDifferentClass ( object) {
8787 if isKVORuntimeGeneratedClass ( actualClass) {
8888 throw InterposeError . keyValueObservationDetected ( object)
8989 } else {
You can’t perform that action at this time.
0 commit comments