Kodeco Forums

How to Create an iOS Book Open Animation: Part 1

Learn how to create an iOS book open animation including page flips, with custom collection views layout and transitions.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/1719-how-to-create-an-ios-book-open-animation-part-1

please can you update the code to swift 2 because in xcode 7,2 it show many error and thks

@jomoka
There is no need to override following function
targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint
in BooksLayout.swift

You can simply use collectionView?.isPagingEnabled = true just like you did in in BookLayout.swift

Please correct me if I am wrong.

@sandeep007, I donโ€™t have the old version of xcode running the app anymore but if collectionView.isPagingEnabled works the same as the overridden method then itโ€™s not needed. The reason before why targetContentOffset was overriden was to provide fine grain control of how the books snapped into place when the user releases their finger.

Sorry hope this helps!

Hi, I am an intermediate level iOS developer, this tutorial is very nice and I want to learn how it works, but its giving me a lot of problems, firstly the code isnโ€™t updated to swift3 where a lot of the dispatch statements are reworked where they have removed the dispatch_once statement that is available in the starter project which is also giving me problems in the collection flow layout class. If you could convert the code to swift 3, it will be a lot of help. Thanks.

Hello. I also faced to the same issue.
And so I just converted starter project of tutorial to Swift 3 and uploaded it to GitHub.
Here is the link: https://github.com/akozin/raywenderlich-ios-book-open-animation

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]