From ba871065e0f40e9197fa4ee0ffe76530bb6fca11 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 1 Feb 2018 10:32:07 -0800 Subject: Clean up our Objective-C usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move ivars into @implementation - Use instancetype where applicable - Use dot notation for property access - Use subscript operator for dictionaries and arrays - Format selectors consistently - Use proper style for init methods - Use generics instead of void pointers where possible - Use "range for" loops instead of indexing - Replace or replace IBAction/IBOutlet with void Change-Id: I1667812a51d4dfe44ae80fe337cb1f4bc9699d92 Reviewed-by: Jake Petroules Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/ios/qiosinputcontext.mm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/plugins/platforms/ios/qiosinputcontext.mm') diff --git a/src/plugins/platforms/ios/qiosinputcontext.mm b/src/plugins/platforms/ios/qiosinputcontext.mm index 050c592aca..3e22634071 100644 --- a/src/plugins/platforms/ios/qiosinputcontext.mm +++ b/src/plugins/platforms/ios/qiosinputcontext.mm @@ -67,7 +67,7 @@ static QUIView *focusView() @implementation QIOSLocaleListener -- (id)init +- (instancetype)init { if (self = [super init]) { NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter]; @@ -95,16 +95,15 @@ static QUIView *focusView() // ------------------------------------------------------------------------- -@interface QIOSKeyboardListener : UIGestureRecognizer { - @private - QT_PREPEND_NAMESPACE(QIOSInputContext) *m_context; -} +@interface QIOSKeyboardListener : UIGestureRecognizer @property BOOL hasDeferredScrollToCursor; @end -@implementation QIOSKeyboardListener +@implementation QIOSKeyboardListener { + QT_PREPEND_NAMESPACE(QIOSInputContext) *m_context; +} -- (id)initWithQIOSInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)context +- (instancetype)initWithQIOSInputContext:(QT_PREPEND_NAMESPACE(QIOSInputContext) *)context { if (self = [super initWithTarget:self action:@selector(gestureStateChanged:)]) { @@ -574,7 +573,7 @@ void QIOSInputContext::scroll(int y) // Raise all known windows to above the status-bar if we're scrolling the screen, // while keeping the relative window level between the windows the same. - NSArray *applicationWindows = [[UIApplication sharedApplication] windows]; + NSArray *applicationWindows = [[UIApplication sharedApplication] windows]; static QHash originalWindowLevels; for (UIWindow *window in applicationWindows) { if (keyboardScrollIsActive && !originalWindowLevels.contains(window)) -- cgit v1.2.3