Skip to content

Commit

Permalink
Merge pull request #3 from mobillium/fix/topViewController
Browse files Browse the repository at this point in the history
add presentController
  • Loading branch information
serkanerkan authored Aug 1, 2023
2 parents 1823d83 + cc2bc19 commit dc1b69b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Example/MobilliumToolTips/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

}
}
Expand Down
10 changes: 2 additions & 8 deletions MobilliumToolTips/Classes/GKTooltipView/GKTooltip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)")
}

Expand Down

0 comments on commit dc1b69b

Please sign in to comment.