8000 GitHub - Eisenhuth/YASU: Yet Another Swift Utility (Package)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Eisenhuth/YASU

Repository files navigation

Yet Another Swift Utility

Workflow Badge

packaging some basic boilerplate functions.

import YASU

loading some json data from a url

@State private var myDataType: MyDataType?

var body: some View {

    let myDataSourceUrl = URL(string: "https://my.datasource.url")!
    
    VStack {
        Text(myDataType.SomePropertyValue ?? "")
    }
    .task{
        await myDataType = loadData(myDataSourceUrl)
    }
}

loading some json from the bundle

var myDataType: MyDataType = Bundle.main.decode("MyBundledJsonFile.json")

var body: some View {    
    VStack {
        Text(myDataType.SomePropertyValue)
    }
}

About

Yet Another Swift Utility (Package)

Topics

Resources

License

Stars

Watchers

Forks

Languages

0