Skip to content

Instantly share code, notes, and snippets.

@mosluce
Created March 16, 2018 07:34
Show Gist options
  • Save mosluce/0045b28e497b4ca722a49634bb2a5364 to your computer and use it in GitHub Desktop.
Save mosluce/0045b28e497b4ca722a49634bb2a5364 to your computer and use it in GitHub Desktop.
//
// AppDelegate.swift
// Signbook
//
// Created by 默司 on 2018/3/16.
// Copyright © 2018年 CCMOS. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = KLTabBarController()
window?.backgroundColor = UIColor.white
window?.makeKeyAndVisible()
IQKeyboardManager.sharedManager().enable = true
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
//
// KLBoardViewController.swift
// Signbook
//
// Created by 默司 on 2018/3/16.
// Copyright © 2018年 CCMOS. All rights reserved.
//
import UIKit
class KLBoardViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.tabBarItem = UITabBarItem(title: "000", image: #imageLiteral(resourceName: "icons8-billboard_filled"), tag: 0)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
//
// KLSignListViewController.swift
// Signbook
//
// Created by 默司 on 2018/3/16.
// Copyright © 2018年 CCMOS. All rights reserved.
//
import UIKit
class KLSignListViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.tabBarItem = UITabBarItem(title: "000", image: #imageLiteral(resourceName: "icons8-billboard_filled"), tag: 0)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
//
// KLTabBarController.swift
// Signbook
//
// Created by 默司 on 2018/3/16.
// Copyright © 2018年 CCMOS. All rights reserved.
//
import UIKit
let appDelegate = UIApplication.shared.delegate as! AppDelegate
class KLTabBarController: UITabBarController {
var boardViewController = KLBoardViewController()
var signListViewController = KLSignListViewController()
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.setViewControllers([boardViewController, signListViewController], animated: false)
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
extension KLTabBarController {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment