2016-08-14 84 views
1

我有错误: 类型uiview的价值没有会员大小。这里是我的代码:类型uiview的价值没有会员大小

if let nv = (AppDelegate.getAppDelegate().window?.rootViewController as? UINavigationController) { 

     let pushedViewControllers = nv.viewControllers 
     let presentedViewController:UIViewController = pushedViewControllers[pushedViewControllers.count - 1] 
     UIGraphicsBeginImageContext(presentedViewController.view.size()) //HERE IS THE ERROR 

检查了h文件,UIViewController有public var view:UIView! 谢谢!

回答

2

问题出在size()而不是view。它应该是view.bounds.size

Value of type uiview has no member size

这是说的UIView实例没有size方法或属性。这是真的。

+0

非常感谢! – nmnir

相关问题