How can I make all my buttons "touch up insides"? - objective-c

I created an app where users can touch buttons on a scroll view to go to another view, but when you scroll, it gets stuck on the buttons, and can only scroll when not touching the buttons.
So I suppose touch up inside would fix this but how would I make all my modal connections into touch up insides?

If you're using the storyboards, then they should be on touch up inside by default.
My guess is that your scrollview has Delays Content Touches disabled, you can set them via interface builder or self.scrollView.delaysContentTouches = YES;

Related

Animate view and set button backgroundimage conflict

I am making a type of drawer animation for iOS where a button tap in one of my views will expand that view over the other views from the bottom up. All is well, except when I want to change the button image after animation. The animation completes but then returns the view to its original position when setting the button image.
Things I have tried:
Using CGAffineTransformMakeTranslation instead of setCenter; this works perfectly, except I want to also add a panGestureRecognizer to interact with the drawer, present, and dismiss it. The transform doesn't seem to play well with this interaction
Adding the buttons programmatically thinking maybe AutoLayout is fussing with this
UIView beginAnimations as well as UIView animateWithDuration and completion block
Setting breakpoints and verifying that the movement of the view is reflected in the frame of the button before the image is changed; button frame is not still in original position, but has supposedly relocated with the view
It shouldn't matter, but my project is using TabBarController. I made a simpler version of what I'm trying to do with just the one view controller and had the same issue. The green view extends beyond the frame of the view controller's view so that when it moves up it reveals what is off-screen.
example: http://i.imgur.com/tRou0Js.png?1

Can't seem to achieve the same effect on my slide menu as Any.Do

I am trying to create the same type of slide-up/pull-up menu (from the bottom) as the Any.do iPhone app, but not having any success.
The issue I am running into is the app was built with storyboards so I am thinking I might have to scratch that idea and use just code.
Any ideas?
There is no need to get rid of your storyboard to recreate this, that's what IBOutlets are for. Any way, it looks like this was made by creating a UIScrollView that takes up the entire screen. Then add a UITableView to the upper section of the scroll view. Mind you in order for this to work, you'll need to disable scrolling on the scroll view in the background.
From there you can programmatically add the other elements to the scroll view to be rendered off screen, since there are only three they can probably just be buttons. And finally, since scrolling is disabled on the background scroll view you can add an image with a UISwipeGestureRecognizer at the bottom of the screen to manually change the scroll view's content offset property.

Transition to Modal View Controller with Keyboard Visible

Is it possible to present my modal view controller with the keyboard already visible? Currently, the modal's text view becomes the first responder as soon as it's view is loaded, which causes the keyboard to animate coming up from the bottom.
I'd like the keyboard to already be on the modal and be a part of it's transition. Any suggestions?
The keyboard is a separate UIWindow object. It is not in the same view hierarchy as your view controller's view. To make this happen, you would have to dig around in the UIApplication's windows property for the keyboard window and replace its default animation with a custom animation.
You could try putting the becomeFirstResponder code in vieWillAppear, but that isn't the "right" thing to do anyway.
You will probably need to replace the actual keyboard animation with a custom animation to force it to load immediately and without scrolling up.

iphone - prevent uiscrollview from scrolling by touch

I've a scrollview and on both sides, I've two buttons left and right.
when i click the scroll view will move left and when right button is clicked it will move right side. My scrollview has 20 buttons (approx) & on click of each button some action is performed.
Everything is perfectly implemented and working fine.
Only thing i couldn't implement is to prevent scrolling by touch. I don't want user to scroll the scrollview manually. How can i prevent it from scrolling by touch and still able to click the buttons inside the scrollview ?
Try setting yourScrollView.scrollEnabled = NO;. That should do exactly what you want.
Swift, set scrollView.isScrollEnabled = false and it should work!
Swift 3
self.scrollView.isScrollEnabled = false
If those buttons are the only interface for users, disable 'User Interaction Enabled' option of the scroll view in the Interface Builder. Or, programmatically, set userInteractionEnabled property to NO.
Maybe your issue is that when using UIView.animate and the options:
[.allowUserInteraction], is not set.
After this option set, the scrollview should stop on tap.

Overlapping images in cocoa touch applications

I programatically created a box. It can be moved around the screen. The problem is that there are buttons on the screen I made in Interface Builder. When the box moves over a button, it covers the button. How can I make it appear behind the button?
When you add your box to the view, instead of using [view addSubview:box] use [view insertSubview:box atIndex:0].