From 95284887dc987b6f92ad46abb1e215ebec781514 Mon Sep 17 00:00:00 2001 From: Antonio Paolo Piscazzi Date: Tue, 16 Jul 2024 16:21:09 +0200 Subject: [PATCH] Code linting --- packages/xandr_ios/ios/Classes/XandrPlugin.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/xandr_ios/ios/Classes/XandrPlugin.swift b/packages/xandr_ios/ios/Classes/XandrPlugin.swift index f710ae7..c4afaac 100644 --- a/packages/xandr_ios/ios/Classes/XandrPlugin.swift +++ b/packages/xandr_ios/ios/Classes/XandrPlugin.swift @@ -16,11 +16,11 @@ public class XandrPlugin: UIViewController, FlutterPlugin, private func parentController() -> UIViewController { var topController: UIViewController = UIApplication.shared.keyWindow!.rootViewController! - while (topController.presentedViewController != nil) { - topController = topController.presentedViewController! - } - return topController + while topController.presentedViewController != nil { + topController = topController.presentedViewController! } + return topController + } public static func register(with registrar: FlutterPluginRegistrar) { // init the plugin and call onRegister @@ -140,7 +140,10 @@ public class XandrPlugin: UIViewController, FlutterPlugin, if autoDismissDelay == nil { self.interstitialAd?.display(from: self.parentController()) } else { - self.interstitialAd?.display(from: self.parentController(), autoDismissDelay: Double(autoDismissDelay!)) + self.interstitialAd?.display( + from: self.parentController(), + autoDismissDelay: Double(autoDismissDelay!) + ) } }