Tag: 台风

Bridging-header.h导致命令/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc失败,退出代码1

如果我将这一行添加到我的PROJECT-Bridging-Header.h文件 #import "Typhoon.h" Xcode 6.1引发此错误/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1 台风框架是由CocoaPods完全像在教程中添加的 我尝试了几个想法,但没有任何帮助 删除XCODE派生数据 创build新的项目 删除并创build新的bridging-header.h文件

用台风注入模拟

我正在写XCTest,并用Typhoon注入嘲弄的依赖。 这里是我的ViewController代码: – (instancetype)init { self = [super init]; MDMainAssembly *assembly = (MDMainAssembly *) [TyphoonComponentFactory defaultFactory]; self.alertManager = [assembly alertManager]; return self; } 这是我如何改变注射: self.mockedAlertManager = mock([MDAlertManager class]); MDMainAssembly *assembly = [MDMainAssembly assembly]; TyphoonComponentFactory *factory = [TyphoonBlockComponentFactory factoryWithAssembly:assembly]; TyphoonPatcher *patcher = [[TyphoonPatcher alloc] init]; [patcher patchDefinition:[assembly alertManager] withObject:^id { return self.mockedAlertManager; }]; [factory attachPostProcessor:patcher]; 然而,testing失败,因为这个工厂不可能设置为默认。 […]

协议中的台风和@objc限制

有没有像在对象C中不支持的协议和types的官方解决方法 作为一个例子,我有一个协议,返回一个反应cocoa信号的生产者 public protocol PLoginService { func login(username:String,password:String) -> SignalProducer<Bool,NSError> } 如果我在协议上使用@objc,那么我将得到编译器错误,即在Objective C中不支持返回types。我将会有很多这样的构造,所以我想知道我能做什么以从中受益台风魔术

台风不注入财产(没有故事板)

我无法通过initWithNibName:bundle:使用XIB将属性注入视图控制器initWithNibName:bundle: 例: 这是我的大会: @implementation AppAssembly – (ViewControllerC *)viewControllerC { return [TyphoonDefinition withClass:[ViewControllerC class] configuration:^(TyphoonDefinition *definition) { [definition injectProperty:@selector(name) with:@"Injected string"]; }]; } @end ViewControllerA代码: @implementation ViewControllerA – (IBAction)buttonAction:(id)sender { ViewControllerB *viewControllerB = [[ViewControllerB alloc] initWithNibName:@"ViewControllerB" bundle:nil]; [self.navigationController pushViewController:viewControllerB animated:YES]; } @end ViewControllerB代码: @implementation ViewControllerB – (IBAction)buttonAction:(id)sender { ViewControllerC *viewControllerC = [[ViewControllerC alloc] initWithNibName:@"ViewControllerC" bundle:nil]; [self.navigationController […]

Swift:无法使用Pod文件中的库

我正在使用Typhoon库进行dependency injection框架。 我使用CocoaPod来安装这个库。 这是我的pod文件: target "typhoon-swift-demo" do pod 'Typhoon' end target "typhoon-swift-demoTests" do end 我已经成功安装,但是当我打开工作区项目文件。 我input那些代码行作为台风样本代码: public class ApplicationAssembly: TyphoonAssembly { } 我遇到错误,我的应用程序不承认TyphoonAssembly我试图使用一些行,如: import Typhoon // not recogize typhoon import TyphoonAssembly // not regconize 请告诉我如何解决这个问题。 我可以使用库之前应该添加什么? 谢谢 :)

台风:大会和故事板 – 创buildViewControllers

我如何使用iOS风格的台风视图控制器由系统隐式生成? 我需要在prepareForSegue方法中做一些特殊的事情吗?