gongchengxiaofendui / Game-2048

团队作业
1 stars 0 forks source link

切换界面 #9

Closed gyf-lancelot closed 8 years ago

gyf-lancelot commented 8 years ago

1.在项目下新建文件夹controller 2.在controller中新建选项卡controller,游戏主界面controller,设置界面controller 3.创建游戏视图界面与设置选项卡界面

gyf-lancelot commented 8 years ago

1.在mainviewcontroller中添加 func alertView(alertView:UIAlertView,clickedButtonAtIndex buttonIndex:Int){ self.presentViewController(MainTapViewController(),animated:true,completion:nil) 2.在maintabviewcontroller中写入

import UIKit

class MainTapViewController:UITabBarController{ init() { super.init(nibName:nil,bundle:nil)

    var viewMain = MainViewController()
    viewMain.title = "2048"
    var viewSetting = SettingViewController()
    viewSetting.title = "设置"
    var main = UINavigationController(rootViewController:viewMain)
    var setting = UINavigationController(rootViewController:viewSetting)
    self.viewControllers = [
    main,setting
    ]
    self.selectedIndex = 0
}

} 创建两个视图界面 暂时不对设置界面进行编程,主要先完成游戏界面部分