From a7e652c7d837c009a36d40e3ebe9a0c375bdcc59 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Tue, 16 Jan 2024 15:09:58 -0800 Subject: [PATCH] Remove iOS 12 availability checks (flutter/engine#49771) iOS minimum is now 12: https://github.com/flutter/buildroot/pull/808. Remove `@available` checks for that version. Part of https://github.com/flutter/flutter/issues/140474 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../Source/FlutterTextInputPlugin.mm | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm index 7168515b1a0..5137976f703 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm @@ -304,14 +304,12 @@ static UITextContentType ToUITextContentType(NSArray* hints) { return UITextContentTypePassword; } - if (@available(iOS 12.0, *)) { - if ([hint isEqualToString:@"oneTimeCode"]) { - return UITextContentTypeOneTimeCode; - } + if ([hint isEqualToString:@"oneTimeCode"]) { + return UITextContentTypeOneTimeCode; + } - if ([hint isEqualToString:@"newPassword"]) { - return UITextContentTypeNewPassword; - } + if ([hint isEqualToString:@"newPassword"]) { + return UITextContentTypeNewPassword; } return hints[0]; @@ -407,11 +405,10 @@ static BOOL IsFieldPasswordRelated(NSDictionary* configuration) { return YES; } - if (@available(iOS 12.0, *)) { - if ([contentType isEqualToString:UITextContentTypeNewPassword]) { - return YES; - } + if ([contentType isEqualToString:UITextContentTypeNewPassword]) { + return YES; } + return NO; }