Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从设置包中以编程方式更改拨动开关的默认值。如果有人可以帮助我,请。
用于register(defaults:)为您的 UserDefaults 值设置默认值,如下所示:
register(defaults:)
UserDefaults.standard.register(defaults: [ "toggleSwitchKey": true ])