diff --git a/Example/MobilliumToolTips/ViewController.swift b/Example/MobilliumToolTips/ViewController.swift index e17cb01..09d1f7f 100644 --- a/Example/MobilliumToolTips/ViewController.swift +++ b/Example/MobilliumToolTips/ViewController.swift @@ -47,7 +47,7 @@ extension ViewController { private func configureTooltips() { let gkTooltip = GKTooltip() - gkTooltip.startIntro(from: self, withNodes: self.getGKTooltipNodes(), isHighlightedWithOneNode: true) + gkTooltip.startIntro(from: self, presentController: self, withNodes: self.getGKTooltipNodes(), isHighlightedWithOneNode: true) } } diff --git a/MobilliumToolTips/Classes/GKTooltipView/GKTooltip.swift b/MobilliumToolTips/Classes/GKTooltipView/GKTooltip.swift index f47850c..ed65b71 100644 --- a/MobilliumToolTips/Classes/GKTooltipView/GKTooltip.swift +++ b/MobilliumToolTips/Classes/GKTooltipView/GKTooltip.swift @@ -34,6 +34,7 @@ public final class GKTooltip { public init() {} public func startIntro(from controller: UIViewController, + presentController: UIViewController, with scrollView: UIScrollView? = nil, withNodes nodes: [GKTooltipNode], isHighlightedWithOneNode: Bool = false) { @@ -42,14 +43,7 @@ public final class GKTooltip { gkTooltipVC.delegate = delegate gkTooltipVC.popupDelegate = popupDelegate gkTooltipVC.scrollView = scrollView - if controller == UIApplication.topViewController() { - print("Presenting gkTooltipVC") - controller.present(gkTooltipVC, - animated: true, - completion: nil) - } else { - print("controller is not top view controller") - } + presentController.present(gkTooltipVC, animated: true, completion: nil) print("startIntro method called with nodes: \(nodes)") }