-
Notifications
You must be signed in to change notification settings - Fork 492
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nextControl not working when we create custom view using xib. #253
Comments
Hi @parth-simformsolutions, thanks for reporting the problem. This is a very vague issue, do you have more information or a minimal project you can share? How/where do you instantiate your XIB? |
Hi! I'm sorry I intervene, but I did too, import UIKit
import Instructions
class ProfileCoachMarkView: UIView, CoachMarkBodyView {
@IBOutlet private weak var labelMessage: UILabel!
@IBOutlet weak var buttonOK: UIButton!
var nextControl: UIControl? { return self.buttonOK }
weak var highlightArrowDelegate: CoachMarkBodyHighlightArrowDelegate?
static let popupWidth = UIScreen.main.bounds.width
static func fromNib() -> ProfileCoachMarkView {
return Bundle(for: ProfileCoachMarkView.self).loadNibNamed(String(describing: ProfileCoachMarkView.self), owner: nil, options: nil)![0] as! ProfileCoachMarkView
}
static func viewPopup() -> ProfileCoachMarkView {
let viewBody = ProfileCoachMarkView.fromNib()
viewBody.buttonOK.accessibilityIdentifier = "AccessibilityIdentifiers.next"
viewBody.frame = CGRect(x: 0, y: 0, width: ProfileCoachMarkView.popupWidth - 32, height: ProfileCoachMarkView.popupWidth * 0.35)
viewBody.isUserInteractionEnabled = true
viewBody.buttonOK.isUserInteractionEnabled = true
return viewBody
}
} And i instantiate, like this: extension ProfileViewController: CoachMarksControllerDataSource, CoachMarksControllerDelegate {
func coachMarksController(
_ coachMarksController: CoachMarksController,
coachMarkViewsAt index: Int,
madeFrom coachMark: CoachMark
) -> (
bodyView: (UIView & CoachMarkBodyView),
arrowView: (UIView & CoachMarkArrowView)?
) {
let viewBody = ProfileCoachMarkView.viewPopup()
return (bodyView: viewBody, arrowView: nil)
}
func coachMarksController(_ coachMarksController: CoachMarksController, coachMarkAt index: Int) -> CoachMark {
return self.coachMark ?? coachMarksController.helper.makeCoachMark(for: tableView)
}
func numberOfCoachMarks(for coachMarksController: CoachMarksController) -> Int {
return 1
}
} I followed the custom view example, but used xib, Thank you! |
Hey @seirifat, what problem do you see exactly with that code? Anything pops up in the console? |
Hi, I'm having the same problem but only on iPad, when i tap on Next nothing happens, created custom target for the button but also nothing happens. It's working fine on iPhone. |
Hi, facing same issue. Please help me to overcome this 🥹. |
Describe the bug
I have created CoachMarkBodyView with xib.
I have return unbutton as nextControl which I have connected using outlets.
Now I am not able to click on next button.
To Reproduce
Expected behavior
Actually I should able to click on next button and it should show next instruction.
The text was updated successfully, but these errors were encountered: