一个解决跨试图传值的轻量级框架

2015-05-27 23:33:08 +08:00
 Draven

github: https://github.com/Draveness/SpaceShuttle

使用 push present 操作时, 为 viewcontroller 传值是一件非常容易的事情,

但是在 dismiss 或 pop 的时候, 为视图传值却有一些麻烦

SpaceShuttle 为视图间传值提供了统一的接口.

Push

[self.navigationController pushViewController:succViewController
                                    animated:YES
                                    supplies:@{@"test":@1}];

Pop

[self.navigationController popViewControllerAnimated:YES
                                            supplies:@{@"test": @1}];

Present

[self presentViewController:succViewController
                   animated:YES
                 completion:nil
                   supplies:@{@"test":@1}];

Dismiss

[self dismissViewControllerAnimated:YES
                         completion:nil
                           supplies:@{@"test":@1}];

https://github.com/Draveness/SpaceShuttle

代码实现还是蛮简单的, 不过现在不知道该加一些其他的什么功能了, 求各位 V 友的建议~~

2347 次点击
所在节点    分享创造
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/194250

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX