finding out vertical pinch out in UIPinchgestureRecogniser? - iphone

I want to increase width of UIView,when pinching out horizontally and also height only when pinching out vertically? is it possible in UIPinchGestureRecogniser?

Not directly possible but if you were to maintain state yes. You can get the touch points using locationOfTouch:inView. Track them as he pinches and see which direction they are in. Update accordingly.

Related

Customize iCarousel ItemForView by setting its frame?

Usually items of iCarousel are displayed downside tilted. I want the change with upside tilted.
I got the code at github
and the iCarousel with options was nearest to my requirement.But it was for in same Y level Where I need to tilt it upwards.I changed its angle but it gets overlapped which is also not required. I simply just want to tilt the views upwards rather than downwards.
I have adjust tilt and spacing value of converflow type of iCarousel
Is there any idea to acquire this?
UPDATE:
I tried to use Cylindrical type in the example.And that matches the tilt effect upward as i want. But if I decrease the space it all overlaps and images are getting overlapped. Which I don't want I want images to get behind of each other

How to Pinch/Zoom in a UiWebView vertically only not horizontally

I want to make my webview to be pinched/zoomed vertically only. By zooming the webview I want to make it zommed vertically only but not horizontally.
Does it possible?
UIWebView also has UIScrollView as its subclass.
So refer how-to-lock-the-horizontal-scrolling-of-a-scrollview-in-ios link.
With a quick search, I found others that have blazed the trail before you:
Custom Pinch Zoom
The short answer is No, you can't realistically make an entirely custom pinch zoom like you would like. But, you can easily get the end behavior that you are looking for by manually rescaling your content after the automated pinch zoom has been released. It's not as pretty, but if your determined to have a vertical zoom, it might be the best option.

How to differentiate if user zoomed in or zoomed out on view?

How to differentiate if user zoomed in or zoomed out on a view?
Is there any direct property/method available to detect the same?
Thanks
If you are using UIPinchGestureRecognizer then you can do that using gestureRecognizer.velocity property.
Value of velocity is negative when current scale is smaller then previous and positive when it scale increases.

Expanding content within UIScrollView

I'm building a cell-based game that essentially works like dominoes: you start with one tile in the center, then connect additional tiles to it that can branch out in all directions. I have my game table all set up and working great... now I just need to make it scroll to accommodate the expanding content.
So, this doesn't seem to fit easily into a UIScrollView's built-in behavior. For one thing, cells expand in all directions – potentially going into the negative coordinate space of the UIScrollView. As far as I can tell, UIScrollView does not allow an actual CGRect with size AND origin to be defined for the scrolling content area. It appears you can only define a width and height for the content area that extends from point (0,0). Is this true, or am I missing something?
Assuming my understanding of the content area limitations are correct, how would one ideally handle this problem? My go-to idea would be to shift all subviews into positive coordinate space as the game board expands, then update the ScrollView's contentOffset property to counter the shift and make the transition invisible. I just want to make sure I'm not reinventing an inferior wheel before I start developing this.
Thanks in advance for any and all ideas!
I believe your idea is the good one, every time a tile is added, you may need to adjust your content view in order to be able to center on the tile that just was added.
Hence if this is "backward" (-x or -y) and your on top of your view (or nearly), you'll have to extend your contentView (surely the same way you do for +x, +y) and thus, adjust every of your tiles with the translation you did to your contentView's down-right corner.
Following up... yep, that did it. I set up the display so that it redraws the grid of cells from the upper-left corner. Whenever a new row or column of cells is added to the top or the left, the UIScrollView's contentOffset shifts by the newly added pixels to hide the change in content position.

UIScrollView Vertical Pan Snapping to top or bottom of view

I have an image that is 320x480 and upon orientation change this image obviously hangs out of view. There are some images where the focal point of it sits with it's bottom cut off (which isn't undesirable). My issue however is when the user pans vertically to see the full image, the view appears to snap to the bottom meaning the top of the focal point is cutoff. What I wish to happen is that the users can "free-scroll" through the image and perhaps move the images so the focal point is centre screen, instead of cutting off the top and bottom. I understand this is a difficult concept to describe in words so I've attached some images below.
This is how it starts:
This is where it snaps to the bottom:
This is the kind of view I wish to have but cannot:
Is there a way to control this "snapping" or perhaps a method I could use to override it when dealing specifically with this kind of orientation? My issue is that i WANT it to snap when panning left/right onto the other images in the ScrollView, just not up/down.
EDIT:
pagingEnabled is the property that controls this snapping, but is there anyway to detect if the movement is Up/Down or Left/Right and disable or enable this property in each occasion?
Cheers for any help you can offer
You can try using two nested scroll views; one is limited to scrolling horizontally with paging enabled, and one (or one for each page if you're displaying several images?) limited to scrolling vertically with paging disabled. By default this will work like you said, paging/snapping horizontally but free scroll vertically. However, it will only let you scroll in one direction at a time (either horizontally or vertically, not diagonally).
If you want to use nested scroll views like this but you'd like to allow scrolling/dragging in both directions simultaneously, take a look at my solution for this: Nested UIScrollViews scrolling simultaneously