I am an iOS developer and recently i got installed the newest iOS 6 on testing. As i came across with mail pull to refresh animation, i decided to try to implement it on my own. I have tried to use CAShapeLayer with UIBezierPath to create the same oval shape that can be dragged forward down. And in order to get the down part stretched downwards i have tried to use adding curve with two control points and applied CABasicAnimation. But unfortunately the result is not as i expected. Since the stretched lines get a little oval inside. I suppose the oval animation has to do something with other classes. I would be very appreciative if someone could lead me to some ideas here.
Thanks a lot

You are on the right track. CAShapeLayer and UIBezierPath is the way to go. Just keep in mind that if you are going to animate the path they need the same number of points otherwise the looks of the animation is undefined. Just keep at it and tweak until it looks the way you want it to do.
–
David RönnqvistJul 15 '12 at 14:22

Thanks a lot man :). I have checked those sources before and i got the idea about the UIGestureRecognizer. The only problem is this animation which kinda reflects the liquid droplet. Yes, i have one method that always creates new circle with longer height and curve points but the problem is the curving does not make the stretched path little bit oval inside. I could post the code for that if that could help me to lead. Thanks a lot man. I thought of implementing this and putting it in GitHub. i use CABasicAnimation fromValue, toValue. paths have the same number of points as i suppose.
–
Bahonur NasritdinovJul 15 '12 at 14:37

1

I have settled down the problem and i got really nice animation after a long hard work It was just simply smooth calculation to be applied to CAShapeLayer path Drawing through the change of UIScrollView Y Axis. For those who still wonder, You definitely use the CAShapeLayer with two Arcs but begin drawing without moving the points. In the end you will get Circle with topArc, BottomArc, two lines which of both have two curve points.
–
Bahonur NasritdinovAug 6 '12 at 10:16

People Who are interested in this solution, i am about to put it in github. I have created a general class where someone can easily customze some view parameters. I will put it as soon as possible.
–
Bahonur NasritdinovAug 21 '12 at 11:30

3 Answers
3

The pull-to-refresh control in iOS 6 Mail is a standard UIKit control available to any app: see the refreshControl property on UITableViewController and the UIRefreshControl class. (Also note you can set one up in IB on XCode 4.5 by choosing "Refreshing -> Enabled" for the table view controller.)

ODRefreshControl is a good option if you're deploying to iOS 5 or older, though.

THIS. Very accurate reproduction of what Apple does. The one difference: It does not implement the setAttributedTitle: interface found in iOS 6.0, but if you think about it NSAttributedString support is kind of restricted before iOS 6.0.
–
NicolasMiariOct 18 '12 at 5:40