Kodeco Forums

RWDevCon 2016 Session 205: How to Make Delightful UI

Add some personality to your apps by moving beyond the iOS standards and adding a pinch of surprise and delight to your apps. In this session, you’ll learn the principles behind custom refresh controls and transitions, and how to make your app stand out from the crowd.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1294-rwdevcon-2016-session-205-how-to-make-delightful-ui
1 Like

How you make this work with plain UIViewController with tableview as subview ? … in this case custom pull to refresh image is not properly centered.

The frame of the table view may be incorrect when you’re adding the refresh control. You’ll probably need to check the X coordinate of the center of the refresh control in viewDidLayoutSubviews and update it if you need to.

Ok thanks a lot, also adding refresh control on viewDidAppear works fine, which is a better approach ?

viewDidAppear is also fine as long as you’re checking that you haven’t already added the control - it gets called when you come back from a detail view, for example.

Adding it in viewDidLoad and correcting the position is more resilient as it covers you for device rotations.

Thanks a lot, awesome talk !

When I try to add a new standard transition to a third ViewController from ZombieDetailViewController, for some reasons the back gesture on the new ViewController to ZombieDetailViewController is not working. I think the new ViewController’s back gesture is supposed to work normal since it is not conform to ListToDetailAnimatable. Also I changed the code in extension of UINavigationControllerDelegate like this:

func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) → UIViewControllerAnimatedTransitioning? {
if fromVC is ListToDetailAnimatable && toVC is ListToDetailAnimatable {
return ListToDetailAnimator()
}
return nil
}

Do you have any idea what happens here? What should I do if I only want to use custom transitions on some of the controllers instead of all of them?

That’s not something I’ve dealt with but it looks like even implementing the delegate makes the swipe stop working. There are some answers here objective c - iOS 7 use custom interactive transitions only some of the time - Stack Overflow which may help - it looks like you need to un-set the delegate if you want to fall back to the standard behaviour, which is horrible.