Created
January 16, 2026 13:02
-
-
Save jacobsapps/fd505840658a9edd05b96d71a9fe1e08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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