Skip to content

Cant handle frame changes for the current coachmark #287

@diegodossantos95

Description

@diegodossantos95

Describe the bug

I have a coachmark on top of the keyboard, so I want to change the coachmark position based on the keyboard size.
The issue is that the readme says that we should use the CoachMarkController.prepareForChange() and CoachMarkController.restoreAfterChangeDidComplete(), but those functions don't do anything on iOS 13 or later.

I found a possible workaround, which is to run flow.pause(). helper.updateCurrentCoachMark(), flow.resume(), but the resume function creates a new coachmark in the screen, so every frame change a new coachmark appears, and keeps the old ones visible.

To Reproduce

  1. Create coachmark using some view that will change the frame
  2. Call the prepareForChange function before changing the frame
  3. Update the highlight view frame
  4. Call restoreAfterChangeDidComplete function

Expected behavior

The coachmark should move to the new frame position.

Screenshots

The result of the workaround usage.
Screenshot 2023-03-23 at 17 29 08

Environment

  • Device: iPhone 13 Pro
  • iOS version: 16.3.1
  • Instructions version: 2.2.0
  • Dependency Manager: SPM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions