mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-10-09 03:20:48 +00:00
[WIP] iOS 16 support
This commit is contained in:
parent
6e96f92671
commit
1a4d09a552
@ -141,6 +141,9 @@ public final class EmojiStatusSelectionComponent: Component {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
deinit {
|
||||
}
|
||||
|
||||
func update(component: EmojiStatusSelectionComponent, availableSize: CGSize, state: EmptyComponentState, environment: Environment<EnvironmentType>, transition: Transition) -> CGSize {
|
||||
self.backgroundColor = component.backgroundColor
|
||||
let panelBackgroundColor = component.backgroundColor.withMultipliedAlpha(0.85)
|
||||
|
@ -1913,7 +1913,7 @@ public final class EmojiPagerContentComponent: Component {
|
||||
public let peekBehavior: EmojiContentPeekBehavior?
|
||||
public let customLayout: CustomLayout?
|
||||
public let externalBackground: ExternalBackground?
|
||||
public let externalExpansionView: UIView?
|
||||
public weak var externalExpansionView: UIView?
|
||||
public let useOpaqueTheme: Bool
|
||||
|
||||
public init(
|
||||
|
@ -110,6 +110,10 @@ private class ApplicationStatusBarHost: StatusBarHost {
|
||||
}
|
||||
|
||||
var keyboardWindow: UIWindow? {
|
||||
if #available(iOS 16.0, *) {
|
||||
return UIApplication.shared.internalGetKeyboard()
|
||||
}
|
||||
|
||||
for window in UIApplication.shared.windows {
|
||||
if isKeyboardWindow(window: window) {
|
||||
return window
|
||||
|
@ -22,6 +22,7 @@ typedef NS_OPTIONS(NSUInteger, UIResponderDisableAutomaticKeyboardHandling) {
|
||||
|
||||
- (void)internalSetStatusBarStyle:(UIStatusBarStyle)style animated:(BOOL)animated;
|
||||
- (void)internalSetStatusBarHidden:(BOOL)hidden animation:(UIStatusBarAnimation)animation;
|
||||
- (UIWindow * _Nullable)internalGetKeyboard;
|
||||
|
||||
@end
|
||||
|
||||
|
@ -139,6 +139,12 @@ static bool notyfyingShiftState = false;
|
||||
|
||||
@end
|
||||
|
||||
@protocol UIRemoteKeyboardWindowProtocol
|
||||
|
||||
+ (UIWindow * _Nullable)remoteKeyboardWindowForScreen:(UIScreen * _Nullable)screen create:(BOOL)create;
|
||||
|
||||
@end
|
||||
|
||||
@implementation UIViewController (Navigation)
|
||||
|
||||
+ (void)load
|
||||
@ -155,6 +161,8 @@ static bool notyfyingShiftState = false;
|
||||
[RuntimeUtils swizzleInstanceMethodOfClass:[UIViewController class] currentSelector:@selector(presentViewController:animated:completion:) newSelector:@selector(_65087dc8_presentViewController:animated:completion:)];
|
||||
[RuntimeUtils swizzleInstanceMethodOfClass:[UIViewController class] currentSelector:@selector(setNeedsStatusBarAppearanceUpdate) newSelector:@selector(_65087dc8_setNeedsStatusBarAppearanceUpdate)];
|
||||
|
||||
[RuntimeUtils swizzleClassMethodOfClass:NSClassFromString(@"UIRemoteKeyboardWindow") currentSelector:NSSelectorFromString(@"remoteKeyboardWindowForScreen:create:") newSelector:NSSelectorFromString(@"_65087dc8_remoteKeyboardWindowForScreen:create:")];
|
||||
|
||||
if (@available(iOS 15.0, *)) {
|
||||
[RuntimeUtils swizzleInstanceMethodOfClass:[CADisplayLink class] currentSelector:@selector(setPreferredFrameRateRange:) newSelector:@selector(_65087dc8_setPreferredFrameRateRange:)];
|
||||
}
|
||||
@ -291,6 +299,14 @@ static bool notyfyingShiftState = false;
|
||||
#pragma clang diagnostic pop
|
||||
}
|
||||
|
||||
- (UIWindow * _Nullable)internalGetKeyboard {
|
||||
Class windowClass = NSClassFromString(@"UIRemoteKeyboardWindow");
|
||||
if (!windowClass) {
|
||||
return nil;
|
||||
}
|
||||
return [(id<UIRemoteKeyboardWindowProtocol>)windowClass remoteKeyboardWindowForScreen:[UIScreen mainScreen] create:false];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation UIView (Navigation)
|
||||
|
Loading…
x
Reference in New Issue
Block a user