用这篇文章的代码
http://blog.csdn.net/liuyu1114/article/details/24771717
但是报错,不能使用“|”。
No "|" candidates produce the expected contextual result type...
原来是xcode 7 语法改变了。应该这样使用
https://www.zhihu.com/question/35493859
然后就对了