Home>

https://github.com/shin8484/PopupWindow
This is the URL here.

I would like to place a button etc. in the pop-up that appears in particular in ReadMe, such as Example.
However, I do not understand the explanation of UsageUsage in ReadMe.

PopupWindowManager.shared.changeKeyWindow (rootViewController: UIViewController ())


Needs to be added, where is this added? Is it okay to use viewDidLoad () or lower? Below that, in Viewcontroller,

let popupOption = PopupOption (shapeType: .roundedCornerTop (cornerSize: 8), viewType: .toast, direction: .bottom)
        let popupItem = PopupItem (view: loginView,
                                  height: Const.firstViewFrame.height,
                                  maxWidth: 500,
                                  popupOption: popupOption)


So, when I add it, I get errors like Use of unresolved identifier'PopupOption'and Use of unresolved identifier'loginView&apos ;.

Swift itself may have made a rudimentary mistake, but please reply.

By the way, the file of Viewcontroller has the following error in the following way.

import UIKit
import PopupWindow
class MainpageViewController: UIViewController {
    override func viewDidLoad () {
        super.viewDidLoad ()
        // Do any additional setup after loading the view.
        PopupWindowManager.shared.changeKeyWindow (rootViewController: UIViewController ())
        let popupOption = PopupOption (shapeType: .roundedCornerTop (cornerSize: 8), viewType: .toast, direction: .bottom)
        let popupItem = PopupItem (view: loginView,
                                  height: Const.firstViewFrame.height,
                                  maxWidth: 500,
                                  popupOption: popupOption)


    }
    override func didReceiveMemoryWarning () {
        super.didReceiveMemoryWarning ()
        // Dispose of any resources that can be recreated.
    }

    / *
    // MARK:-Navigation
    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare (for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    * /
}
  • Answer # 1

    Since I haven't used it, as long as I read the demo of the library

    PopupWindowManager.shared.changeKeyWindow (rootViewController: UIViewController ())
    It seems that

    is written in IBAction or tap event.
    Also,UIViewController ()in this code means to use any ViewController.

    And

    PopupOption (shapeType: viewType: direction:)

    It is in ViewController that inheritsBasePopupViewController. It seems that this ViewController is passed to `` `changeKeyWindow (rootViewController :)" above.

    Demo is solid even if you don't know the usage, so you should read the code inside. If you do not understand even after reading the demo, run the demo (at your own risk). Then you can see a little.

    demo