Multiple Photos in slideshow type display within viewController? - ios

I am new to Xcode (started a few days ago).
I'm trying to find a way to get a few photos or videos in a display where the user can scroll or tap through as they desire. There will be multiple viewControllers each with a different set of photos.
Is there any existing UI type data types I can just drag and drop to make this work? Or is this out of range of the capabilities for someone not using code specifically.
I know Java, C, C++, MATLAB, etc. but never have toyed with Objective-C until now. Point being, I should be able to follow any logic you can throw at me, but I'm unfamiliar with the GUI and layout of Xcode as a whole.
This is what I currently have.
This is what I want. Perhaps with functionality to tap to full screen the image or swipe to go to another image. (This image was made with photosop. I don't actually have the picture file in Xcode because I don't know how)
SOLVED: Placed desired images in "Supporting files" content folder inside Xcode. This allowed me to select which photo I want displayed in which ImageView. To fix the proportionality issue where photos in Simulator are far too large, I simply added height and width constraints along with some other centering aspects and got the desired result.

Add UICollectionView in your view and set flow of collection view is horizontal make cell size that you want to keep.

Take a look at UICollectionViewController where you can display multiple cells with embedded views for your images, and consider segueing between them via a UINavigationController.
Edit: Now that you've added screenshots, I'd recommend using a UICollectionView embedded on your subclass of a UIViewController instead of a UICollectionViewController. This should give you more flexibility.

Related

Draggable UIButtons like in iOS Camera app

I want to build a similar view as seen in the iOS Camera app, but I don't know which UI-Elements were used.
It can be found in the Instagram Story section as well.
Edit:
It should have the same behavior.
I tried to accomplish this with an UICollectionView. I'm adding UIButtons to the view but I don't know how to make the 'drag & stop' behavior. Maybe there is a delegate method or so.
A small explanation or some ideas would be helpful. I don't need code.
That's a custom control. You could create it using a horizontal scroll view containing multiple UILabel objects, each of which has an attached UITapGestureRecognizer.
You might be able to find a third party library that does what you want. Try Cocoa Controls.

TVOS about App layout (Like in iTunes and similar)

I have played a lot with my app and I do not understand how to make layout like in for example iTunes (also many apps uses it).
How it is made? It is one big CollectionView, but with special Flow or it is TableView with many CollectionView?
Collection headers. In iTunes App if I select item (with adjustImageWhenFocused) under the header then the header will jump up and the item will not overlap the header. It is special magic or it is system behavior and I just do know how to use it?
Below is two screenshots about what I am trying to tell you and example with my app.
In iTunes there are movie preview page. With what type of View it is made? TableView,CollectionView or just ViewController with ScrollView?
I have read many sources and looked up demo projects, but nowhere I have found answers for this questions.
1) I think it would be a stackTemplate containing a couple collectionLists.
2) AFAIK the headers "jump up" on their own, no need to prepare anything special.
3) productTemplate?
For examples, see https://github.com/iBaa/PlexConnectApp, /TVMLTemplates/Default/Movie_OnDeck.xml (1) or Movie_PrePlay.xml (3).
Or check the gold source: https://developer.apple.com/library/tvos/documentation/LanguagesUtilities/Conceptual/ATV_Template_Guide/StackTemplate.html, plus other Templates.
If you want to use native Swift way it can be achieved in following ways:
You can use table view and have collection view within each cell. I am using same approach to achieve this.
We have focus update delegate from there you can find the focused frame of image view. With the help of focused frame and label frame you can check if they are intersecting or not. Based on that you can move label up and down.
This is native TVML template, in order to achieve in swift you need to create view using tableview and collection view.

Creating a UIButton that changes with my repopulating UICollectionView Carousel, also adding in gifs to replace current images

So Im pretty new to the swift language and not well versed in its structure, However I have managed to design a collection view to scroll horizontally through repopulating images. Ideally what I would like to do is be able to select that image and bring it to another screen to proceed with the application. I know I need to repopulate the button each time we repopulate the collection cell, however being novice I am currently failing at doing so. Any suggestions to make this work would be fantastic. Also any directions into incorporating gifs into the collection view instead of an image would also be appreciated.

Is there any way to make a custom table view cell look like a button in Xcode 6+?

I'm trying to create a Table View Cell array and have the name displayed in each table. The tables will look like what you see on the home screen of the Evernote app (shortcut, tags, places, notebooks etc.) and each one will access the next screen when tapped. How do I go about doing this? Novice app developer.
This is an image of the result I'm trying to get.
That is a basic cell with transparent background and other views (and images, layers, etc.) added as subviews.
For the other things I suggest to study how UITableView works and how to push a UIViewController using a UINavigationController.
In general you should study iOS and Objective-C from zero.

UICollectionView for Springboard like folders

I am trying to achieve the following effect:
A UICollectionView displays a grid of cells for a parent type of object, e. g. a photo album. When I tap one of these items, I would like to scroll that element to the top of the screen and open a Springboard like folder from it. Inside that folders area, another collection should be shown, consisting of the detail items, i. e. the individual photos of that album. Tapping in the remaining "parent" view closes the folder again. See this schema:
What I have done so far is a regular collection view for the albums. When I select one, it scrolls to selected item to the top and then uses JWFolders to open an empty folder at that place. Once that is shown, I trigger the surrounding UINavigationController to push my 2nd view controller with the detail items. That one is layed out so it appears to the user as if it were still the same view.
There are several problems with this approach, and I would like to know how to do this better:
JWFolders takes a screenshot and animated two halves of it up/downwards to achieve the opening effect. This is ok, but pretty slow on an iPad3, because it moves a lot of pixels and the iPad3's GPU is not quite up to the task.
The 2nd view needs to be pixel-perfect to match on top of the first one. This is likely to break accidentally.
I am limited as to what animations are possible for the view controller transition. The default UINavigationController's push from the right is not fitting. I override that to do a cross-dissolve, but still it is far from ideal.
I would like to get pointers as to how to approach this problem in a maintainable manner that does not require to much creative hacking against what the frameworks are designed to do. I might be missing something obvious here, so pointers to examples or general advice are appreciated.
Update:
I changed the approach a bit. Now I use a container view controller that has two embedded collection view controllers. One for the "Album" and one for the "Photos" part at the bottom. Using a UIImageView in the middle between the two I can get the triangle pointing upward done. This is also nice from a maintenance point of view, because it makes maintenance easier with the two collections being handled completely separately.
The app uses Auto Layout, so I can change the amount of space each of the two embedded views takes by modifying the constraints. This is way faster than the screenshot based approach with JWFolders and works nicely on an iPad3 as well.
This almost gets me where I want to be. The one thing that remains is to get the opening animation right. I would like to simultaneously scroll the Albums collection, so that the tapped item goes to the top and expand the photos collection with the triangle pointing at the Album cell.
Can I somehow "connect" the lower view to that cell via layout constraints, so that the scrollToItemAtIndexPath:atScrollPosition:animated: call drags the lower view open?
To get around it I would lose the library and cause iOS to move those display elements around without screenshots or other tricks. On the tap, cause the tapped icon to retain its normal appearance while you dim all the others. Find the contents of the collection view from the top to the end of the line where the tapped icon is. Create two new collection views - one which contains the top half, including your tapped icon and one containing the rest, below. Animate those views apart to make room for the folder view.
The folder view is another UICollectionView that appears in the gap created.
In the main view there are either one or three views presented depending on whether the drawer is open or closed. I would probably look at creating a view controller with a collection view, and using view controller containment to manage all three views. You have complete control over how those views are presented, so you could animate top and bottom views up and down simultaneously to reveal the folder view in place, as Springboard does.
When that's all working then you could generalize and start doing things like deciding to make the tapped icon part of the bottom collection with the folder appearing above if the icon was low on the screen.
(I hesitate to answer this because of the large number of upvotes yet no answers, so I may have missed something - but that is how I would begin trying to achieve the Springboard effect.)
To solve this problem in a relatively easy way, you could try to make the folder a simple UICollectionView subclass and then insert that cell when the albums cell is tapped.
In the collection views data source you would have to return different size etc. for the folder cell.
In the folder you would have to create the folders collection view, avoid making the folder cell the data source of the cell folder collection view tho.

Resources