Skip to content

Proof of concept for back-porting Observation framework to earlier iOS versions

Notifications You must be signed in to change notification settings

beforeold/ObservationBP

 
 

Repository files navigation

Description

ObservationBP wraps swift-percetion for a better code indentation

How to use

User ViewBP protocol and bodyBP instead of WithPerceptionTracking

import ObservationBP
import SwiftUI

@Perceptible
final class Person {
    var name: String
    var age: Int

    init(name: String, age: Int) {
        self.name = name
        self.age = age
    }
}

struct ContentView: ViewBP {
    var person: Person = Person(name: "name", age: 1)

    var bodyBP: some View {
        VStack {
            Text("Hello, \(person.name)")
        }
    }
}

Acknowledgement

Great backporting of Observation framework swift-perception

About

Proof of concept for back-porting Observation framework to earlier iOS versions

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%