All Projects → 0xLeif → ObjectUI

0xLeif / ObjectUI

Licence: MIT License
Create SwiftUI Views with any data

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to ObjectUI

PathBuilder
SwiftUI result builder for Path
Stars: ✭ 48 (+152.63%)
Mutual labels:  swiftui
SwiftUIKit
A collection of missing SwiftUI components
Stars: ✭ 198 (+942.11%)
Mutual labels:  swiftui
Luna
Tracking the moon phase using SwiftUI and Combine
Stars: ✭ 19 (+0%)
Mutual labels:  swiftui
SwiftUIRedux
🚀Comprehensive Redux library for SwiftUI, ensures State consistency across Stores with type-safe pub/sub pattern.
Stars: ✭ 18 (-5.26%)
Mutual labels:  swiftui
Less3
Less3 is an S3-compatible object storage server that runs on your laptop, servers, just about anywhere!
Stars: ✭ 16 (-15.79%)
Mutual labels:  object
reminders-menubar
Simple macOS menu bar application to view and interact with reminders. Developed with SwiftUI and using Apple Reminders as a source.
Stars: ✭ 250 (+1215.79%)
Mutual labels:  swiftui
lockd
Generate strong passwords and save them in Keychain. Made with SwiftUI
Stars: ✭ 38 (+100%)
Mutual labels:  swiftui
MyFavoriteB
macOS上的B站民间客户端
Stars: ✭ 33 (+73.68%)
Mutual labels:  swiftui
DynamicOverlay
A SwiftUI library that makes easier to develop overlay based interfaces, such as the one presented in the Apple Maps app.
Stars: ✭ 90 (+373.68%)
Mutual labels:  swiftui
SwiftUI-LifeGame
The Conway's Game of Life that build with SwiftUI.
Stars: ✭ 37 (+94.74%)
Mutual labels:  swiftui
TagField
🏷 Simple Tag Field for SwiftUI 🏷
Stars: ✭ 19 (+0%)
Mutual labels:  swiftui
HNReaderApp
Hacker News client for macOS
Stars: ✭ 169 (+789.47%)
Mutual labels:  swiftui
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (+321.05%)
Mutual labels:  swiftui
get
🚚 A really small and type-safe (requires TypeScript >= 4.1.3) function, that gets a nested value from an object using a path string (like "a.b[0].d"). If value is 'undefined' or unreachable returns the placeholder instead.
Stars: ✭ 13 (-31.58%)
Mutual labels:  object
Laden
SwiftUI loading indicator view
Stars: ✭ 23 (+21.05%)
Mutual labels:  swiftui
object-shape
Get a description of a JS object's shape.
Stars: ✭ 24 (+26.32%)
Mutual labels:  object
normalize-pkg
Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.
Stars: ✭ 18 (-5.26%)
Mutual labels:  object
StoryboardPreviewsBySwiftUI
Introduce how to make the Storyboard file and Xib file correspond to the preview function by SwiftUI.
Stars: ✭ 35 (+84.21%)
Mutual labels:  swiftui
RichText
Easily show RichText(html) in SwiftUI
Stars: ✭ 25 (+31.58%)
Mutual labels:  swiftui
iOS
The source of V2er.iOS
Stars: ✭ 194 (+921.05%)
Mutual labels:  swiftui

ObjectUI

Create SwiftUI Views with any data

Usage

import ObjectUI

Basic Examples

ObjectView

struct ContentView: View {
    var body: some View {
        ObjectView(data: "Hello, World 👋") { object in
            if let text = object.value(as: String.self) {
                Text(text)
            } else {
                ProgressView()
            }
        }
    }
}

StateObjectView

struct ContentView: View {
    var body: some View {
        StateObjectView { object in
            if let text = object.value(as: String.self) {
                Text(text)
            } else {
                ProgressView()
                    .onAppear {
                        DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
                            object.set(value: "👋")
                        }
                    }
            }
        }
    }
}

JSON Example

struct ContentView: View {
    let json = """
        {
          "userId": 1,
          "id": 2,
          "title": "quis ut nam facilis et officia qui",
          "completed": false
        }
        """
        .data(using: .utf8)
    
    var body: some View {
        ObjectView(data: json) { object in
            VStack {
                object.userId.value(as: Int.self).map { userId in
                    Text("\(userId)")
                }
                
                object.id.value(as: Int.self).map { id in
                    Text("\(id)")
                }
                
                object.title.value(as: String.self).map { title in
                    Text(title)
                }
                
                object.completed.value(as: Bool.self).map { completed in
                    Text(completed.description)
                }
            }
        }
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].