WWUserDefaults

main

Use the "property wrapper" to make an enhanced version of UserDefaults.
William-Weng/WWUserDefaults

WWUserDefaults

Swift-5.6 iOS-14.0 Swift Package Manager-SUCCESS LICENSE

  • Use the "property wrapper" to make an enhanced version of UserDefaults.
  • 利用「屬性包裝器」做成UserDefaults加強版。

WWUserDefaults

dependencies: [
    .package(url: "https://github.com/William-Weng/WWUserDefaults.git", .upToNextMajor(from: "1.0.0"))
]

Function - 可用函式

函式 功能
@WWUserDefaults() 修飾子

Example

import UIKit
import WWPrint
import WWUserDefaults

final class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        userDefaultsTest()
    }
    
    /// WWUserDefaults測試
    func userDefaultsTest() {
        
        let urlString = "https://developer.apple.com/videos/play/wwdc2019/262/"
        let newValue = "https://www.appcoda.com.tw/app-security/"
        
        @WWUserDefaults("PASSWORD") var password: String?
        
        password = urlString
        wwPrint(password)
        
        password = newValue
        wwPrint(password)
        
        password = nil
        wwPrint(password)
    }
}

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 18 2024 04:42:21 GMT-0900 (Hawaii-Aleutian Daylight Time)