★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
➤微信公众号:山青咏芝(let_us_code)
➤博主域名:https://www.zengqiang.org
➤GitHub地址:https://github.com/strengthen/LeetCode
➤原文地址:https://www.cnblogs.com/strengthen/p/13628956.html
➤如果链接不是山青咏芝的博客园地址,则可能是爬取作者的文章。
➤原文已修改更新!强烈建议点击原文地址阅读!支持作者!支持原创!
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
安装:
1、在你的Podfile文件里面添加R.swift pod 'R.swift' 2、在终端运行 `pod install` 3、添加相关设置 对于要添加的内容 1)"$PODS_ROOT/R.swift/rswift" generate "$SRCROOT/R.generated.swift" 2)$TEMP_DIR/rswift-lastrun 3)$SRCROOT/R.generated.swift 4、Command+B 编译工程、会在工程目录下自动生成R.generated.swift文件 5、把R.generated.swift文件拖入工程,去掉复制选项 6、不出意外你就可以快了的使用了
使用:
1. 图片-images
1 func icon() -> UIImage? { 2 switch self { 3 case .sourceRegulator: 4 return R.image.home_SourceRegulatory() 5 case .regulation: 6 return R.image.home_regulationIcon() 7 case .broker: 8 return R.image.home_brokerIcon() 9 case .engine: 10 return R.image.home_engineIcon() 11 case .falseBroker: 12 return R.image.home_falseBrokerIcon() 13 case .spread: 14 return R.image.home_spredIcon() 15 } 16 }
2. 文件-Files
1 let plistURL = R.file.bookPlist() 2 let jsonPath = R.file.DataJson.path()
3.字体-Fonts
R.font.chalkduster(size: 35)
4.Localized strings
1 // Localized strings are grouped per table (.strings file) 2 let welcomeMessage = R.string.localizable.welcomeMessage() 3 let settingsTitle = R.string.settings.title() 4 5 // Functions with parameters are generated for format strings 6 let welcomeName = R.string.localizable.welcomeWithName("Alice") 7 8 // Functions with named argument labels are generated for stringsdict keys 9 let progress = R.string.localizable.copyProgress(completed: 4, total: 23)