diff --git a/packages/animations/example/ios/Runner/AppDelegate.swift b/packages/animations/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/animations/example/ios/Runner/AppDelegate.swift +++ b/packages/animations/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/dynamic_layouts/example/ios/Runner/AppDelegate.swift b/packages/dynamic_layouts/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/dynamic_layouts/example/ios/Runner/AppDelegate.swift +++ b/packages/dynamic_layouts/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift b/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift +++ b/packages/file_selector/file_selector/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/file_selector/file_selector_ios/example/ios/Runner/AppDelegate.swift b/packages/file_selector/file_selector_ios/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/file_selector/file_selector_ios/example/ios/Runner/AppDelegate.swift +++ b/packages/file_selector/file_selector_ios/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift b/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_adaptive_scaffold/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/flutter_image/example/ios/Runner/AppDelegate.swift b/packages/flutter_image/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/flutter_image/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_image/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift b/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift +++ b/packages/flutter_markdown/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/go_router/example/ios/Runner/AppDelegate.swift b/packages/go_router/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/go_router/example/ios/Runner/AppDelegate.swift +++ b/packages/go_router/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/palette_generator/example/ios/Runner/AppDelegate.swift b/packages/palette_generator/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/palette_generator/example/ios/Runner/AppDelegate.swift +++ b/packages/palette_generator/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift b/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift +++ b/packages/path_provider/path_provider_foundation/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/platform/example/ios/Runner/AppDelegate.swift b/packages/platform/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/platform/example/ios/Runner/AppDelegate.swift +++ b/packages/platform/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift index 41be7b25597..8891e986b16 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -13,12 +13,12 @@ import Flutter ) -> Bool { GeneratedPluginRegistrant.register(with: self) - weak var registrar = self.registrar(forPlugin: "DummyPlatform"); + weak var registrar = self.registrar(forPlugin: "DummyPlatform") let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) self.registrar(forPlugin: "")!.register( - factory, - withId: "dummy_platform_view") + factory, + withId: "dummy_platform_view") return super.application(application, didFinishLaunchingWithOptions: launchOptions) } diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift index 5ea634fa922..45f468b3acf 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift +++ b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift @@ -5,9 +5,7 @@ import Flutter import UIKit -/** - * A simple factory that creates a dummy platform view for testing. - */ +/// A simple factory that creates a dummy platform view for testing. public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { private var messenger: FlutterBinaryMessenger @@ -33,38 +31,34 @@ public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { } } -/** - * A native view that will remove it's tag if clicked. - */ +/// A native view that will remove it's tag if clicked. public class CustomView: UIView { - var timesClicked = 0; + var timesClicked = 0 var nativeLabel = UILabel() override public func hitTest( _ point: CGPoint, with event: UIEvent? ) -> UIView? { - if (viewWithTag(1) != nil) { - viewWithTag(1)?.removeFromSuperview(); - createNativeView(view: self); + if viewWithTag(1) != nil { + viewWithTag(1)?.removeFromSuperview() + createNativeView(view: self) } - timesClicked += 1; + timesClicked += 1 nativeLabel.text = "Traversed \(timesClicked) subviews" return super.hitTest(point, with: event) } - func createNativeView(view _view: CustomView){ + func createNativeView(view _view: CustomView) { nativeLabel.text = "Traversed \(timesClicked) subviews" nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) _view.addSubview(nativeLabel) } } -/** - * A flutter platform view that displays a simple native view. - */ +/// A flutter platform view that displays a simple native view. class DummyPlatformView: NSObject, FlutterPlatformView { - private var _view: CustomView; + private var _view: CustomView init( frame: CGRect, @@ -81,9 +75,9 @@ class DummyPlatformView: NSObject, FlutterPlatformView { return _view } - func createNativeView(view _view: CustomView){ + func createNativeView(view _view: CustomView) { let nativeLabel = UILabel() - nativeLabel.tag = 1; + nativeLabel.tag = 1 nativeLabel.text = "Native View Not Clicked" nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) _view.addSubview(nativeLabel) diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift index 41be7b25597..8891e986b16 100644 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { @@ -13,12 +13,12 @@ import Flutter ) -> Bool { GeneratedPluginRegistrant.register(with: self) - weak var registrar = self.registrar(forPlugin: "DummyPlatform"); + weak var registrar = self.registrar(forPlugin: "DummyPlatform") let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) self.registrar(forPlugin: "")!.register( - factory, - withId: "dummy_platform_view") + factory, + withId: "dummy_platform_view") return super.application(application, didFinishLaunchingWithOptions: launchOptions) } diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift index 71b1bff63b1..5723fdac74f 100644 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift +++ b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift @@ -5,9 +5,7 @@ import Flutter import UIKit -/** - * A simple factory that creates a dummy platform view for testing. - */ +/// A simple factory that creates a dummy platform view for testing. public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { private var messenger: FlutterBinaryMessenger @@ -33,25 +31,21 @@ public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { } } -/** - * A native view that will remove its tag if clicked. - */ +/// A native view that will remove its tag if clicked. public class CustomView: UIView { override public func hitTest( _ point: CGPoint, with event: UIEvent? ) -> UIView? { - viewWithTag(1)?.removeFromSuperview(); + viewWithTag(1)?.removeFromSuperview() return super.hitTest(point, with: event) } } -/** - * A flutter platform view that displays a simple native view. - */ +/// A flutter platform view that displays a simple native view. class DummyPlatformView: NSObject, FlutterPlatformView { - private var _view: CustomView; + private var _view: CustomView init( frame: CGRect, @@ -68,10 +62,10 @@ class DummyPlatformView: NSObject, FlutterPlatformView { return _view } - func createNativeView(view _view: CustomView){ + func createNativeView(view _view: CustomView) { let nativeLabel = UILabel() _view.isUserInteractionEnabled = true - nativeLabel.tag = 1; + nativeLabel.tag = 1 nativeLabel.text = "Not Clicked" nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) _view.addSubview(nativeLabel) diff --git a/packages/quick_actions/quick_actions_ios/example/ios/RunnerUITests/RunnerUITests.swift b/packages/quick_actions/quick_actions_ios/example/ios/RunnerUITests/RunnerUITests.swift index 2ac4fdbc46a..ad4c03f008e 100644 --- a/packages/quick_actions/quick_actions_ios/example/ios/RunnerUITests/RunnerUITests.swift +++ b/packages/quick_actions/quick_actions_ios/example/ios/RunnerUITests/RunnerUITests.swift @@ -18,7 +18,7 @@ private let pressDurationRetryAdjustment: TimeInterval = 0.2 // This is to deflake a situation where the quick action menu is not present after // the long press. // See: https://github.com/flutter/flutter/issues/125509 -private let quickActionMaxRetries: Int = 4; +private let quickActionMaxRetries: Int = 4 class RunnerUITests: XCTestCase { @@ -40,7 +40,8 @@ class RunnerUITests: XCTestCase { let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard") let quickActionsAppIcon = springboard.icons["quick_actions_example"] - findAndTapQuickActionButton(buttonName: "Action two", quickActionsAppIcon: quickActionsAppIcon, springboard: springboard); + findAndTapQuickActionButton( + buttonName: "Action two", quickActionsAppIcon: quickActionsAppIcon, springboard: springboard) let actionTwoConfirmation = exampleApp.otherElements["action_two"] if !actionTwoConfirmation.waitForExistence(timeout: elementWaitingTime) { @@ -73,7 +74,8 @@ class RunnerUITests: XCTestCase { ) } - findAndTapQuickActionButton(buttonName: "Action one", quickActionsAppIcon: quickActionsAppIcon, springboard: springboard); + findAndTapQuickActionButton( + buttonName: "Action one", quickActionsAppIcon: quickActionsAppIcon, springboard: springboard) let actionOneConfirmation = exampleApp.otherElements["action_one"] if !actionOneConfirmation.waitForExistence(timeout: elementWaitingTime) { @@ -85,7 +87,9 @@ class RunnerUITests: XCTestCase { XCTAssert(actionOneConfirmation.exists) } - private func findAndTapQuickActionButton(buttonName: String, quickActionsAppIcon: XCUIElement, springboard: XCUIElement) { + private func findAndTapQuickActionButton( + buttonName: String, quickActionsAppIcon: XCUIElement, springboard: XCUIElement + ) { var actionButton: XCUIElement? var pressDuration = quickActionPressDuration for _ in 1...quickActionMaxRetries { @@ -111,12 +115,12 @@ class RunnerUITests: XCTestCase { // Reset to previous state. XCUIDevice.shared.press(XCUIDevice.Button.home) } - if (!actionButton!.exists) { + if !actionButton!.exists { XCTFail( "Failed due to not able to find the \(buttonName) button from springboard with \(elementWaitingTime) seconds. Springboard debug description: \(springboard.debugDescription)" ) } - actionButton!.tap(); + actionButton!.tap() } } diff --git a/packages/rfw/example/hello/ios/Runner/AppDelegate.swift b/packages/rfw/example/hello/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/rfw/example/hello/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/hello/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/rfw/example/local/ios/Runner/AppDelegate.swift b/packages/rfw/example/local/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/rfw/example/local/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/local/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/rfw/example/remote/ios/Runner/AppDelegate.swift b/packages/rfw/example/remote/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/rfw/example/remote/ios/Runner/AppDelegate.swift +++ b/packages/rfw/example/remote/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift b/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift +++ b/packages/shared_preferences/shared_preferences/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift b/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift index caf99839333..d83c0ff0bee 100644 --- a/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift +++ b/packages/two_dimensional_scrollables/example/ios/Runner/AppDelegate.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import UIKit import Flutter +import UIKit @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { diff --git a/packages/two_dimensional_scrollables/example/macos/RunnerTests/RunnerTests.swift b/packages/two_dimensional_scrollables/example/macos/RunnerTests/RunnerTests.swift index de34867bac2..6a4e9ea7896 100644 --- a/packages/two_dimensional_scrollables/example/macos/RunnerTests/RunnerTests.swift +++ b/packages/two_dimensional_scrollables/example/macos/RunnerTests/RunnerTests.swift @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase {