iOS中函数式编程和链式编程的应用

来源:互联网 发布:光纤网络哪家好 编辑:程序博客网 时间:2024/05/22 01:57

基本概念

参考博客链接
http://blog.csdn.net/feng2qing/article/details/53915656
博客里很简洁明了的介绍了函数式和链式编程的实现,基于block实现了可读性强,使用简单舒服的编程方式。

这里基于这种编程方式实现了字符串拼接 以及富文本的方式,可看实例

_label.attributedText = TRString    .string(@"red").color([UIColor redColor]).fontSize(14)    .append(@"blue").color([UIColor blueColor]).fontSize(18)    .append(@"green").color([UIColor greenColor]).fontSize(22)    .append(nil).null(@"-ERROR-").color([UIColor purpleColor])    .toAttributedString;

这里写图片描述

https://git.oschina.net/iamchtj/TRString

ReactiveCocoa学习

参考地址

https://github.com/ReactiveCocoaChina/ReactiveCocoaChineseResources

http://www.cocoachina.com/ios/20150817/13071.html

原创粉丝点击