How to create multidirectional infinite/circular scrolling view like the HBO GO iPad App - ios

My question is essentially what it says in the title--I would like to create a scrolling view similar to the one that appears under the 'Home' tab of the HBO GO iPad application.
I have looked into circular/infinite UIScrollViews, but they only discuss infinite content in one direction (either horizontal OR vertical) and bring up many problems when scroll speed gets too high. So my question is twofold:
A) Could they have created this scrolling view by subclassing UIScrollView? If so, please do let me know how?
B) If not, does anyone have ideas as to a starting point for how they could have created it? It runs very, very smoothly even at fast acceleration, and I'm trying to figure out how they created this.
Thanks in advance!

Reposting to get answer ;-)
The sample is named StreetScroller.
Referenced video is here.
I believe the successful technique will be to apply the techniques in the video in either a 2x2 or 3x3 grid and handle scrolling in both directions.

I have put together a library that provides an infinitely scrolling view in all directions. It allows you to very easily achieve the effect you’re looking for and much more. As the user scrolls around, the framework lays out the tiles and lets the delegate know so it can set up the tiles' presentations. This is indeed done by subclassing UIScrollView and as for performance, the framework introduces no lag: full 60 fps no matter how fast you scroll.
The framework with a sample app that displays Flickr images in an infinitely scrolling wall is here: https://github.com/vovagalchenko/scroll-for-days. Additionally, here's a video of the sample app in action: https://cloud.box.com/s/d6bgvlot175au5a3jeh5

I don't think there is an easy way to do it by sub classing UIScrollView
I have done something similar with a UIView and a custom gesture recognizer, moving views around nice they disappear off the side of the screen.
I hope this helps you.

Related

Slow loading and app crash while adding stackviews programatically in iOS

I'm adding a bunch of stackviews(horizontal) to the vertical stack view programmatically inside a VIEWDIDLOAD method.Im adding this in almost 10 screens but while navigating to the respective screens it is taking almost 30 seconds to load and at some point while navigating it is taking too much and crashing the app.
Here is my view hierarchy for adding the views.
Vertical stackviews-->horizontal stackviews (view1+view2+view3+------depends will up to 7views)
In the above hierarchy I'm adiiding multiple views to the horizontal stack view and finally adding to the vertical stack view where it can iterate through 100 or 1500....
Please help me out of this problem to increase the app loading time and app crash issue....
I have to agree with both Leo and Losiowaty -- UIStackView is meant for elementary layouts -- collection view is a much better option if you want performance.
Edit:
What you're trying to do is difficult no matter which technique you
use. Since you already have it working with auto layout alone, you
probably understand it much better than you did when you set out.
(and better than you will a week from now if you stop here)
It will be worth your time to
implement this with a collection view, since you'll have this issue
again as you evolve your app. You'll find it can do what you need.
Just tackle it in steps. There just isn't any "easy" solution if
your data isn't easy. 💩 Get started and ask questions when you get
stuck. Include the code that illustrates how you're stuck. People here
will be glad to help if you show your efforts. I know I will.

Can anyone suggest what to use to make the UI screen as Mention?

I have design the UI for the below screen as I am little bit confuse that what should have to use for the below screen. As you seen the on the screen below things:
1.Scrolling part of Images swap.
2.Again another Scrolling images Swap.
So here for the scrolling Images what should I use its Collection View for both or Pagecontrol for one and Collection view for other. Please suggest me.
Thanks and Appreciate for the help...
Use UITableView and in its cell use UICollectionCell so that you can scroll horizontally and vertically.
see Back image, this is how you can implemented output looked like.
As Tinu Dahiya pointed it correctly, You should use tableView and custom tableViewCells to achieve your UI design. This approach will also make your coding easy to handle dynamic contents which you might be fetching from server. For your reference you can directly use this control from cocoa controls. This control is ready made dish for you, you just have to implement your logic to achieve your functionality.

How To Create Animated Onboarding on iOS

I'm creating an app that will have a quick onboarding at the beginning with some pretty simple scroll through animations and finish with a button to basically "GO" into the app's content.
I'm looking for suggestions as for how to most effectively and efficiently develop this, here's some things that it needs:
there should be paging so that it locks onto about 4 different positions throughout the onboarding.
the animations progress should be dependent on the scroll view's position (I'm guessing the x value of the content offset)
there needs to be views that stay on screen through multiple pages and some that move on screen and off screen throughout the onboard, it can not just be one picture moving on then off
there needs to be a button that pops up on the last page
I have a good understanding of Scroll Views, Page Views, and Page Controls. I also just bought Core Animator (the app) if anyone can suggest how implement that.
The way that I'm thinking of doing it is basically creating a Scroll View with paging that is empty and just use it to control animations with its content offset. Is there a faster way to do this or maybe a open source library that would work better? I'm only proficient in Swift currently :?
Thanks for any suggestions! This my first app and I'm very excited to hear your suggestions
I would look at UIPageViewController as its setup to do the scrolling by page for you, although you have control over what kind of animation it uses. You are responsible for feeding it view controllers to display using this method:
setViewControllers(_:direction:animated:completion:)
here is the link to the apple documentation UIPageViewController docs
I created a scrolling credits screen for one of my company's apps, FaceDancer, that would be a decent starting point for what you are after. The app is free. You can download it to check it out at this link: FaceDancer. The credits screen is off the info button on the main screen.
It's not hard to use UIView animations to simply animate a series of views. I think that might be easier than working with a scroll view.
I can give you some guidance if you think it would be helpful.

Tracking touch in iOS

I am creating a word search game for the iPhone and am having trouble figuring out what is the best approach to take for the main component of the game (the word search puzzle).
I am currently using a collection view to display the puzzle. However I am having trouble figuring out how to track the users touch on the collection view to highlight letter as they slide their finger across the puzzle.
Iv looked into collection views's selection and highlight features but they don't seem to provide the functionality that I need.
So basically my question are as follows:
Is a collection view the best approach for this type of game (word search)?
If it is, then how do I go about tracking the user input to highlight and return the cells they slide their fingers over?
And if it is not the best approach what are some other options, that make it easier to track users input on a grid like display?
I tired posting images of what I am talking about but can't due so, so hopefully my problem is clear, if not please let me know and I will try to be more specific.
Thank you in advance for any advice and suggestions.
A way to go about this would be to add a pan gesture recognizer to the collection view. Then, you can use indexPathForItemAtPoint: and cellForItemAtIndexPath: to get the correct cell as the user pans. You can then do whatever you want with the individual cells.
There is a great SDK for iOS called HeatMap. You can get more info HERE. I have read lots of good stuff about the developer and the service. Lets you track touch events on selective views.
Here is a screenshot from the demo on that site:

What is the canonical way to animate views over a fixed background?

In my two recent questions here and here I laid out my problem a bit, but I want to ask a more general question here. First my goal: I am trying to animate views side to side with a fixed background image.
I am new to iOS, and so I don't know all the tools that are available to me, but each time I started hacking this together I kept thinking that there must be a built-in way to do this. I didn't want to reinvent the wheel, so what is the common way to implement this?
The best approach I think is making a UIView based in two main views:
The background, that always will stay
And on top of it, another UIView with your animated view
In case you want to animate it, its quite easy, just check this:
iPhone UIView Animation Best Practice

Resources