如何打开框架中包含的 View Controller 作为 iOS 的静态库?

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

我有一个显示许多嵌套 UIView 的视图控制器。我希望这个显示许多视图的项目作为框架嵌入到另一个项目中。那么,如何从另一个包含该框架供第三方使用的项目打开我的框架的 View Controller。

你可以在你的框架上使用一个方法来return你的viewController像这样

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

然后在使用您的框架的应用程序中使用类似这样的东西

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

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

希望对你有帮助