Closed Nikoloutsos closed 4 years ago
You can check custom nib case in example app: https://github.com/ealeksandrov/EAIntroView/blob/master/Example/Source/ViewController.m#L210-L213
@ealeksandrov Thank you for the quick reply. I followed your example but It crashes when trying to downcast. (I've added button's tag to 2 from xib)
let btn = ingropage1?.pageView.viewWithTag(2) as! UIButton //It crashes
btn.addTarget(self, action: #selector(buttonAction(sender:)), for: .touchUpInside)
You are making force cast. Debug and check if any element of chain is nil or different type.
I could not achieve what I wanted. As a workaround I used the skipButton as my custom button.
let introView = EAIntroView.init(frame: self.view.bounds, andPages: [ingropage1!,ingropage2!])
introView?.delegate = self
introView?.skipButton.setTitle(" Sync now ", for: .normal)
introView?.skipButton.backgroundColor = UIColor.orange
introView?.skipButton.layer.cornerRadius = 8
introView?.skipButton.clipsToBounds = true
Thank you for your help anyway!
I am trying to execute some code when user clicks the button. But do not know how to set an onClick method for the button. Usually I do it by binding it with the ViewController but now I do not have one.
Where test3 is a xib file and it has the button