Using PageViewController for a large number of pages like camera roll image view? - ios

I am trying to create an app for which I need a way to swipe through views. For example, while swiping through images in photo stream or camera roll. I DO NOT need to swipe through images however, I need to swipe through UIViews. I have been looking at PageViewController. However, setViewControllers:direction:animated:completion: suggests that I need a ViewController for every UIView. This doesn't seem to be what I want since I will have over 40 views that I will need to scroll through. I think I'm missing an obvious ios feature here since even iBooks has a way to go through pages of books.
I was thinking maybe having 3 ViewControllers and changing their content whenever I swipe across. But that seems very roundabout.
Please help me out!
Thanks!

Apple has provided a fairly robust example of doing this kind of thing with photos called "PhotoScroller" at http://developer.apple.com/library/ios/#samplecode/PhotoScroller/Introduction/Intro.html. It uses UIScrollViews and CATiledLayers to recreate the experience of the Photos app. You may be able to modify it to work with your UIViews instead of images.

Related

Creating webpages thumbnails in swift

I am trying to code a "webpage selector" on my app, using a fancy carousel to display the webpages thumbnails.
However, I don't want to display the webpages thumbnails as webViews on my carousel because I can get quite a large number (20-30) of webpages at the same time and loading all of those can cause a lot of lag.
So, I decided to use screenshots of the webpages and use those images to populate my carousel instead, making the carousel animation much smoother.
Here is my question:
I would like to know if there is any way to take a screenshot of the webpage (without showing it on the app screen) and save the image into a list that I can use to populate the carousel.
I am aware of this question but is quite an old post, so I was wondering if there is another way to do it. Also, I tried to implement the suggested solution, but it did not work.
You can create a WKWebView that is behind your view controller (and thus invisible) and constrained to the size that you want. Once the page finishes loading take a snapshot by using drawHierarchy(in:afterScreenUpdates:) inside of a UIGraphicsImageRender and save the resulting image as your thumbnail.

Swipe between UITableViews like Livescore app

I am trying to expand my application that is currently in the App Store. I found an interesting way to change between two UITableViews by swiping and I want to implement something similar. I tried searching but had no luck, most of the searches ended up in swiping UITableViewCells or what Android uses "fragments"
What I want to achieve looks like this. I will show you in three different pictures taken from the livescore app. Since I can't upload images here I will give you dropbox url:
View1
View2 (starting to swipe, can see the data on the other view already)
View3 (finished swiping)
Can't post the link since im restricted to two links...
Any ideas what they are using for technique? What it is called and/or if you have a good tutorial for it would be appreciated.

What do I do when I have very long views with lots of images in iOS app

I'm an iOS newbie and for an app a view will have around 20 photos with a audio player under each so you can listen to someone speak about the images.
How do I go about with this? Would I just make a very long view controller with all the images and audio? It would be a lot of images in total as there are around 5 views with these images and audio.
Or is there a way to have this content elsewhere and get the app to pull the content into the view?
I hope I make sense. Any tutorials/ideas would be a lot of help!
I strongly suggest you use a UITableView or UICollectionView (which are very similar code-wise, but have a different display style).
This will be a good way to manage UX and memory because the cells are just made for that kind of things.
You can find good tutorials about this on raywenderlich or appcoda
For example this one
After this is implemented you'll wanna have a look at customs cells probably, so you can display/move/interact with them in a more... well, customized way.
That you can also find very easily on appcoda &/| raywenderlich
For example, here.
How about you use UICollectionView or UITableView. All your Images/Audio components are similar to each other. So you can use advantage of paging.
It will cost you much less memory since you'll only be consuming the memory for the images( in this case cells) that are showing.
Read a tutorial about UITableView or UICollectionView.

view images in ios7 app and make interactive

ok guys im not to shure where to start with this one its a first for me but i have a floor plan that i would like to show in my IOS7 App and i know i want the user to shrink and grow the image so he or she can zoom in to areas of the map. it would be nice if they could click on the an area of the image and it would be linked to data in my parse database. but i think thats a long way off for me.....
but for now just to let the user shrink and grow and rotate the image would be nice.
anyone got any tutorials they can point me to?
Have a look at Apple's PhotoScroller example. Here an ARC-ready version.
This will not cover rotating the image, but you can easily get this by following this tutorial.

A UI control for Ipad to brose a list of images

I have made the decision to use monotouch to develop an application that browses an rss feed and displays a grid of images much like browsing the picture library actually on the device.
My issue is that I have NO idea (even after extensive googling) as to what control I should use.
I want to be able to swish through the list of images which I really wanted in a UITableView BUT all documentation insists that UITableView only has 1 column :(
I dont want to get too complicated with my requirement at this stage for unloading and loading resource as the images go off screen but if anyone has any pointers for me in starting this and what control I should go for I would be grateful.
My initial thoughts are perhaps having n images in every cell and the cells are very wide (would an ipad only display those it can and automatically allow swiping to the others off screen?)
Many thanks
Richard
The UItableView is only one column, but you can define the UITableViewCell to your own class and allow any number of elements across it.
As to whether something goes off the screen, that is entirely down to your application.
Have a look at the developer videos on iTunes, especially the beginning table views sections, that should point you in the right way

Resources