我想在我的应用中使用此控件
https://github.com/pyro2927/GKLParallaxPictures
我的应用正在使用Storyboards。在View的viewDidLoad中我希望使用GLKParallaxPictures有以下代码:
UIImage *testImage = [UIImage imageNamed:@"300-g.jpg"];
NSArray *photosArray1 = @[testImage, testImage, testImage];
GKLParallaxPicturesViewController *paralaxViewController = [[GKLParallaxPicturesViewController alloc] initWithImages:photosArray1 andContentWebView:webView];
[self.view addSubview:paralaxViewController.view];
上面代码的最后一行引发异常。
在控件的原始示例中,作者在AppDelegate中具有以下代码
UIImage *testImage = [UIImage imageNamed:@"shovel"];
NSArray *images = @[testImage, testImage, testImage];
GKLParallaxPicturesViewController *paralaxViewController = [[GKLParallaxPicturesViewController alloc] initWithImages:images
andContentWebView:testWebView];
self.viewController = paralaxViewController;
self.window.rootViewController = paralaxViewController;
[self.window makeKeyAndVisible];
return YES;