Skip to content

tedkimdev/THDPopup

Repository files navigation

THDPopup

A simple custom popup view controller.

2017-03-16 8 50 34

Example

Here's an example usage.

final class MyViewController: UIViewController {
  
  override func viewDidAppear(_ animated: Bool) {
    
    let popupViewController = THDPopupViewController(
      width: CGFloat(360),
      top: CGFloat(110),
      imageURL: "https://dummyimage.com/300x400",
      leftButtonTitle: "No thanks",
      rightButtonTitle: "✕ close",
      imageButtonDidTap: {
        print("imageButtonDidTap")
    },
      leftButtonDidTap: {
        print("leftButtonDidTap")
    },
      rightButtonDidTap: {
        print("rightButtonDidTap")
    })
    
    self.present(popupViewController, animated: true, completion: nil)
    
  }
  
}

Installation

pod 'THDPopup', '~> 0.0'

License

THDPopup is under MIT license. See the LICENSE file for more info.