@@ -93,13 +93,13 @@ final public class Interpose {
9393extension Interpose {
9494 /// A task represents a hook to an instance method and stores both the original and new implementation.
9595 final public class Task {
96- /// The class this tasks operates on
96+ /// The class this tasks operates on.
9797 public let `class` : AnyClass
9898
99- /// The selector this tasks operates on
99+ /// The selector this tasks operates on.
100100 public let selector : Selector
101101
102- /// The original implementation is set once the swizzling is complete
102+ /// The original implementation is set once the swizzling is complete.
103103 public private( set) var origIMP : IMP ? // fetched at apply time, changes late, thus class requirement
104104
105105 /// The replacement implementation is created on initialization time.
@@ -108,9 +108,9 @@ extension Interpose {
108108 /// The state of the interpose operation.
109109 public private( set) var state = State . prepared
110110
111- /// The possible task states
111+ /// The possible task states.
112112 public enum State : Equatable {
113- /// The task is prepared to be nterposed .
113+ /// The task is prepared to be interposed .
114114 case prepared
115115
116116 /// The method has been successfully interposed.
@@ -129,7 +129,7 @@ extension Interpose {
129129 replacementIMP = imp_implementationWithBlock ( implementation ( self ) )
130130 }
131131
132- /// Validate that the selector exists on the active class
132+ /// Validate that the selector exists on the active class.
133133 @discardableResult func validate( expectedState: State = . prepared) throws -> Method {
134134 guard let method = class_getInstanceMethod ( `class`, selector) else { throw Error . methodNotFound }
135135 guard state == expectedState else { throw Error . invalidState }
@@ -171,7 +171,7 @@ extension Interpose {
171171 Interpose . log ( " Restored -[ \( `class`) . \( selector) ] IMP: \( origIMP!) " )
172172 }
173173
174- /// Convenience to call the original implementation
174+ /// Convenience to call the original implementation.
175175 public func callAsFunction< U> ( _ type: U . Type ) -> U {
176176 unsafeBitCast ( origIMP, to: type)
177177 }
@@ -184,7 +184,7 @@ extension Interpose {
184184 /// Logging uses print and is minimal.
185185 public static var isLoggingEnabled = true
186186
187- /// Simply log wrapper for print
187+ /// Simple log wrapper for print.
188188 fileprivate class func log( _ object: Any ) {
189189 if isLoggingEnabled {
190190 print ( " [Interposer] \( object) " )
@@ -210,7 +210,7 @@ extension Interpose {
210210 try whenAvailable ( classParts. joined ( ) , builder: builder, completion: completion)
211211 }
212212
213- /// Interpose a class once available. Class is passed via `className` string..
213+ /// Interpose a class once available. Class is passed via `className` string.
214214 @discardableResult public class func whenAvailable( _ className: String ,
215215 builder: @escaping ( Interpose ) throws -> Void ) throws -> Waiter {
216216 try Waiter ( className: className, builder: builder, completion: nil )
0 commit comments