Eisenhuth / YASU

Yet Another Swift Utility (Package)

Home Page:https://swiftpackageindex.com/Eisenhuth/YASU

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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)

https://swiftpackageindex.com/Eisenhuth/YASU

License:MIT License


Languages

Language:Swift 100.0%