mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[WIP] General UI improvements
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#import "NSWeakReference.h"
|
||||
|
||||
|
||||
@interface UIViewControllerPresentingProxy : UIViewController
|
||||
|
||||
@property (nonatomic, copy) void (^dismiss)();
|
||||
@@ -139,6 +140,18 @@ static bool notyfyingShiftState = false;
|
||||
|
||||
@end
|
||||
|
||||
@interface UIWindow (Telegram)
|
||||
|
||||
@end
|
||||
|
||||
@implementation UIWindow (Telegram)
|
||||
|
||||
- (instancetype)_65087dc8_initWithFrame:(CGRect)frame {
|
||||
return [self _65087dc8_initWithFrame:frame];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@protocol UIRemoteKeyboardWindowProtocol
|
||||
|
||||
+ (UIWindow * _Nullable)remoteKeyboardWindowForScreen:(UIScreen * _Nullable)screen create:(BOOL)create;
|
||||
@@ -161,7 +174,7 @@ 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:")];
|
||||
[RuntimeUtils swizzleInstanceMethodOfClass:[UIWindow class] currentSelector:@selector(initWithFrame:) newSelector:@selector(_65087dc8_initWithFrame:)];
|
||||
|
||||
if (@available(iOS 15.0, *)) {
|
||||
[RuntimeUtils swizzleInstanceMethodOfClass:[CADisplayLink class] currentSelector:@selector(setPreferredFrameRateRange:) newSelector:@selector(_65087dc8_setPreferredFrameRateRange:)];
|
||||
@@ -304,7 +317,8 @@ static bool notyfyingShiftState = false;
|
||||
if (!windowClass) {
|
||||
return nil;
|
||||
}
|
||||
return [(id<UIRemoteKeyboardWindowProtocol>)windowClass remoteKeyboardWindowForScreen:[UIScreen mainScreen] create:false];
|
||||
UIWindow *result = [(id<UIRemoteKeyboardWindowProtocol>)windowClass remoteKeyboardWindowForScreen:[UIScreen mainScreen] create:false];
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user