UserDefault:借助属性包装器,Swifty用户默认设置-源码

上传者: 42132359 | 上传时间: 2021-06-03 08:40:30 | 文件大小: 15KB | 文件类型: ZIP
用户默认 UserDefaults设计的属性包装器接口。 该程序包最初是试图编写用于访问UserDefaults的属性包装程序的。 但是,它很快就超出了这个范围,因为我想避免使用无法直接进行属性列表转换的类型的所有开销。 例子 直接储存 @UserDefault ( " hasSeenSplashScreen " ) var hasSeenSplashScreen = false @UserDefault ( " name " ) var name: String ? @UserDefault ( " count " ) var count: Int ? = 42 hasSeenSplashScreen = true name = " John Appleseed " count = nil 可编码/ NSCoding Codable有一个协议扩展,可让您避免自己编写样板: stru

文件下载

资源详情

[{"title":"( 23 个子文件 15KB ) UserDefault:借助属性包装器,Swifty用户默认设置-源码","children":[{"title":"UserDefault-master","children":[{"title":".gitignore <span style='color:#111;'> 125B </span>","children":null,"spread":false},{"title":"Package.swift <span style='color:#111;'> 1.06KB </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 3.80KB </span>","children":null,"spread":false},{"title":"Sources","children":[{"title":"UserDefault","children":[{"title":"DefaultsValueConvertible.swift <span style='color:#111;'> 1.00KB </span>","children":null,"spread":false},{"title":"Conditional Conformances","children":[{"title":"Codable.swift <span style='color:#111;'> 354B </span>","children":null,"spread":false},{"title":"Array.swift <span style='color:#111;'> 528B </span>","children":null,"spread":false},{"title":"Collection.swift <span style='color:#111;'> 957B </span>","children":null,"spread":false},{"title":"RawRepresentable.swift <span style='color:#111;'> 600B </span>","children":null,"spread":false},{"title":"Optional.swift <span style='color:#111;'> 629B </span>","children":null,"spread":false},{"title":"Dictionary.swift <span style='color:#111;'> 830B </span>","children":null,"spread":false},{"title":"NSCoding.swift <span style='color:#111;'> 849B </span>","children":null,"spread":false}],"spread":true},{"title":"IndirectDefaultsValueConvertible.swift <span style='color:#111;'> 736B </span>","children":null,"spread":false},{"title":"DefaultsValue.swift <span style='color:#111;'> 1.52KB </span>","children":null,"spread":false},{"title":"UserDefault.swift <span style='color:#111;'> 1.96KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Package.resolved <span style='color:#111;'> 338B </span>","children":null,"spread":false},{"title":"Tests","children":[{"title":"LinuxMain.swift <span style='color:#111;'> 77B </span>","children":null,"spread":false},{"title":"UserDefaultTests","children":[{"title":"SimpleTests.swift <span style='color:#111;'> 2.27KB </span>","children":null,"spread":false},{"title":"Types.swift <span style='color:#111;'> 1.23KB </span>","children":null,"spread":false},{"title":"PropertyWrapperTests.swift <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"Tests.swift <span style='color:#111;'> 736B </span>","children":null,"spread":false},{"title":"XCTestManifests.swift <span style='color:#111;'> 239B </span>","children":null,"spread":false},{"title":"FailureTests.swift <span style='color:#111;'> 2.97KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":".editorconfig <span style='color:#111;'> 52B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明