Swift UI学习之UITableView and protocol use

前端之家收集整理的这篇文章主要介绍了Swift UI学习之UITableView and protocol use前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

http://blog.csdn.net/woaifen3344/article/details/29883183

Models: UserModel.swift

Views: UserInfoCell.swift

Controllers: RootViewController.swift,DetailViewController.swift


AppDelegate.swift:

  1. importUIKit
  2. @UIApplicationMain
  3. classAppDelegate:UIResponder,UIApplicationDelegate{
  4. varwindow:UIWindow?
  5. funcapplication(application:UIApplication,didFinishLaunchingWithOptionslaunchOptions:NSDictionary?)->Bool{
  6. self.window=UIWindow(frame:UIScreen.mainScreen().bounds)
  7. //
  8. letrootController=RootViewController(style:UITableViewStyle.Plain)
  9. letrootNav=UINavigationController(rootViewController:rootController)
  10. self.window!.rootViewController=rootNav
  11. self.window!.backgroundColor=UIColor.whiteColor()
  12. self.window!.makeKeyAndVisible()
  13. returntrue
  14. }
  15. }

UserModel.swift


UserInfoCell.swift:


RootViewController.swift:



DetailViewController.swift:


效果图:

原文链接:https://www.f2er.com/swift/324606.html

猜你在找的Swift相关文章