ios - How to call `setViewControllers: animated:` in Swift? -
ios - How to call `setViewControllers: animated:` in Swift? -
i seek alter view controller within navigation controller when user taps button, declared next code:
if standingsviewcontroller == nil { standingsviewcontroller = standingsviewcontroller() splitviewcontroller!.delegate = standingsviewcontroller } var vc = splitviewcontroller!.viewcontrollers[1] uinavigationcontroller vc.setviewcontrollers([standingsviewcontroller], animated: true)
however, causes error: fatal error: effort bridge implicitly unwrapped optional containing nil
on lastly line.
uinavigationcontroller
's setviewcontrollers: animated:
method defined in swift properly, how can prepare problem?
for info when seek alter [standingsviewcontroller]!
, didn't pass compiling because [anyobject] not identical [anyobject]!
.
i utilize xcode 6.1 beta in swift.
looks forgot unwrap:
vc.setviewcontrollers([standingsviewcontroller!], animated: true)
instead of
vc.setviewcontrollers([standingsviewcontroller], animated: true)
ios swift uinavigationcontroller
Comments
Post a Comment