Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noppefoxwolf/hostingview
https://github.com/noppefoxwolf/hostingview
Last synced: 29 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/noppefoxwolf/hostingview
- Owner: noppefoxwolf
- Created: 2024-02-24T19:26:32.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-02-24T19:26:33.000Z (9 months ago)
- Last Synced: 2024-05-02T05:46:01.778Z (6 months ago)
- Language: Swift
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.