Something went wrong. Try again.
A slopfork of Sam Henri Gold's Twitter client, reskinned like Tweetie 2 / Twitter for iPhone circa 2012. Personal use.
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960import ComposableArchitectureimport ImagePipelineimport MainFeatureimport Routingimport SwiftUIimport TwitterClientimport TwitterUI
/// The app's scenes: the main window, plus standalone windows for a post, profile, or search that people open beside/// it on iPhone Duo's inner display (the system only offers new windows where there's room for them).public struct TwitterScenes: Scene { public init() { NotificationTapDelegate.install() }
public var body: some Scene { WindowGroup { AppView() .limitsImageHeadroom() .appliesAppearance() .appliesAppLock() .schedulesNotificationChecks() } .backgroundTask(.appRefresh(NotificationCheck.taskID)) { await NotificationCheck.run() }
WindowGroup("Twitter", for: WindowRoute.self) { $route in if let route { RouteWindowRoot(route: route) .id(route) .limitsImageHeadroom() .appliesAppearance() .appliesAppLock() .asyncImageURLSession(.images) } else { ContentUnavailableView("Nothing to Show", twitterIcon: .newWindow) } } // Only "Open in New Window" makes these; the system's New Window command belongs to the main group. .commandsRemoved() }}
private struct RouteWindowRoot: View { @State private var store: StoreOf<RouteWindowFeature>
init(route: WindowRoute) { store = Store(initialState: RouteWindowFeature.State(route: route)) { RouteWindowFeature() } withDependencies: { $0.useMockTwitterIfRequested() } }
var body: some View { RouteWindowView(store: store) }}