iOS UISlider not moving when I swipe, even though other UI elements are fine - ios

I've created a simple xib file with three buttons and a UISlider.
When I start the app on my phone I'm able to tap the buttons no problem, but the UISlider is locked and doesn't move..
However if I keep trying to move it with my finger it eventually scrolls left and right fine, but only after about a minute of furious screen swiping..
I thought it might be because it was hidden behind something onscreen (not that there's anything for it to hide behind) so I did 'arrange -> send to front', but this doesn't help.
Does anyone know why it might be doing this?

Related

React Native press and hold, drag finger to another touchable and capture touch by that view

In my React Native app I'm trying to have a button that the user can long press, and without lifting their finger, able to interact with another view. Here is roughly what I want:
Think of it like how 3D touch/long press worked prior to iOS 13/14 (depending on place in system and device): user either 3D touched or long pressed a button, for example an app icon, and a contextual menu popped up. Then, users could, without lifting the finger, hover onto one of the buttons and release their finger, triggering the button tap.
I have complete control over my buttons, touchables, and views (even the tab bar is custom, as opposed to the illustrations I made above).
How can I achieve this? (I'm on React Native 0.63)
There may be a better solution to this but off the top of my head I would use the Gesture Responder System
https://reactnative.dev/docs/gesture-responder-system
You can have a one container view that wraps tab bar and buttons. Then listen to the onResponderMove event to decide when these buttons should appear. This may happen for example when the locationY exceeds some value.
You can also use the onResponderRelease event (again with the help of locationX and locationY parameters) to determine if the finger was released above the button.

Swift: animate button up with swipe up? change direction that safari comes in from?

Im working in Swift and I am going to set up my view like this:
When the user swipes up, I want to animate the top image view and text so they move up WITH the swipe in the moments before the app is exited to go to Safari (the swipe gesture triggers opening a url).
I am trying to figure out the cleanest way to accomplish this - I am planning on simply animating up the image view using UIAnimations, however Im not sure the animation will go through all the way before the app is exited. Is there another way to achieve this effect?
I also need to know if it is possible to change the direction that the app "switches out" to Safari- by default, Safari comes in from the right. It does not look as good this way and Id really like Safari to segue in from the bottom - Can I force external apps to segue in from a different direction?

Custom bar button item not detecting touch correctly

I have created two custom buttons in the nav bar's right bar button using storyboard like so:
Below is how they look. I've added background colours to the buttons for easy viewing of detectable area.
The problem I am having is that the map button on the right is only detecting touch events on the left side of the button. The left button is detecting touch events fine. What's even stranger is that it seems to work fine in the simulator, but not on devices. I've tried on multiple devices and they all have the same issue. This is driving me crazy.... been at it all day. Please help!
After banging my head against the wall for two days with this one, I finally realised that as of Xcode 7 you can finally just drag multiple UIBarButtonItems to the UINavigationItem directly in Interface Builder. Creating the two buttons this way instead of the previous method fixed the issue.

UIView subviews updating visually but interact as though in previous state

I'm creating a UIViewController that houses some of RosyWriter's functionality, which I'm reworking to create a video recorder. The screen contains a title, a clipped-to-bounds subview that contains the AVCaptureVideoPreviewLayer (so the sublayer CALayer of the video content is added into that subview, so I think it's quite deep-nested), and two buttons acting like a toggle button - in the form of Start and Stop buttons placed in the Storyboard for the UIViewController.
The Start button works fine, even though the video's preview layer is on screen and showing the camera. When I start recording, though, I switch the buttons round, making the Start button hidden and the Stop button hidden=false.
The start button works - this is pressed when the video preview is on-screen and updating, but the actual recording (grabbing samples in buffers and writing them to a file - nothing UIKit related as far as I can see) has not started.
When the video recording is active, with the Stop button showing and the Start button hidden, the visible stop button isn't pressable, but the hidden start button can still be pressed.
I've tried moving the Stop button above the UIView containing the video, in case the CALayer or something else stretches outwith the clipped UIView bounds. This doesn't help. The stop button always acts as though it's not enabled - but it is enabled, and nothing appears to overlap the button. The button works fine if the UIView containing the video (which, I'll reiterate, is lower than the broken button) is never shown.
Can anyone think why this'd happen? I immediately thought about setNeedsLayout and setNeedsDisplay and tried just throwing some of those in, because it's almost as though the view had updated with my request to hide or show buttons, but an interaction layer hadn't updated.
Thanks
I now think this is due to my ignorant use (or misuse) of dispatch queues. I'm still not sure how I was able to interact with buttons that aren't showing - perhaps it's because their own state change responds in part, immediately, and the rest can't take place except on the main queue (the visual refresh, for example).
So I solved the problem, in a sense, by forcing a particular asynchronous delegate method to be called on the main queue. This doesn't affect the operation of this particular step in my recording process.

Animate image like deleting Apps from iPad/iPhone

I have a ScrollView with several UIButtons (custom type). The UIButtons are shown as Images. I made it to subclass UIButton to shoot an event if the user taps on a button for a long time (approx. 3 seconds).
If a user tap's one of the subclassed UIButtons i thought about animating the selected UIButton the way the apps are animated if you want to delete them.
I have nearly no experiance with animations. Is there something somebody can point me to? All i've found was transitions, but thats not what i need.
(Ill rephrase) On SO, there are quite a few questions to answer this. One of then is this link How do you make images wobble like on the iPhone home screen?

Resources