mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
[WIP] General UI improvements
This commit is contained in:
parent
f05031cc9d
commit
ff22c7e981
34 changed files with 497 additions and 171 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue