ephread / Instructions

Create walkthroughs and guided tours (coach marks) in a simple way, with Swift.
MIT License
5.16k stars 491 forks source link

Top arrow is not displayed #270

Closed vgkanis closed 1 year ago

vgkanis commented 2 years ago

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

ephread commented 2 years ago

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?

bevanchristian commented 2 years ago

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 commented 2 years ago

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

ephread commented 1 year ago

Awesome! Closing because a solution was found.