Instructions icon indicating copy to clipboard operation
Instructions copied to clipboard

Top arrow is not displayed

Open vgkanis opened this issue 3 years ago • 3 comments

As the title says, the top arrow is not displayed. But, the bottom it is. The body of the CoachMark is a custom one, but I am using the default arrows. This screenshot is with the bottom arrow: Screenshot 2022-03-24 at 11 23 41 AM

and this one is with the top arrow: Screenshot 2022-03-24 at 11 24 29 AM

If I use my arrow, then I get the following screenshot Screenshot 2022-03-24 at 11 29 44 AM

Does anybody know how to fix this?

Thank you

vgkanis avatar Mar 24 '22 09:03 vgkanis

Hey @vgkanis, sorry for the late response.

That's weird, it's going to be difficult to troubleshoot without having access to the code. Would you be able to provide a sample project showcasing the issue or a few code excerpts?

ephread avatar May 25 '22 16:05 ephread

same with me this is my code

  func coachMarksController(_ coachMarksController: CoachMarksController, coachMarkAt index: Int) -> CoachMark {
        var coachMark: CoachMark
        let flatCutoutPathMaker = { (frame: CGRect) -> UIBezierPath in
            return UIBezierPath(rect: frame)
        }
        let coachMarkPointOfInterest = homeCoachMarkViewModel.coachMarkData[index].pointOfInterest
        
        coachMark = coachMarksController.helper.makeCoachMark(
            for: coachMarkPointOfInterest,
               pointOfInterest: coachMarkPointOfInterest.center,
               cutoutPathMaker: flatCutoutPathMaker
        )
        coachMark.arrowOrientation = .top
        coachMark.gapBetweenCoachMarkAndCutoutPath = 10.0
        return coachMark
    }

bevanchristian avatar Jul 21 '22 09:07 bevanchristian

i found the problem

   func coachMarksController(_ coachMarksController: CoachMarksController, coachMarkViewsAt index: Int, madeFrom coachMark: CoachMark) -> (bodyView: (UIView & CoachMarkBodyView), arrowView: (UIView & CoachMarkArrowView)?) {
        let coachMarkBodyView = CoachMarkCustomBodyView()
        var coachMarkArrowView: CoachMarkArrowDefaultView?

        let coachMarkData = homeCoachMarkViewModel.coachMarkData[index]
        coachMarkBodyView.configureBodyView(coachMarkData: coachMarkData)
        coachMarkBodyView.frame = CGRect(x: 10, y: 10, width: self.view.frame.width * 0.8, height: 132)

        if let arrowOrientation = coachMark.arrowOrientation {
            let view = CoachMarkArrowDefaultView(orientation: arrowOrientation)
            print("masuk arrow")
            coachMarkArrowView = view
        }

        return (bodyView: coachMarkBodyView, arrowView: coachMarkArrowView)
        
    }

i have to set y to 10 and arrow will appear

bevanchristian avatar Jul 21 '22 09:07 bevanchristian

Awesome! Closing because a solution was found.

ephread avatar May 03 '23 22:05 ephread