diff --git a/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift b/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift index 816f679684..e85659b19c 100644 --- a/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift +++ b/submodules/LegacyDataImport/Sources/LegacyDataImportSplash.swift @@ -4,7 +4,12 @@ import AsyncDisplayKit import TelegramPresentationData import RadialStatusNode -public final class LegacyDataImportSplash: WindowCoveringView { +public protocol LegacyDataImportSplash: WindowCoveringView { + var progress: (AccountImportProgressType, Float) { get set } + var serviceAction: (() -> Void)? { get set } +} + +private final class LegacyDataImportSplashImpl: WindowCoveringView, LegacyDataImportSplash { private let theme: PresentationTheme? private let strings: PresentationStrings? @@ -78,3 +83,7 @@ public final class LegacyDataImportSplash: WindowCoveringView { } } } + +public func makeLegacyDataImportSplash(theme: PresentationTheme?, strings: PresentationStrings?) -> LegacyDataImportSplash { + return LegacyDataImportSplashImpl(theme: theme, strings: strings) +} diff --git a/submodules/OverlayStatusController/Sources/OverlayStatusController.swift b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift index 712a3297ec..a7e5bb0a97 100644 --- a/submodules/OverlayStatusController/Sources/OverlayStatusController.swift +++ b/submodules/OverlayStatusController/Sources/OverlayStatusController.swift @@ -133,7 +133,7 @@ public enum OverlayStatusControllerStyle { case dark } -public final class OverlayStatusController: ViewController, StandalonePresentableController { +private final class OverlayStatusControllerImpl: ViewController, StandalonePresentableController { private let style: OverlayStatusControllerStyle private let type: OverlayStatusControllerType @@ -152,7 +152,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl self.statusBar.statusBarStyle = .Ignore } - required init(coder aDecoder: NSCoder) { + required public init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } @@ -183,3 +183,7 @@ public final class OverlayStatusController: ViewController, StandalonePresentabl self.controllerNode.dismiss() } } + +public func OverlayStatusController(style: OverlayStatusControllerStyle, type: OverlayStatusControllerType) -> ViewController { + return OverlayStatusControllerImpl(style: style, type: type) +} diff --git a/submodules/PresentationDataUtils/Sources/OverlayStatusController.swift b/submodules/PresentationDataUtils/Sources/OverlayStatusController.swift index 2b73980cb8..5974ba4d95 100644 --- a/submodules/PresentationDataUtils/Sources/OverlayStatusController.swift +++ b/submodules/PresentationDataUtils/Sources/OverlayStatusController.swift @@ -2,9 +2,8 @@ import Foundation import UIKit import OverlayStatusController import TelegramPresentationData +import Display -public extension OverlayStatusController { - convenience init(theme: PresentationTheme, type: OverlayStatusControllerType) { - self.init(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type) - } +public func OverlayStatusController(theme: PresentationTheme, type: OverlayStatusControllerType) -> ViewController { + return OverlayStatusController(style: theme.actionSheet.backgroundType == .light ? .light : .dark, type: type) } diff --git a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift index 4e1e356676..aa56df559d 100644 --- a/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift +++ b/submodules/SettingsUI/Sources/Data and Storage/ProxyServerActionSheetController.swift @@ -11,6 +11,7 @@ import TelegramPresentationData import ActivityIndicator import OverlayStatusController import AccountContext +import PresentationDataUtils public final class ProxyServerActionSheetController: ActionSheetController { private var presentationDisposable: Disposable? diff --git a/submodules/SettingsUI/Sources/OpenSettings.swift b/submodules/SettingsUI/Sources/OpenSettings.swift index 39f0bed237..7a8af13c36 100644 --- a/submodules/SettingsUI/Sources/OpenSettings.swift +++ b/submodules/SettingsUI/Sources/OpenSettings.swift @@ -6,6 +6,7 @@ import TelegramCore import SyncCore import OverlayStatusController import AccountContext +import PresentationDataUtils private let maximumNumberOfAccounts = 3 diff --git a/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift b/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift index 6d1abcadff..cc65fc5383 100644 --- a/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift +++ b/submodules/SettingsUI/Sources/Themes/ThemeGridController.swift @@ -14,6 +14,7 @@ import AccountContext import ShareController import SearchUI import HexColor +import PresentationDataUtils final class ThemeGridController: ViewController { private var controllerNode: ThemeGridControllerNode { diff --git a/submodules/TelegramUI/TelegramUI/AppDelegate.swift b/submodules/TelegramUI/TelegramUI/AppDelegate.swift index 347721b101..71c746d538 100644 --- a/submodules/TelegramUI/TelegramUI/AppDelegate.swift +++ b/submodules/TelegramUI/TelegramUI/AppDelegate.swift @@ -32,6 +32,7 @@ import WalletUrl import WalletCore import OpenSSLEncryptionProvider import AppLock +import PresentationDataUtils #if canImport(BackgroundTasks) import BackgroundTasks @@ -627,7 +628,7 @@ final class SharedApplicationContext { return (upgradedAccounts(accountManager: accountManager, rootPath: rootPath, encryptionParameters: encryptionParameters) |> deliverOnMainQueue).start(next: { progress in if self.dataImportSplash == nil { - self.dataImportSplash = LegacyDataImportSplash(theme: nil, strings: nil) + self.dataImportSplash = makeLegacyDataImportSplash(theme: nil, strings: nil) self.dataImportSplash?.serviceAction = { self.debugPressed() } @@ -739,7 +740,7 @@ final class SharedApplicationContext { }, displayUpgradeProgress: { progress in if let progress = progress { if self.dataImportSplash == nil { - self.dataImportSplash = LegacyDataImportSplash(theme: initialPresentationDataAndSettings.presentationData.theme, strings: initialPresentationDataAndSettings.presentationData.strings) + self.dataImportSplash = makeLegacyDataImportSplash(theme: initialPresentationDataAndSettings.presentationData.theme, strings: initialPresentationDataAndSettings.presentationData.strings) self.dataImportSplash?.serviceAction = { self.debugPressed() } @@ -881,7 +882,7 @@ final class SharedApplicationContext { case let .progress(type, value): Queue.mainQueue().async { if self.dataImportSplash == nil { - self.dataImportSplash = LegacyDataImportSplash(theme: nil, strings: nil) + self.dataImportSplash = makeLegacyDataImportSplash(theme: nil, strings: nil) self.dataImportSplash?.serviceAction = { self.debugPressed() } diff --git a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift index 5a3ec081ac..338a44a2ad 100644 --- a/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift +++ b/submodules/TelegramUI/TelegramUI/ChatInterfaceStateContextMenus.swift @@ -14,6 +14,7 @@ import ContextUI import LegacyUI import AppBundle import SaveToCameraRoll +import PresentationDataUtils private struct MessageContextMenuData { let starStatus: Bool? diff --git a/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift b/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift index 2e95ed5193..366ded3c86 100644 --- a/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift +++ b/submodules/TelegramUI/TelegramUI/ChatMediaInputTrendingPane.swift @@ -11,6 +11,7 @@ import MergeLists import OverlayStatusController import AccountContext import StickerPackPreviewUI +import PresentationDataUtils final class TrendingPaneInteraction { let installPack: (ItemCollectionInfo) -> Void diff --git a/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift b/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift index ae5871dd0e..2ce3de8038 100644 --- a/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift +++ b/submodules/TelegramUI/TelegramUI/OpenResolvedUrl.swift @@ -209,7 +209,7 @@ func openResolvedUrlImpl(_ resolvedUrl: ResolvedUrl, context: AccountContext, ur } case let .wallpaper(parameter): let presentationData = context.sharedContext.currentPresentationData.with { $0 } - var controller: OverlayStatusController? + var controller: ViewController? let signal: Signal var options: WallpaperPresentationOptions? diff --git a/submodules/WalletUI/Sources/WalletPresentationData.swift b/submodules/WalletUI/Sources/WalletPresentationData.swift index 23546e32d8..5ad8dd9cda 100644 --- a/submodules/WalletUI/Sources/WalletPresentationData.swift +++ b/submodules/WalletUI/Sources/WalletPresentationData.swift @@ -317,8 +317,6 @@ func walletStringsFormattedNumber(_ count: Int32, _ groupingSeparator: String = } } -extension OverlayStatusController { - convenience init(theme: WalletTheme, type: OverlayStatusControllerType) { - self.init(style: theme.keyboardAppearance == .dark ? .dark : .light, type: type) - } +func OverlayStatusController(theme: WalletTheme, type: OverlayStatusControllerType) -> ViewController { + return OverlayStatusController(style: theme.keyboardAppearance == .dark ? .dark : .light, type: type) }