Can't connect 2nd swipe gesture in interface builder - objective-c

I'm trying to add two gestures to a UIView in interface builder (swipe left and swipe right).
The first one (swipe left) works ... but the 2nd swipe gesture (swipe right) doesn't work, and I think it's because I can't connect the "New Referencing Outlet Connection" to the view (like my 1st gesture has) [see attached image].
Is this the reason?
I achieve this programatically, but would really like to understand how to add multiple gestures in interface builder.

Look at the connections menu. They both automatically get added to the gestureRecognizers collection.

I made a short tutorial video on how to use multiple gestures (right and left) in the interface builder. No coding is needed. I think a video is a better explanation for you :)
My english is not the best, but I hope it helps you! :)
Xcode connect multiple gestures

Related

How to make the UIView function like UIScrollView (Objective-C)

I have a class named Topic. And inside that topic I can create (and delete) Messages. I need to show the messages in a view that can be scrolled/swiped either right or left (Right to show the older messages, and left to go back to the newer messages). Imagine an image collection that can be scrolled sideways in a ScrollView, that how this should look like. Since the messages is being add by the user, I can't use UIImage. I am thinking of the approach that I need to add use UIView instead of a ScrollView, now my problem is how can I make my UIView function as a ScrollView in terms of displaying data?
please help. Thanks.
You should have to use gesture recognition. Check that user is swiping left or swiping right. after Identifying that you can change UIView with animation. I hope you can get me. This can be useful to you.
You should be able to achieve what you want by enabling paging on the scroll view, by setting the following property to YES as shown:
scrollView.pagingEnabled = YES;
This will make the scroll view scroll one page at a time.

UIPanGestureRecognizer with UIPageViewController

I am using a UIPageViewController to display certain content. I want to be able to display additional content when the user pulls down on the page using a UIPanGestureRecognizer. I can't seem to figure out what I should add my gesture recognizer to such that it does not cancel any of the pageviewcontroller's actions.
One of the apps I worked on has functionality similar to this. It shows a full-screen UIPageViewController, but if the user drags down on a ribbon on the top right corner, it will slide the whole thing down to reveal a view behind (for settings and other stuff).
I think your problem is that the built-in gesture recognizers are for the page turns. So what you'd want to do is either have something to drag on (such as the ribbon on the top left in my app) that will have its own gestures. OR you can iterate through the gesture recognizers that are assigned to UIPageViewController and get the one that matches the PanGesture, then override it with your own functionality to either delegate the event to the UIPageViewController or do the slide down, based on the type of pan.
Hope that helps.

Turn off auto zoom in storyboard

When editing a storyboard in Xcode 4.3, when I select an element, either by double clicking on the item (such as a button) in the view or selecting from the list on the left of the storyboard, Xcode pans to the element and zooms in so much that I cannot see most of the view. This makes it very difficult to do much of anything. Is there a way to disable this zoom 'feature'?
Sorry, but through answering a similar question, I found out that this in fact, is not possible. See link.
https://stackoverflow.com/a/9563917/716216

ios simulator: simulate swipe and drag

I have a UIView within a UIScrollView. When i want to simulate the drag event on the UIView, swipe event on the UIScrollView is being triggered.
As per the documentation , there isn't much of a difference between swipe and drag.
Swipe
1- Place the pointer at the start position.
2- Hold the mouse button.
3- Move the pointer in the swipe direction and release the mouse button.
Drag
1- Place the pointer at the start position.
2- Hold down the mouse button.
3- Move the pointer in the drag direction.
On an ipad I can use two fingers two swipe and one finger to drag. Now, how do i go about doing something similar on the simulator; drag instead of a swipe?
Edit 1:
I should have been clearer first up. Anyway, my problem is that the mouse drag is firing the swipe instead of drag, thereby scrolling the scroll view instead of passing on the drag event to the UIView contained by the scroll view.
I am on macbook pro. Two-finger swipe on the touchpad is being ignored. Touch and drag is causing the same thing as mouse-drag.
Thanks
See Jeff LaMarche's quick note on how to do this. It's documented in the same page you're reading, but Jeff's explanation is clearer.
If you want to simulate a two-finger gesture in the iPhone simulator, hold down the option key. You will get two dots on the screen instead of one. The two dots will default to pinching - if you bring the dot closer to the center of the screen, the other dot comes toward the center, making it easy to simulate a pinch in or pinch out.
If you want to do a different two-finger gesture, get the two dots the distance apart that you want them to be, then hold down the shift key, while still holding down the option key. That will lock the position of the two finger presses together so you can do, for example, a two-finger swipe.
see this documentation below:
iOS Simulator User Guide
Just use the mouse to drag the view, aka, left click the view then move the mouse
I ended up disabling the scrolling from the UI and added two buttons to scroll the scroll view. Since this is a work around only for the emulator, I have used #ifndef to hide the buttons while building for the device.

Tab Bar shows in simulator but not in Interface Builder

On my desktop when I create a Tab Bar application Interface Builder is not displaying it. On my laptop this is not the case.
The problem is kind of hard to explain so I made a video and posted it here.
http://www.youtube.com/watch?v=JO60BcPgWqk
Does anyone know if this behavior is normal?
You don't want to add your button to your window directly. You get the hierarchy wrong here.
You should add your button to the view of the UIViewController of one of your tabs.