iOS 6 AppStore apps list UIScrollView behaviour - objective-c

Does anyone know how to implement the behaviour of scrollview in iOS 6 AppStore app lists? Particularly, paging of 3,5 icons (half of icon in the right side), and when the list ends - half of the icon in the left side.
Tried so far:
1. Custom gesture recognizer (looks a bit hacky + a lot of math in the code)
2. Different configurations of scrollview and its subviews (insets, frame, content size, etc.), but it's still not working as expected

I am not 100% sure if the App Store app actually uses UIScrollView - it used to be mainly HTML based.
Regardless, you should be able to use the relatively new delegate method scrollViewWillEndDragging:withVelocity:targetContentOffset:, introduced in iOS 5. This method is designed for you to move the scroll view to a custom position once the user lifts their finger without needing to worry about deceleration / velocity (i.e, custom paging offsets). You'll need to make sure your scroll view is set not to page for this delegate method to be triggered.
Once it is triggered (when the user lifts their finger off the screen) you can calculate the required content offset and set the passed in targetContentOffset property. The scroll view will then automatically decelerate to the appropriate content offset you supplied.

Related

swift adding zoom to container view

I have a page view controller embedded inside a container view in order to swipe between images. But now I am trying to add a touch that will make the image go full screen "lightbox" with zoom available and also swipe through the images while in full screen mode.
I can get it to work, and messing around with auto layout seems to be much work consider I have a lot of other stuff in that VC.
So does anyone know a good image slider from github written in swift? - without the need of cocopods.
thanks!
It's easy enough to write one yourself. In full-screen mode, use another UIPageViewController, because it already has the swipe left & right support built in.

Responder Chain (UIWebView inside UItableViewCell) Objective-C

I've been struggling with first responder problem. I put web controller (UIWebView) inside UITableViewCell and now I would like to scroll vertically my table and not affect UIWebView (this case may be done by disabling scrolling scrollview from UIWebView). However problem appears when user zooms into web content, then I want scroll horizontally through web content and still vertically scroll in table (cause cell will be resized to zoomed content).
There is a property called 'multipleTouchEnabled' that should disable the pinch gesture, but I think the user would still be able to double-tap (assuming the cell doesn't consume this gesture). Why not, instead of creating multiple UIWebView's (which have a large overhead) don't you create one hidden UIWebView that loads a website and caches an image, then load this image into the cell.
Ultimately, if you still wanted to use the UIWebView approach, you could probably subclass it and override hitTest/touches methods or handle the gesture recognizers yourself.
Also, if this is for iOS8 I would be using the WKWebView instead.

How to forward pointer events

I was able to get this working in iOS but I am having trouble with Win 8. What I need to do is this:
I have a drawing view that is the forward most child of a ScrollViewer. When I enable drawing mode from a button in the app bar, this view becomes active. With one touch, I want the user to be able to perform the current drawing action, but with two touches I want the touches to go to the scroll view instead for scrolling and zooming. I am able to distinguish between 1 and 2 (or more) fingers, but I don't know what to do after that point.
I tried removing the manipulation mode from the drawing view so that it would not block the scroll view, but the touches continued to be swallowed by the drawing view. I also tried calling ReleasePointerCapture but that had no effect either. How can I forward touch events using the WinRT API?
For some more information, I am making use of the PointerPressed, PointerChanged, etc events in the drawing view.

How to rotate iPad screen using a gesture rather than physically rotating the device

Here's my user's iPad requirement. Two users are sitting down at a table with an iPad between them. Each user needs the ability to "take control" of the app by doing a gesture to rotate the screen towards him. This would be equivalent to picking up the iPad and changing its rotation to face the user. A few questions about this:
1) Is there any default behavior within iOS to to be able to do this?
2) Do you know of any apps where this is done so I can see it in action?
3) Lastly, how do I go about enabling this functionality for my app? This functionality should be available for all UIViewControllers within my app.
I'm no expert on the topic, but here are my thoughts:
If you want to also have the app respond to device rotations, the proposal is a bit more complicated. However, if you want to eliminate physical device rotation reactions in favor of rotating the app yourself, there are only a few steps necessary:
Stop the views from auto-rotating. In iOS 6, this is as simple as implementing the shouldAutorotate: method and returning NO and the supportedInterfaceOrientations method to only return the one orientation you want to allow in the view controller at the root of your controller hierarchy. In iOS 5 and earlier, you want to implement the shouldAutorotateToInterfaceOrientation: to only return YES for one orientation in the view controller that is at the top of the view controller hierarchy.
Add code that reacts to the gesture you want to use to rotate the screen (maybe a gesture recognizer).
When the gesture is performed by the user, rotate whichever view is at the bottom of the view hierarchy in your app. Likely, you will rotate the view managed by the rootViewController. Remember that you will need to deal with the new size of this view, not just the orientation. To affect the rotation, I think the best route is to apply an affine transform to the view's layer. This is pretty helpful if you are not familiar with affine transforms.

How to recreate Jetsetter's iOS teaser photo & photo viewer slideshow transition?

One of the more impressive iOS app that I've come across is Jetsetter's due to its great design, incredible interface, and creative uses of animation. One of my favorite components of the app is the teaser photo interface they have for the hotels/venues. They provide a minimized photo slideshow, but if you want the full view you can click it and it expands to expose a larger version of the image. You can see a blurry video of this in action here.
I'm interested in recreating something similar. I'm well aware of the paged galleries like MHPagingScrollview (which is how the larger photo viewer functions), yet what I'm trying to figure out is the proper way to handle the transition. I've also seen libraries that handle the Ken Burns effect for images. However what is not clear is whether or not there are separate view controllers.
Is this a transition between two separate view controllers? Or would the minimized and maximized photo viewer be part of the same controller? How would you most efficiently replicate something similar? I've embedded a screen shot below to illustrate the before and after. The video linked above however most effectively illustrates this transition.
Mobile engineer from Jetsetter here. They are two separate controllers, but the transition animation occurs in the first. Here's the flow:
A user taps the smaller photo.
A transition view containing the full size image is placed directly on top of the smaller image.
The transition view animates to the bounds of the screen.
The photo viewer controller is presented as a modal without animation, completing the effect in one seamless animation.
The effect is reversed when the modal controller is dismissed.
The trick lies in your transition view. We created a UIView subclass (with clipsToBounds enabled) that contains an imageView. The bounds of the transition view expands to reveal the imageView, resulting in no distortion of the final image during the animation.