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 SwiftyGif | |
| import PerformanceShared | |
| struct StickerUpdate { | |
| let centerUnit: CGPoint | |
| let scale: CGFloat | |
| let rotation: CGFloat | |
| let isInDeleteZone: Bool | |
| } |
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 UIKit | |
| import SwiftyGif | |
| import PerformanceShared | |
| final class FeedViewController: UIViewController { | |
| private let viewModel: FeedViewModel | |
| private let assetStore: AssetStore | |
| private let collectionView: UICollectionView | |
| private let statsToolbarView = StatsToolbarView() | |
| private let navBarGradientView = GradientView( |
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
| final class FeedViewController: UIViewController { | |
| private let viewModel: FeedViewModel | |
| private let assetStore: AssetStore | |
| private let collectionView: UICollectionView | |
| private let statsToolbarView = StatsToolbarView() | |
| private let navBarGradientView = GradientView( | |
| colors: [FeedSpec.NavigationBar.gradientTop, FeedSpec.NavigationBar.gradientBottom], | |
| startPoint: CGPoint(x: 0.5, y: 0.0), | |
| endPoint: CGPoint(x: 0.5, y: 1.0) | |
| ) |
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 |
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
| protocol SearchService { | |
| // stream results directly to view model | |
| var searchResults: AsyncStream<[User]> | |
| func search(query: String) async throws | |
| // cursor-based pagination | |
| func nextPage(query: String, after user: User) -> async throws | |
| } |
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
| protocol Problem1 { | |
| func download() | |
| } | |
| private let imageURLs: [URL] = [ | |
| URL(string: "https://picsum.photos/seed/lorempixum1/400/300")!, | |
| URL(string: "https://picsum.photos/seed/lorempixum2/400/300")!, | |
| URL(string: "https://picsum.photos/seed/lorempixum3/400/300")!, | |
| URL(string: "https://picsum.photos/seed/lorempixum4/400/300")!, | |
| URL(string: "https://picsum.photos/seed/lorempixum5/400/300")!, |
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
| struct PurchaseEvent: Hashable { | |
| let customerId: String | |
| let date: String | |
| let amount: Double | |
| } | |
| final class RevenueTracker { | |
| private var totalsByDate: [String: [String: Double]] = [:] | |
| func addPurchase(_ event: PurchaseEvent) { |
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 UIKit | |
| final class ImageCache { | |
| static let shared = ImageCache() | |
| private let cache = NSCache<NSURL, UIImage>() | |
| private init() {} | |
| func image(for url: URL) -> UIImage? { |
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
| // | |
| // CompositionFilledButtonStyle.swift | |
| // DesignSystemWar | |
| // | |
| // Created by Jacob Bartlett on 07/05/2023. | |
| // | |
| import SwiftUI | |
| /// Filled capsule button style. |
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
| // | |
| // DisclosureButton.swift | |
| // DesignSystemWar | |
| // | |
| // Created by Jacob Bartlett on 07/05/2023. | |
| // | |
| import SwiftUI | |
| /// Button component that exposes variants and options via initializer defaults. |
NewerOlder