在玩APP的时候发现一些APP的peek出来的页面不太一样,显示的是有标题的,比如知乎首页和微博评论的按钮peek操作:




简单分析一下:微博应该是用了navigation controller,而知乎则在pop的页面多了一个top视图,当peek的时候,可以看到多了一个标题的视图,真是简单粗暴.
实现一个微博的效果,简单Swift写一下:
peek页面
|
|
pop的页面:123456789101112import UIKitclass DetailViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. view.backgroundColor = UIColor.cyanColor() title = "评论" }}
这样就可以了.