文件名称:RYLazyProperty:好玩的Runtime --- 一行代码解决懒加载
文件大小:39KB
文件格式:ZIP
更新时间:2024-06-06 21:08:27
Objective-C
好玩的Runtime: 一行代码解决懒加载 解决问题: 更方便的懒加载 - (Animal *)animal { if (_animal) { _animal = [Animal new]; } return _layerView; } 部分数据的容错 self.nameLabel.text = [NSString stringWithFormat:@"动物名称:%@", self.animal.name]; 使用方法: [Animal ry_setLazyPropertyArr:@[@"name",@"foots",@"attribute",]]; [ViewController ry_setLazyPropertyArr:@[@"animal"]]; 该方法仅支持 Objective-C 对象 在调用通过 ry_setLazyPropertyA
【文件预览】:
RYLazyProperty-master
----LazyProperty.xcodeproj()
--------project.xcworkspace()
--------xcuserdata()
--------project.pbxproj(12KB)
----README.md(788B)
----.gitignore(281B)
----LazyProperty()
--------ViewController.m(2KB)
--------Info.plist(1KB)
--------main.m(334B)
--------NSObject+RYLazyProperty.h(341B)
--------NSObject+RYLazyProperty.m(3KB)
--------Base.lproj()
--------ViewController.h(215B)
--------AppDelegate.h(277B)
--------Assets.xcassets()
--------AppDelegate.m(2KB)