How can I prevent clicking iAd from changing my view? - ios

I have an app that displays buttons, the buttons move around the screen upon being touched. The problem I am having is that you can move the buttons around, however if you click on the iAd advertisement after you move the buttons, the buttons return to their original positions. How can I stop this?
Note: I was having the same problem for a while whenever I did a full screen rotation (only landscape supported). Upon rotation the buttons would return to their original positions. I fixed that problem by changing the segue from modal to push. Not sure if this helps but thought I would mention it.
EDIT: I have been trying to use the ViewWillAppear method to correct the layout, however it is not getting called after closing out of the iAd.

Related

Touching an area of screen dismisses view controller

I've never seen a problem like this until now. When I first updated my app, this problem did not exist. It was fine. Since then there've been a couple of iOS updates, so it's possible this is where the problem began.
I basically have a few view controllers that proceed like a wizard from one step to the next, by either clicking back/cancel button or the next button.
There's a textView covering the main area.
Normally by touching inside the textView it would begin editing.
On this viewcontroller it's fine, that works. No problem.
On this viewcontroller and every subsequent view controller including tableviews with options to select, if you touch anywhere underneath the cancel and next buttons inside the view controller, it dismisses the view controller and goes back to the previous screen. There doesn't appear to be anything executed in my code when this happens. It just dismisses the view controller as if one pressed the back button. I know the back button code is not being executed because I printed a line in there.
The next view controller is a tableView and does not have a textView. It's got nothing to do with the textView. It just dismisses if I touch anywhere on the screen other than the next or cancel buttons. The next views are the exact same way. It's like a big invisible button is in the way of the screen blocking any interaction with the top half.
What's going on here? How do I fix this? It has never done this before and I didn't change anything.
Turns out that this was caused by using page curl transitions. I changed it to flip horizontal and it works now. Page curl transitions are obviously bugged currently.

UIPopoverController Button, Prevent Dimming Overlay?

When presenting a UIPopoverController from a UIButton the entire screen behind the popover is dimmed.
Is it possible in some way or another to prevent the presenting button (the one pressed to show the popover) from being dimmed?
I remember solving this problem when it has appeared the first time on iOS 7. The only solution (if nothing has changed) has 3 parts:
Remove the default background (setting popoverBackgroundViewClass).
Add your own background (I used a subclass of UIPopoverController to handle the appearance callbacks)
Display your button (or any other passthrough views) above the background. You can either remove them from their hierarchy and move them to the same position in the background or just take a screenshot of them and add them to the background.
In the end it's not too difficult but it takes time to debug.

UIButton doesn't respond to touch on first load, but works after segueing back from another view controller

I'm not sure when or how this happened in my project, but it did. The main button in the middle of my initial view controller ignores all touch events when I first load the app. The buttons in my navbar on the bottom all work fine.
If I follow one of those buttons through a modal segue to another view controller and then segue back into the initial view controller, the button works perfectly.
I'm at a loss. Any idea how this could have occurred or how I could fix it?
Update
I can't put my finger on what, but this has something to do with my constraints. If I remove them (and my app tumbles into a mess on 3.5 inch phones), the button works at all times.
I have the same problem: on the first load of the view one particular UIButton doesn't work, but if I tap on other tab bar element, launching a segue and then coming back to my home screen, it works perfectly.
My problem persists even if I remove every constraints for the view.
In my case, the POSITION of the button seems to be the cause of the issue: in the right side of the view it becomes not working, but if I move the same button on the center or left of my view it becomes available.
HELP ME/US :-(

Tapping background to close subview in Xcode 4.3

Currently I am creating an app. for the ipad that uses a media player. When you click on a button the media player pops up and I have code that when you press another button the media player stops and is hidden so you can go back to using the superview. The problem is, I dont want to have to click a button to close the subview, I want to be able to click anywhere on the background to close. I've tried making the whole background a button but I'm having trouble writing code to make it so that the full window button that closes the subview ONLY appears when the subview is up. Right now the full window button is up constantly so I can't click on the button that brings up the subview in the first place because the large button is overlapping. I hope this dilemma is fairly easy to understand. If not I can send some code.
Try a UIPopover instead. What you're describing is the default behavior.

UISplitView having issues in Portrait

I have a UISplit-view that uses Table-views in the left hand "Master" area and it seems that after pushing several table-views on the Root Controller, followed by popping them off and all the meanwhile, rotating back and forth between portrait and Landscape, the button in portrait seemed to stop responding.
Upon further investigation, it turned out that it wasn't that it wasn't not-responding, it was that the area that was touch sensitive was sliding partially off the screen making the area that you could touch to get the "Master" popover was at the very Edge of the button making it extremely difficult to hit. I do have a flex space, title, and additional logout button.
Any Ideas?
It turns out that in the Mono-touch split-view template, has two methods in the Detail Controller, in one it hides the popover and button for the Master view while in Landscape, and in the other method it puts it back. I was using one of those methods to add a fexible space item, text item, and logout button to the toolbar. The problem was that because I was doing it in that method, it was adding them every time it went to portrait and somehow the flexible space getting added every time, was slowly pushing the touchable area for the Master Button, off the screen. (The Button itself never moved) After adding the items to the toolbar during the ViewDidLoad method, and not adding it again, resolved the issue.

Resources