I am currently using BWWalkthrough to create an onboarding experience and each slide has a different background. Normally, setting the ImageView's constraint to 0 and its Content Mode to Aspect Fill is enough to have a full screen background:
This post and others in SO confirms that How do you make a background image scale to screen size in swift?
but with a PageViewController, my image overflows to the next page PageViewController.
See the following to understand the problem:
Keep in mind that is how you see it before swiping, which means that it is wrong at the moment
I also tried setting the width of my imageView equal width to my container view but that does not change anything:
Also, I did an onboarding programmatically before using BWWalkthrough and I was experiencing the exact same problem... What am I missing here?
I haven't used BWWalkthrough, but it seems like you have two problems:
firstPageController.view.clipsToBounds = YES;for all of your pages. This makes sure content outside of your view's bounds will be clipped. It's NO by default.