Replicate iOS Photos app collection view - ios

I'm trying to figure out the best way of managing the two list/detail view of the photos app. My main question is, is it two collection views with two separate layouts? Or is it just one that is changing its flow layout? Right now I'm using two in two separate apps, but I'm not sure if it's the best way of doing it.
EDIT: I'm talking about the grid view of photos turning into the detail view of a single photo that is also swipeable (left/right).
Thanks

Related

UICollectionView vs UIPageViewController

I need to have different full screen views in my app. Very similar to how snapchat works. The views should be able to communicate between each other.
My question is: Should I use a UICollectionView with cells same size as the screen or should I use UIPageViewController?
Please provide some background info to support your opinion!
I think both have pretty different purposes.
UICollectionView is great to build a mosaic of views (think an image gallery for instance), whereas UIPageViewController is kind of similar to the flipping pages of a book. The latter seems to be what you need, but UIPVC doesn't seem to offer many tweaking/customizations, like custom transitions for example. In which case you may want to start from a UIScrollView with paging enabled to recreate something similar but with more potential. Here's an example.
Personal opinion: for this specific case I'd use a page view controller. Collection views have any things you have to consider, like when the device rotates you have to recalculate where you are, which cell you have to display, ask to scroll to the current cell, and if you are displaying a video or using the camera you might have to control it perfectly, otherwise issues will come.
However think about new features that might be added to your app, if you think you might show more than 2 items on screen, then you'd better choose a collection view.
A page view controller lets the user navigate between pages of
content, where each page is managed by its own view controller object.
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerClassReferenceClassRef/
So If you plan to swipe from one ViewController to another, go for PageViewController. If you plan to have only one ViewController that deal with a list of fullscreen image or so, go for a view controller with a collectionView, or maybe your own swipeView.
UIPageViewController use different view controller and load multiple controller so obvisioly take more memory as compared to UICollectionView. So if your required task is less calculation or step to do then its recommended to use UICollectionView, other case preferred way is to user UIPageController.

How to put several views(not images) in page view controller?

I am a very starter in iOS Developing.
Now I would like to make an app of a children's story book using PageViewController. I have read some tutorials of PageViewController, but unfortunately all of them are about putting images in the PageContentViewController. I want to use views instead of images, because the content will be modified sometimes. Also, I don't want the views overlapped together because I want the workflow be visible.
I wonder whether there is a way to achieve it??? Thanks in advance!!!

Implement photo disperse transition similar to Photos on iPad

On the iPad, when you tap an album in Photos, the photos in the album "explode" out from the stack of photos and align neatly into a grid. That's a very cool transition and I want to try to replicate it, but I could not find any open source projects that have attempted to do just that. How could this be accomplished?
The setup is two view controllers, currently segueing via the usual push transition. The first view controller already has the assets collections PHFetchResult, and it could easily obtain the assets for each collection. I understand one must use the UIViewControllerTransitioningDelegate, but how this specific transition effect can be accomplished is what I'm wondering about. Wondering if anyone has already attempted this (in Objective-C or Swift preferably Swift), and if not, how it can be implemented.
A search for “UICollectionView Photo Stack” will get you pointed in the right direction.
Example? http://skeuo.com/uicollectionview-custom-layout-tutorial
Ultimately, you're going to be dealing with creating one layout that stacks all of the items in one spot. When the item is tapped, you invalidate the layout and introduce the grid-based layout.

How many view controllers is too many view controllers?

I'm creating a reference app for a game showing everything the user needs to know in order to be good at the game. Weapons, maps, random information, etc.
I am 1/10 of the way done and I already have over 45 views controllers in my storyboard. I only have one storyboard since I don't know how to create another one and link it to the first storyboard. The storyboard is starting to lag a little bit. How many views is too many views?
Once I'm done, I'm guessing I'll have over 100 view controllers in one storyboard. Is that too many? If yes, is there a simple way to fix that problem?
(I have so many views controllers because I created one for every individual item.)
I would create 5 storyboards (one for every category in the main menu) to see if it would reduce the lag, but I don't want to do that if it's not going to help.
You can create multiple storyboards in one application and Apple do not stops you from doing that. It is highly recommend to divide your app screens into modules and put those modules into different storyboards and navigate between them flawlessly.
You can have a look at this library for integrating multiple stroyboards in your application:
https://github.com/rob-brown/RBStoryboardLink

Viewing hierarchy in iOS

What are my options for viewing hierarchies in iOS? In OSX I have the option of using NSOutlineView. Ideally I should be able to support at least 3 levels.
Not much. Table views support sections and rows, which gives you 2 levels.
You could use a UICollectionView and roll your own hierarchy of data, but I don't think there is an equivalent to NSOutlineView in iOS. The UI Elements are designed for the small screen on a phone, where you don't really have enough space to present multiple levels of data. Apple added a few extra controls like a split view controller for iPad, but not really an outline viewer.
The norm on iOS is to use multiple levels of master/detail views. You drill down from the top level item by item until you get to the detail you're looking for.

Resources