I wanna transition screens in my app but it cannot be done. I used TabBarController and I made Tab1 item and Tab2 item. When I tapped Tab2 in my simulator, my app dropped.
import UIKit
import SwiftyJSON
class ViewController: UIViewController {
@IBOutlet var KenshinPic: UITabBarItem!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
extension ViewController : UITabBarControllerDelegate {
public func tabBarController(tabBarController: UITabBarController, viewController: UIViewController) -> Bool {
if(viewController.restorationIdentifier == "first") {
self.tabBarController!.setViewControllers([KenshinSendController() , KenshinViewController()], animated: false);
let items = self.tabBarController!.tabBar.items;
items![1].title = "Second";
items![0].title = "First";
return false;
}
return true;
}
}
Below sentences didn't be called in Xcode when I run my app.
enter code here
self.tabBarController!.setViewControllers([KenshinSendController() , KenshinViewController()], animated: false);
Error message was 'signal SIGABRT'
in class AppDelegate: UIResponder, UIApplicationDelegate {
of AppDelegate file.
What shoud I do?