Skip to content

API Wrapper for Perception for OBservation Backporting to iOS 13

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

ViewBP

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)")
        }
    }
}

OCObserableBP

use the wrapper for Objective-C classes

Acknowledgement

Great backporting of Observation framework swift-perception

About

API Wrapper for Perception for OBservation Backporting to iOS 13

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Swift 100.0%