Comments (2)
You should not perform router in lazy getter. And you should not get destination from router directly, because the router only has weak reference to the destination, and the destination may not exist.
If you need to use the destination after performing route, you should hold the destination by yourself.
@interface TestViewController()
@property (nonatomic, strong) id<LivePlayerPublicInterface> livePlayerView;
@end
@implementation TestViewPresenter
- (void)addLivePlayerView {
__weak typeof(self) weakSelf = self;
[ZIKRouterToView(LivePlayerPublicInterface) performPath:ZIKViewRoutePath.addAsSubviewFrom(self.routeSource) configuring:^(ZIKViewRouteConfiguration *config) {
config.prepareDestination = ^(id destination) {
[destination setFrame:CGRectMake(0, 0, kUIScreenWidth, kUIScreenWidth3.0/4.0)];
};
config.successHandler = ^(id destination) {
weakSelf.livePlayerView = destination;
};
}];
}
@end
from zikrouter.
谢谢大哥!爱你一万年!😄
from zikrouter.
Related Issues (20)
- Demo写的太乱了 HOT 4
- URL Route 必须在 ZIKViewRouter 子类里注册吗 HOT 3
- 语言版本问题 HOT 1
- pod完成,编译报错了,请协助解决 HOT 8
- 'init()' is unavailable: Protocol is not declared as routable HOT 22
- 关于混编 HOT 1
- Compiler error on ZRouter under xCode 10.1 swift 4 HOT 2
- 用起来比较麻烦,写个模块的router需要写很多东西 HOT 2
- ZIKViewRouter.m:2112 Assert 错误
- 大佬,看看这个问题怎么办 HOT 4
- Can not get userinfo from url. HOT 3
- 老哥 template页面404了
- 老铁,创建模板报错 HOT 3
- 这个方案如何做代码隔离?
- iOS 13 获取window方案调整了希望可以修复一下 HOT 1
- 你的Demo运行不起来 HOT 1
- How to get url from a router?
- 有几点疑问,问问作者 HOT 1
- 如果是混编项目则是同时依赖ZIKRouter和ZRouter吗?
- 后续还会继续维护么?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zikrouter.