Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
Created January 16, 2026 13:02
Show Gist options
  • Select an option

  • Save jacobsapps/fd505840658a9edd05b96d71a9fe1e08 to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/fd505840658a9edd05b96d71a9fe1e08 to your computer and use it in GitHub Desktop.
import SwiftUI
import PerformanceShared
struct FeedRootView: View {
@State private var viewModel: FeedViewModel
@State private var topStats: Stats = Stats(cpu: 0, gpu: 0)
@State private var topItemID: Int?
@State private var activeStickerGestures = 0
private let assetStore: AssetStore
init() {
let catalog = ResourceCatalog.load()
let assetStore = AssetStore(catalog: catalog)
self.assetStore = assetStore
_viewModel = State(initialValue: FeedViewModel(catalog: catalog))
}
var body: some View {
NavigationStack {
List {
ForEach(Array(viewModel.visibleItems.enumerated()), id: \.element.id) { index, item in
FeedCellView(
item: item,
assetStore: assetStore,
onStickerUpdated: { itemID, stickerID, centerUnit, scale, rotation in
viewModel.updateSticker(
itemID: itemID,
stickerID: stickerID,
centerUnit: centerUnit,
scale: scale,
rotation: rotation
)
},
// ...
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment