Reproducing Popular iOS Controls - Part 27: | Ray Wenderlich Videos

In this video, we'll discuss and implement another way to dismiss our modal and learn about view snapshots.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5298-reproducing-popular-ios-controls/lessons/27

I am getting a bit different result on iPhone XR simulator - the frame seems to be set not including the safe area insets? I’m not sure what to change to fix this

47

@leamars Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hey! Sorry about that! The issue is not the constraints, it’s that the image itself is not big enough. It also happens on the iPhone 8 Plus unfortunately. So, if you’re using this for a personal project, I’d just recommend using a larger image, but if not, I would recommend simply running on an iPhone X to get the desired effect.

Sample Project is not working because of missing one line of code for scroll view delegate in DetailViewController.

Also, I want to know… It seems a little bit different when dismissing ViewController refer to original AppStore.

Original Appstore
: While scroll down, CardView is smoothly downsizing follow by down direction.

Sample Appstore
: While scroll down, CardView is hit the top and downsizing follow by down direction.

Could you have the plan to fix this difference?

@leamars Do you have any feedback about this? Thank you - much appreciated! :]

Hmm, it seems to work when I download the project.

As far as for the difference, I don’t see the card hitting the top.
I’m running this on an XS simulator. I think the XR might be having some issues, so if you’re running on that, I recommend switching, or checking on a real device. If it still doesn’t work then I’d love to see a video of the issue!

Hi Leamars!

In the video 27. App Store: Drag Down to Dismiss, at the 7:16, you said “… the scale will always be less than zero, because the y content offset will be negative …”
However, I figure that the scale < 1 is the right statement, because scale = (100 + yContentOffset) / 100 and |yCContentOffset| < yPositionForDismissal which is 20. Thus, 0 ≤ scale ≤ 1.

Thanks.

1 Like

@leamars Do you have any feedback about this? Thank you - much appreciated! :]

Yes, you’re absolutely correct - that was a slip of the tongue!

Hey Leamars, Do you know what the reason might be for the delay upon selecting a card? When I run it on a device, there just seems to be a slight(but UX-wise meaningful) delay before the transition begins. Additionally, once the transition is complete, there is a similar delay before the textView and dismiss button appear.

@leamars Can you please help with this when you get a chance? Thank you - much appreciated! :]

For me the issue was the snapshot being slow when the detail page was loading. I instead moved the snapshot code to viewDidAppear and this largely solved the problem for me.

@betbrik Thank you for sharing your solution - much appreciated!