ios8页面手写布局代码
AppDelegate:
self.window = UIWindow(frame: UIScreen.mainScreen().bounds) self.window!.backgroundColor = UIColor.whiteColor() self.window!.makeKeyAndVisible() self.window!.rootViewController = CounterViewController() application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: UIUserNotificationType.Sound | UIUserNotificationType.Alert | UIUserNotificationType.Badge, categories: nil ))
ViewController:
override func viewWillLayoutSubviews(){ super.viewWillLayoutSubviews()
...... }