Perform animation like kindle app with uicollectionview - ios

I have requirement like below and I went already with couple of animations but it didn't worked me at all..
please see the image what I want to achieve this kind of animation. I also want centered collectionview cells in which one cell from left and right will appear. This works but not in the full size of screen right now.
Thanks for any help.

This is good reference.
You have 2 options,
Use UIView animation, i.e. Scale, Center etc.
Use UIViewController custom transition
On click of you collectionview's cell you need to show UIView or UIViewController with custom transition.

Related

how to expand uitableviewcell height using swift with animation like in this gif?

I have a UITableView in my app, I want to have the cell expanded to reveal some details like the attached gif.
What do you think is the best way to do this?
I have seen people talking about Objc-C way, but how to do it in swift?
the ticking circle resembles a touch.
EDIT :
I managed to have this working, but how to change animation speed?
just increase the height(of the clicked cell) and call the below methods.
table.beginUpdates()
table.endUpdates()

How to achieve Peek Calendar like scrolling behavior on UITableView or UICollectionView?

Does anyone have suggestions on how to achieve this kinda animation in either UITableView or UICollectionView (animation below)? It also seems to work properly with ScrollToTop behavior (by not going into the grey areas).
I'm thinking the new cells are added after the resistance animation concludes. It's interesting how everything stays in place though. Any help would be appreciated :).
This is similar as UIRefreshControl. Instead of showing activity indicator, it has custom animation. You can sub-class UIRefreshControl and set background as Blue (Dark Blue?). So when you scroll down you won't see grey area (I assume this is your question).
Once the UIRefreshControl trigged its action of Value Changed, you do the animation that move the calendar down.
http://www.jackrabbitmobile.com/design/ios-custom-pull-to-refresh-control/
You can check this code, hope that could help. :)

Change content of UICollectionViewCell during interactive transition

I'm playing around with UICollectionView interactive transitions.
The very basic implementation is here.
Now I'm a bit stuck with Cells transitioning.
The idea is to change content of cells simultaneously with interactive layout transition.
Here is how it looks now.
The first layout
And the second layout
When transitioning is finished, I want to change content of cells on second layout.
1) Text label "Some label" should disappear from every cells
2) Text label "Another label" should appear on the right corner of each cell.
Key issue is I want this changes fade in/out according to UICollectionViewTransitionLayout.transitionProgress value during transitioning.
Something very similar implemented in Facebook Paper App.
Take look how content of cells is changing below (click on it).
Is anybody know an elegant way to replicate this effect?
This library will help you achieve what you are trying. If you are interested in custom animations I would suggest you use FB pop library
Well.
The solution is to subclass UICollectionViewCell.
Subclass should contain two UIView. One for big layout & one for small.
Initially UICollectionViewCell shows only small one.
Once we starting to update UICollectionViewTransitionLayout.transitionProgress for example from small to big we should do following steps:
Make an UIImage from big UIView
Put this image above small UIView
Set alpha of the image to 0
Continuously change alpha of UIImage to UICollectionViewTransitionLayout.transitionProgress value
Once transition is done just switch this to UIView
When you transitioning back you should switch big with small.
Done :-)

Custom UICollectionViewLayout (Passbook UI replica) - disable fade animations for cells

I'm trying to recreate the passbook UI using a collection view with a custom layout.
So far so good, but there's this thing I can't seem to find a solution for.
Problem: When I click on a cell I want it to move up to the top of the screen (content offset of the cv). Most of the cells don't have a problem with this and they perform as such. However, when the selected cell is near the bottom of the screen, there's no moving at all... just a fade-out and fade-in.
To achieve this animation, I embedded the layout subclass' invalidateLayout in an animation block to be performed by UIView. No matter how high or low I set the time interval, the duration is still the same, and so no effect on the fade-in fade-out behaviour.
I'll paste here the methods that I believe to need to be modified and also a link to a video on youtube. Hopefully, someone can find a solution for this >_<".
YT: https://www.youtube.com/watch?v=3xIL-fFUcJo
Code: http://pastebin.com/QKLKGwdN

Creating a fixed footer in viewport in iOS

I want to create a footer fixed to the bottom of the viewport in an iOS app I'm developing (it's my first one, I come from a web dev background). However I'm having difficulty finding information on how to go about this.
What I have in mind is essentially just 3 rectangular buttons next to each other that are just constantly fixed to the bottom of the viewport. I tried dragging a toolbar into my scene as a starting point, but in the interface builder it's placing itself under my table cell, rather than fixing to the bottom. I feel like this is probably easier to do programmatically, but I just don't know where to start.
If someone could at the very least guide me in the right direction I'd really appreciate it. Thank you.
Okay... create/add custom UIView on your main view (self.view)
and set this custom view's frame = (0, 0, 320 , self.view.frame.size.height - 50) /// change value 50 to as per your requirement.
and add all of then UIControls such like textField, tableVie, button ...etc.. on this custom view.
Don't use a UITableViewController. Use a UIViewController, then add a table view and a toolbar. You'll need to implement the UITableViewDelegate protocol in code and then connect the delegate in interface builder.

Resources