File tree Expand file tree Collapse file tree 4 files changed +10
-3
lines changed
Expand file tree Collapse file tree 4 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ public final class Hook {
9999 self . strategy. class
100100 }
101101
102+ /// The scope of the hook, indicating whether it targets a method on a class or a specific
103+ /// object.
102104 public var scope : HookScope {
103105 self . strategy. scope
104106 }
@@ -238,6 +240,7 @@ extension Hook: CustomDebugStringConvertible {
238240 }
239241}
240242
243+ /// Represents the current state of a hook during its lifecycle.
241244public enum HookState : Equatable {
242245
243246 /// The hook is ready to be applied.
@@ -251,13 +254,13 @@ public enum HookState: Equatable {
251254
252255}
253256
254- /// Represents the target of a hook operation—either a class type or a specific object instance .
257+ /// Represents the target of a hook operation—either a class type or a specific object.
255258internal enum HookTarget {
256259
257260 /// A hook targeting a method defined on a class, either an instance method or a class method.
258261 case `class`( AnyClass , MethodKind )
259262
260- /// A hook targeting a method on a specific object instance .
263+ /// A hook targeting a method on a specific object.
261264 case object( NSObject )
262265
263266}
Original file line number Diff line number Diff line change 11import ObjectiveC
22
3+ /// Defines what the scope of a hook—either a class (with method kind) or a specific object.
4+ /// This complements the class and selector when setting up a hook.
35public enum HookScope {
46
57 /// The scope that targets a method on a class type (instance or class method).
68 case `class`( MethodKind )
79
8- /// The scope that targets a specific object instance .
10+ /// The scope that targets a specific object.
911 case object( NSObject )
1012
1113}
Original file line number Diff line number Diff line change 11import Foundation
22
3+ /// An error representing failure to prepare, apply, or revert a hook.
34public enum InterposeError : Error , @unchecked Sendable {
45
56 /// A hook operation failed and the hook is no longer usable.
Original file line number Diff line number Diff line change 1+ /// A specification of the method kind: instance or class.
12public enum MethodKind : Equatable {
23
34 /// An instance method, e.g. `-[MyClass doSomething]`.
You can’t perform that action at this time.
0 commit comments