Preventing Sliding When Top View is Off Screen - ios

So I've been playing around with the examples included with ECSlidingView.
In the BasicMenu Example: I've placed 20 rows in the Settings table view. When I open the menu, the table view in settings continues to slide if I touch it.
In the TransitionFun Example, the table views are not slide-able when they're not full screen.
I've looked through the code and don't see what's causing this difference. Can someone point it out to me? I have an app that pretty much started as BasicMenu and I sometimes have trouble using the pan gesture to close the menu, because I end up accidentally sliding the mostly off screen table view instead.
Thanks!

Look at setting:
slidingController.topViewAnchoredGesture = ECSlidingViewControllerAnchoredGesturePanning | ECSlidingViewControllerAnchoredGestureTapping;
such that, when the top view is anchored, tapping and panning it will both result in sliding. This eliminates the ability to otherwise interact with the top view controller contents.

Related

iOS Simulator - partial swipe left with appium to view button

Hi All,
I need to achieve partial swipe left to view button on right side.
I tried multiple solutions found here and official forum but all the resulting in tap action being triggered on the row.
None of them resulted in partial left swipe.
any idea how to achieve it ?
Thanks in advance
From what I understand you might performing this swipe with end point located around that button/row you try to make visible?
If e.g. this row with a button is located lets say between 45%-50% of the height of the screen you need to perform this swipe below or above it on the background to not interact with the element itself during the swipe action which is a touch and move to action after all.

Recreating Instagram longpress peek?

I'm looking to recreate the functionality that's show in this video for the picture:
https://www.youtube.com/watch?v=zEREoIcoQHE
A long press is done, a view appears, and when the user swipes up far enough, the options come up at the bottom. If the user continues to drag up higher and then lets go, the main view animates to bounce back down to the middle of the screen. If the user swipes all the way down, the view animates away.
I recognize there is a lot going on here and a lot of different pieces and that this is a very broad question. I'm more or less looking for a place to get started with it. The only thing I really recognize here is I guess a scrollview. I know how to do all of the basic stuff with presenting and dismissing the different views, but the dragging and the scrolling and the snapping back into place is where I'm not sure where to begin.
Is that all just scrollView code I need to learn? For example I guess there's a way to detect when the scroll has been scrolled far enough up to trigger presenting the options view. What is making the view bounce back into place after dragging up and releasing? etc.
What tools are used to achieve this kind of behavior?
If I am not mistaken thats the "Apple's" 3D touch APIs magic ✨
Check out their documentation
You might be interested in :
ViewControllerPreviews: Using the UIViewController previewing APIs, which demonstrates peek (preview) and pop (commit), as well as peek quick actions
Reference: https://developer.apple.com/library/content/samplecode/ViewControllerPreviews/Introduction/Intro.html#//apple_ref/doc/uid/TP40016546

How do I make the elements in my UIView responsive?

My goal is to create an alert that has three text fields, one taller than the others, and an image that, when tapped, allows the user to choose a picture to replace a set default one.
After unsuccessfully searching for a library for this, I decided to create my own alert by placing a UIView off the screen and, when prompted by a button, would zoom onto the screen; it consists of all the elements I require.
When I run the application, the view pops up correctly, but none of the elements on the view are responding to touch. I've checked that isUserInteractionEnabled for everything is turned on.
What's also odd is that when I keep the view on the screen (instead of placing it some distance away on Storyboard), all the elements work fine.
I'm assuming it had something to do with the animation. I tested it with a fade in instead of a displacement, and the result was the same - the elements were unresponsive.
In order for your elements to be responsive you have to link the action of you clicking them to your view's code. You can do this in a non-programmatic manner by ctrl-clicking your element on story-views and then dragging to the view controller. Then choose action instead of outlet, and choose when the action you want will be triggered (bottom part). Then insert your code in the viewController.
So I figured it out. I used the debug view hierarchy and saw that the alert was behind the elements behind it, even though it was still being shown (for some reason). I changed the zIndex of the UIView and it worked!

iOS View Controller is only accepting touches in a certain portion of the window

I have a relatively simple dialog/popup style UIViewController that isn't behaving correctly. I have many others just like it (though each with a unique button layout) that work just fine. For some reason that I cannot figure out, this controller is only accepting touches within (approximately) the green shaded area.
Note that none of these colors are the actual colors, just placeholders. Same goes for the text.
Tapping in the "Search..." text field does nothing. Tapping on the "Cancel" button does nothing. No UI reaction whatsoever.
The tableview will scroll just fine (there are over 100 rows) if it's touched inside (approximately) the green region. Touching the tableview below the green results in no response. Same thing for the "Cats" button. It reacts when touched in approximately the top half, but nothing in the bottom half.
I've banged my head against the wall for the requisite "several hours" and am getting nowhere.
It seems that part of your view controller's view is overlapped with some "harmful" view/views. Maybe this view is created programmatically and is not visible in IB. You should start with checking your views hierarchy. Put breakpoint in your view controller's code. Somewhere, where you are sure all views (normal and harmful) are already created and type in debug area
po [self.view recursiveDescription]
you should receive something like
Now try to find harmful views. Temporarily delete some "normal" views could be a good idea.
I found my solution. I have a method that launches a dialog controller given the dialog to launch and the parent (up until this point, always a full-screen view controller). The parent gets darkened and the dialog gets launched on the center of the screen.
This one wasn't working because I was launching it from an existing dialog; I was telling the dialog launcher that the new dialog's parent was the current dialog, not the whole screen. This means that the new dialog (which is bigger than the first one) launches at the correct size, but only accepts input inside the area of the "parent" dialog, which is the smaller one underneath it.
Fix: Launch the new dialog using the current dialog's parent (which is full screen) and it works fine. The green zone on my image is the approximate size of the dialog that was being used as the parent, which is why input was only being accepted in that area.

Storyboard - connect distant scenes

I've got a bunch of controllers on my storyboard but I'm struggling to connect two scenes that are far apart graphically.
You can't seem to do it when zoomed out and when you're zoomed in you can't see both scenes on the storyboard.
Suggestions?
==== UPDATE ====
Holding the arrow at the edge of the screen did it but wasn't easy finding that magic boundary initially.
Ticked as correct answer although not quite sure what was meant by the = sign shortcut.
The doc outline is handy. For those wanting to use it - there's a little arrow button bottom left of the storyboard. Or use Editor > Show Document Outline (or Reveal in Document Outline).
If you hit = sign and then ctrl drag from one controller to other it should work. You hold the end of the arrow at edge of screen and it should scroll the screen for you. Oh also you can use the document outline(the area next to navigator that has the arrow pointing left that opens and closes it) and ctrl drag from one controller to the other.

Resources