Scrolling rows effects in iOS 7 - ios

I want to make scrolling effect in iOS 7 when scroll up, those rows will move like this gif shows. Please forget the effect when scroll down (because I cannot find a better sample). However, I don't know how to do that although did research, any solutions and open sources are appreciated!
http://d13yacurqjgara.cloudfront.net/users/107759/screenshots/1176252/moments-ios7.gif

This is done by adding Gravity effect to UIKit components. Once you add attachmentBehaviors, you can easily achieve this effect.
You can find a tutorial help here.
There is another solution specific to UITableViewCells here.

It is advisable to use a UITableView & on reload table view data animation can be used by the following way to give a bouncing effect during table reload.
[_tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
Corresponding row animation effect should be given here.
For delay in scroll for each section as seen in the gif, I would suggest you to go ahead with animation for individual cells.
Go through this open source link, this might be useful.
Shall try and get back, in-case I perform the exact animation effect.

Related

UITableView how to continue scrolling after reload

I have a UITableView in my application. When the table is scrolled almost to the end, I download more data and reload the table.
If the tableView was scrolling, at the time I call [tableView reloadData]; scrolling stops. How can I achieve effect of not stopping the scroll meanwhile reloadData? I think I need to somehow save scrolling speed and then restore it, but how to do this?
P.D. I really searched this question before asking.
I thing, this method (insertRowsAtIndexPaths:withRowAnimation:) is the key.
There is a use case and a nice tip described on SO: the use case and the tip.
Since UITableView is subclass of UIScrollView, you can use UIScrollViewDelegate's scrollViewWillEndDragging:withVelocity:targetContentOffset:
method to determine how far it is supposed to scroll and then after table reload call setContentOffset:animated: with that target offset (or beginning/ending of tableview if it becomes smaller) to simulate continued scrolling
EDIT: since your targetContentOffset is probably going to be CGRectZero, you will have to recalculate it somehow using velocity from the same method
if i am not wrong you are looking for a function call Lazy load. I can recommend you to search SVPullToRefresh
here!

Use scrollToItemAtIndexPath in UICollectionView with paging

I have an uicollectionview with paging enabled. One cell per page which is full screen basically. The thing is that when I want to use scrollToItemAtIndexPath and move one cell forward/backward along with animation it will do a swipe but it will go back instantly to the cell/page where I called scrollToItemAtIndexPath. There is really nothing special besides stuff I've described. When I omit animation it's working.
For faster debugging I've setup test project on github - ScrollToItem
EDIT: This might be a bug. Bugreport (18864560) submitted. If someone can provide me a workaround or even solve this issue it will be still appreciated.

iOS, how to split UITableView into two

I want to split UITableView into two parts, top part and bottom part when I tap somewhere.
the hidden part will open with animation. could anybody please tell me how to do that?
This effect just like at iOS app groups at desktop.
I think "how to split anyview into two parts" is what i want.
My fitst thought is that write code to take a shot of current screen as an image, and disabled the top and the bottom parts. then move down the bottom part.
I don't konw is there an API to do that quickly? or there already exists a repo on Github.
here is a sample image http://oi40.tinypic.com/2hhdw5y.jpg
Make the 'hidden part' a regular table view cell.
In heightForRowAtIndexPath, return the normal cell height for every cell, except for the hidden one. For this one, you will want to return either 0.0 (hidden) or some other value, when it is visible. You can store whether it's expanded or not in a bool property.
When it should expand, update the expanded property and call both
[tableView beginUpdates]; and
[tableView endUpdates];
This will show your previously hidden cell with a nice animation. You can also use this mechanism to hide it again.
You can use expandable tableview and design the tableview according to your needs.
https://github.com/OliverLetterer/UIExpandableTableView

Modern Era UITableView Animation

In a UITableView what would be the most convenient way of showing up additional information from a smooth scrolling effect?
You might want to look at the screenshot below. The top UITableViewCell is a kind of "Create new stuff"-button field, and I would like a formular to show up from below this field with a smooth uniform scroll animation.
How is this best achieved? Do I want to create a view and manipulate with the current cell's height and animate+display a SubView or do I want to manipulate with the Delegate and DataSource to simply create a condition on showing more cells if the button is pressed (which causes a reloadData with some kind of animation set true) ?
I could wander around in the wilderness and mess around, but I guess that I'm not the first one to encounter such issue and that someone might have some constructive input.
** UPDATE **
All the interesting stuff happens in indexPath.section = 0 so I now simply created an (atomic) BOOL createFormActive and manipulate cell data accordingly with my didSelectRowAtIndexPath looking something like this:
if (indexPath.section == 0) {
self.createFormActive = !self.createFormActive;
[tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationAutomatic];
}
This works pretty well. So you could say I have found a solution, but feel free to use this thread as inspiration or discussion.
I've had good results with the "showing more cells if the button is pressed" approach. Relying on the table view's built-in animations is good bang for the buck IMO. Initially, however, I found managing a dynamic data model and calculating the batch updates can get out of hand quickly.
I ended up writing the TLIndexPathTools framework to make these things easy. Take a look at the Settings example project, a "settings" table view that morphs into a couple of different configurations as you make selections. I've done a much more elaborate real-world settings screen with table animation and it turned out very well.

How make the same animation like UITableView reorder of cells?

I have a drag&drop operation between 2 UITableViews. The cell could be reordered in the source TableView, or move to another TableView.
Because I need to move the cell between the two, I can't use the default reorder support. However, I want to make a similar animation like when the cell is moving around and the cell below them slide out.
Any hint in how do this animation?
UPDATE:
You can see what exactly I'm looking for in the pulse app.
You can always use deleteRowsAtIndexPaths:withRowAnimation: to remove it from the source and insertRowsAtIndexPaths:withRowAnimation: to insert it into the destination.
if you want to do something similar to what makes "Pulse" you have to use "UIScrollView" for each row that you have and within the Views you need, if you do it UITableView is more complicated and would not be so easy to move between them

Resources