How to open up View Controller included in framework as static library for iOS?

狂风中的少年 提交于 2019-12-24 00:49:29

问题


I have a View Controller which displays many nested UIViews. I want this project which displays many views to be embedded in another project as framework. So, how can I open View Controller of my framework from another project which has included this framework for third party use.


回答1:


You can use a method on your framework to return your viewController something like this

- (UIViewController*)viewControllerForWidgetType:(WidgetType)widgetType;

and then in the app that uses your framework use something like this

UIViewController* testWidgetViewController = [[TestFrameworkController sharedInstance]viewControllerForWidgetType:TestWidgetType];

[self.navigationController pushViewController:testWidgetViewController animated:YES];

I hope this helps you



来源:https://stackoverflow.com/questions/38507208/how-to-open-up-view-controller-included-in-framework-as-static-library-for-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!