AMPopTip: AM_POPTIP_EXTENSION not working

Tried using AM_POPTIP_EXTENSION macro in Share extension target. Still if shows error for API not available for Extensions. Any help?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

@andreamazz I have been using AMPopTip since long in my project which has share extension support. Since I have tried to update on latest version 2.1.0 its giving error as you guys have used UIApplication.shared method in below mentioned function. We can’t use that API for share extension. It would be great if you guys can suggest me any alternative or else I have to stick with the same old version of AMPopTip which is working fine on share extension.

    if !forced && isAnimating {
      return
    }
    layer.removeAllAnimations()
    isAnimating = true
    dismissTimer?.invalidate()
    dismissTimer = nil
    if let gestureRecognizer = tapRemoveGestureRecognizer {
      containerView?.removeGestureRecognizer(gestureRecognizer)
    }
    if let gestureRecognizer = swipeGestureRecognizer {
      containerView?.removeGestureRecognizer(gestureRecognizer)
    }

    let completion = {
      self.customView?.removeFromSuperview()
      self.customView = nil
      self.dismissActionAnimation()
      self.backgroundMask?.removeFromSuperview()
      self.removeFromSuperview()
      self.layer.removeAllAnimations()
      self.transform = .identity
      self.isAnimating = false
      self.dismissHandler?(self)
    }

    var isActive = true
    if #available(iOS 8, *) {
      isActive = UIApplication.shared.applicationState == .active
    }
    if !isActive {
      completion()
    } else {
      performExitAnimation(completion: completion)
    }
  }