Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/noppefoxwolf/hostingview


https://github.com/noppefoxwolf/hostingview

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

        

# HostingView

# Usage

## HostingView

```swift
let view = HostingView(rootView: Text("Hello, World!"))
```

## StoredHostingView

```swift
let countLabel = StoredHostingView(rootView: CounterView(), CounterView.Model())
countLabel.count += 1
```

```swift
struct CounterView: View {
@Observable
class Model {
var count = 0
}

@Environment(Model.self)
var model

var body: some View {
Text(model.count.formatted())
}
}
```

# License

HostingView is available under the MIT license. See the LICENSE file for more info.