3
如何在Objective-C项目中导入和使用Swift Pod框架
我一直在尝试检出CocoaPods新框架设置以使某些Pod运行起来,而在我的Objective-C项目中使用Swift时遇到了麻烦。 首先,这是CocoaPods预发行版0.35,您可以在此处阅读有关如何使用和安装它的信息。 这是我当前的Podfile: source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' pod 'MBProgressHUD' pod 'SLPagingViewSwift' MBProgressHUD是常见的旋转指示器,SLPagingViewSwift是一个随机项目,我通过在cocoapods搜索中键入Swift来找到。这是ViewController.m在我的项目中: #import "ViewController.h" @import SLPagingViewSwift; @import MBProgressHUD; @interface ViewController () @end @implementation ViewController - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // Works just fine MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.view]; [self.view addSubview:hud]; [hud show:YES]; // Causes Error -- Won't build …