Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

will zikrouter provide an api to shutdown the ZIKROUTER_CHECK function #11

Closed
manajay opened this issue Apr 1, 2019 · 3 comments
Closed

Comments

@manajay
Copy link

manajay commented Apr 1, 2019

whenever developing a component ,i found it's hard to run the demo of the component because of checking the missing protocol function. Especially when cycle dependency appears.

@Zuikyo
Copy link
Owner

Zuikyo commented Apr 1, 2019

If you're developing a component and don't need to test it's dependency, you can use fake class as dependency in demo or unit test. Like this:

@protocol DependencyViewInput1 <ZIKViewRoutable>
@end

@protocol DependencyViewInput2 <ZIKViewRoutable>
@end
@interface FakeViewController: UIViewController <DependencyViewInput1, DependencyViewInput2>
@end
@implementation FakeViewController
@end
@implementation DependencyRouteAdapter

+ (void)registerRoutableDestination {
    [ZIKViewRouter registerViewProtocol:ZIKRoutable(DependencyViewInput1) forMakingView:[FakeViewController class]];
    [ZIKViewRouter registerViewProtocol:ZIKRoutable(DependencyViewInput2) forMakingView:[FakeViewController class]];
}

@end

Or you can change Xcode's default value for macro DEBUG in Build Settings->Preprocessor Macros. When DEBUG=0, ZIKROUTER_CHECK is disabled.

@Zuikyo
Copy link
Owner

Zuikyo commented Apr 1, 2019

I will add better support for modifing ZIKROUTER_CHECK macro value in next version.

@manajay
Copy link
Author

manajay commented Apr 9, 2019

thanks

@manajay manajay closed this as completed Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants