MMMNavigation
Objective-C
@interface MMMNavigation : NSObject
Swift
class MMMNavigation : NSObject
Manages switching between different sections of the app (kind of internal URL router). It’s like a central hub accepting navigation requests and then passing them to the entities that able to perform them. (The entities that are able to open requests should register themselves as handlers.)
-
Undocumented
Declaration
Objective-C
+ (instancetype)root;
Swift
class func root() -> Self
-
Starts the process of opening of the given path. Calls the completion block when done, the block receives ID of the corresponding request. Links are opened one by one. Any navigation request received while handling the current one will be queued.
Declaration
Objective-C
- (nonnull MMMNavigationRequestId) navigateTo:(nonnull MMMNavigationPath *)path completion:(nonnull MMMNavigationCompletionBlock)completion;
Swift
func navigate(to path: MMMNavigationPath, completion: @escaping MMMNavigationCompletionBlock) -> Any
-
Adds a handler and returns a cookie/ID object that can be later used to remove it.
Declaration
Objective-C
- (nonnull MMMNavigationHandlerId)addHandler: (nonnull id<MMMNavigationHandler>)handler;
Swift
func add(_ handler: any MMMNavigationHandler) -> Any
-
Removes a handler by its ID assigned by addHandler.
Declaration
Objective-C
- (void)removeHandlerWithId:(nonnull MMMNavigationHandlerId)handlerId;
Swift
func removeHandler(withId handlerId: Any)