How to know if the user has reached the edges of Webview? - iphone

I'm trying to develop an app based on the idea of the Twitter for iPad, with sliding panels (for this, I'm using stackscrollView https://github.com/Reefaq/StackScrollView).
I have a UIWebview inside a UIScrollView, what I need is a way to find if the user has "reached the edge" of the UIWebView. I mean, I want user being able to pan around the web view, zoom in/out. But, I would like to find a way to get noticed when some of the edges of the web view has been reached. When that happens, I don't want the webView to bounce (that's simple, bounce = FALSE), instead, I want that starting from this point, the ScrollView start to respond to the touch (Even with the finger of the user inside the webView).
Basically: I wanna to the same thing that Twitter for iPad does when it opens a panel to show a site: allow us to zoom in/out, panning around, and, when the edge is reached, the panel is swiped.
I think the way to go is using scrollView property of the UIWebview, but I don't know exactly how.
Any idea?

Related

For Flutter Mobile, How to Push a New Route by a Drag/Swipe Gesture While Controlling the Position of the Routes (Like Swipe to Pop in iOS)

As most of you already know, Flutter offers a Cupertino navigation transition that represents the native iOS behavior when navigating to previous route. You can start swiping from the left edge of the device and a navigation animation is started. Unless the user ends touching to the screen, the user is in control of the position of the current (above) and the previous (below) routes.
According to the release position and velocity, whether the screen will be popped or not and the animation controller takes the rest of the job.
I want to implement exactly opposite of this. When the user starts swiping from the right edge of the screen to the left, the gesture will be detected. The new route will be created and be positioned on the right. User can drag the new route to the left (into the scene). After the release of the touch, it will be decided to whether center the new route (complete) or let it go away (cancel).
This behavior can be observed inside Safari browser, for example. You can navigate backwards by start swiping from the left edge. Moreover, you can navigate forward by starting to swipe from the right end of the screen.
Also, it is possible to experience a similar UI/UX behavior in TikTok app. When watching a video on the “For You” screen (that’s the default home page of the TikTok), the user can start dragging the screen from right to left and when the gesture detected, the profile screen of the current content’s owner will be shown. As mentioned above, the user will be in control of the position by dragging. When the user ends touching it will complete or cancel the navigation based on the situation.
Question is:
I am a power user of Flutter since the very early beta days of it. I made quite complex UX implementations till today. However, this type of a navigation need haven’t been an issue and didn’t come to my mind.
I did a deep research on the Flutter source code, internet, Flutter issues, pub.dev, etc. Yet, I couldn’t find a logically easy solution.
Does anybody know how to do that? Indeed we can use the CupertinoPageRoute and extend upon it but my mind just stopped at the moment.
Side note: The end result could be like a parallax effect or like a PageView.

Continuously scrolling UI Unity

So I am working working on something in unity (2d game). I have a list of button (UI) on my scene and I want to implement a scrolling mechanism. What is the best way to go about it? Currently , I can scroll through horizontally because I have added a "scroll rect" to the the canvas holding the buttons as I start the game. However when I try to scroll back (horizontally, it goes beyond the Buttons. Is there a way to make the scrolling continuous such that as I scroll, from the first UI element when I get to the last one and I keep scrolling, it continues with the first element. or what should I do. please let me Know If i should clarify.
In the Scroll rect you can set the movement type. I don't think the kind of "infinite scroll" you are asking for is available.
For your case, I think that the Use Elastic or Clamped mode to force the content to remain within the bounds of the Scroll Rect should do the work.
In the case of the infinite scroll specifically needed, you would need to ask for that explicitely and show your attempt for more specific help.

How to prevent Scroll Box from consuming touch event in Unreal?

I am working on a UI system for a mobile game in Unreal. I have functionality already in place that basically reads in if the player has swiped by basically getting the player's initial touch location and then checking if the player moves their finger a certain pixel distance and then it changes between pages.
I am trying to add a scroll box to the page as I find that not all of my content will fit on the screen. However, now that I have added it to my Widget, my swiping function no longer works. I am assuming this is because the scroll box is consuming the touch event. Is there a way to make it so that the scrolling does not consume the input event?
I had the same problem but unfortunately, I couldn't find how to continue to read touch events.
As a workaround, I created my own scrollbox, so that I could read the finger location while I'm scrolling.

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

Image in UIScrollView moves offscreen before while zooming

I am working on a photo gallery iPhone app.
Approach is fairly inspired from the ScrollingMadness code available on github.
I have a scroll view which holds all my image views when in paging mode. When user zooms an image using pinch out gesture, I remove all the image views but the current one - and set the content offset to 0,0 (obviously).
Everything works perfect on simulator but on device I face this crazy issue.
When a user pinch out to zoom an image, it goes off screen and when the pinch out touch event ends, it comes back to the screen.
After zooming the image once, if I zoom it further - it does not give me the buggy experience. This leads me to a conclusion that patch needs to be applied where I am removing the other image views from the scroll view and holding the one which is being zoomed.
Not able to figure out how I should make it to work like the iPhone's Photo app. The - magical - Photos app!
Anyone who can point to a direction to get this thing up and running - would be all the help I need right now!
Well, since when you zoom you are moving your picture to (0,0) effectivly the first page, you would expect when the user pinches any page thats not the first one, the image will have to move to 0,0 and therefore you are expiriencing your image moving. After you zoomed once, the image is already at 0,0 so subsequent zooms work fine. Are you finding that zooming on the very first page gives you the behavior you want and only other pages have this issue? If so a fix might be not to move the zooming picture to (0,0) but just keep it where it is and have some dummy view for all your other pages so you dont take up memory from the other pictures. Hope this helps