Xcode 8.1 UI Testing twoFingerTap() fails on Google Maps view - ios

Since upgrading to Xcode 8.1 my UI tests that use twoFingerTap() to zoom out on a Google Maps GMSMapView have been failing with
Assertion Failure: Element.swift:135: UI Testing Failure - Unable to find unoccluded area to perform event.
The message preceding that is
Recompute visible frame by excluding frames of occluding elements StatusBar and "the view's identifier"
Anyone have any idea what I should do about that? Tried tapWithNumberOfTaps(1, numberOfTouches: 2) and same thing happens.
NB. The problem is definitely with multi-finger taps only -- doubleTap() and pinchWithScale(2.0, velocity: 1.0) continue to work fine under Xcode 8.1. pinchWithScale(0.5, velocity: -1.0) continues to move origin instead of zooming, which is what it did to GMSMapView in Xcode 7 as well.

I am not sure if you're drawing your UI, or using storyboards. Nevertheless, it doesn't appear that you have the elements drawn to the view properly. Perhaps using constraints you can secure the element to your view.

Ive just upgraded to Xcode9 (beta) and this issue appears to be resolved

Not sure if you already solve your case but It will help if you put Google Map inside another view and then set it's accessibility in storyboard (make sure Accessibility's "Enabled" and "User Interaction Enabled" is checked)
Then you can find it inside otherElements and tap or doubleFingerTap on it.

Related

Selectable objects on UITableViewCell not responding to user input on iOS14

While compiling a couple of projects with XCode 12 (beta 5 is the latest version at the moment) and running them on iOS14, I've noticed that UIButton, UITextField, and many other selectable objects are not responding to user input when inside of a UITableViewCell.
In some cases, it is possible to work around the issue by bringing the object to the front (object.bringToFront()), but this is not working for all the cases I'm facing. I've also noticed an empty view (layer) on top of the components of the cell when I use the "Debug View Hierarchy" Tool. This view is not present on XCode 11 builds. Is this some new cell configuration that I'm missing? Is there a standard way of disabling this behavior or will I have to be hacky to fix this?
PS: The issues were not present on the same projects when compiled with XCode 11 (or previous), even when running on iOS14.
All the select response issue may caused by adding subview on UITableviewCell. The right way is add on UITableViewCell.contentView, check it first.

iOS 9 Segue Causes App To Freeze (no crash or error thrown)

I have been working on this app for months now and from as far back as I can remember I have never had an issue with segues. The code is unchanged in terms of calling performSegueWithIdentifier but since my recent update to Xcode 7 and iOS 9 I have not been able to tack this issue.
I have tried:
Deleting button and creating new button w/ segue link
Using a direct segue from button to view, without the use of performSegueWithIdentifier
Connecting button to new blank viewController
When I press the button, no initial load functions are called on the destination VC (Ex: ViewDidLoad, ViewWillAppear, etc). When I connect it to a blank view, the segue works fine with the same code in place.
Since the code never stops, or breaks, and just seems to "freeze" in place while still running on Xcode I can't seem to even narrow this down to whats causing the issue. I have a similar segue that is also called from another button on the same ViewController that has no issues whatsoever.
Any thoughts on the matter are greatly appreciated!
EDIT: I have narrowed the issue down to the UITextView's causing the problem. Once the Text Views were removed the page loads fine via segue. I wonder what changed between iOS 8 and iOS 9 in terms of UITextView as I will have to remove the text views and completely re add new text views.
So basically the segue was freezing because of the UITextView's I was using in the destinationViewController. The following fixed the issue:
Delete all UITextView's
Add new UITextView's
you must leave the default lorem imposed text and change this programmatically in the viewDidLoad()
This was the fix for me, and from the research I have done on the issue it seems this is a bug in iOS 9 and Xcode 7.
Cheers!
NOTE: Removing the text in the UITextView (or making it longer then ~12 characters) is sufficient to work around it, no need to delete and recreate them. This is fixed in Xcode 7.1.1 and later.
I ran into the same issue and the fixes in this post (Xcode 7 crash: [NSLocalizableString length] 30000) solved the issue for me.
The first is to enable a localisation other than the base for the storyboard (see https://stackoverflow.com/a/32688815/3718974)
The second is to turn off the base localisation (see https://stackoverflow.com/a/32719247/3718974)
I think I have the same problem: I have a UITabelView with cells created from a nib file, when a user tap a cell this method is called:
and when I have the following method prepareForSegue:: the application crashes:
if I delete the line 129 Everything is ok , the method prepareForSegue:: open the right view and the label contactName is shown with its default text.
If I modify the method as follows prepareForSegue:: get exactly what you expect, without having any type of error:
let me know if you also get the same result
Any one who is facing this issue, i solved it by turning off the "Optimize rendering for windows scale" option in Debug of simulator window. I already had tried all of the above answers but could not solve the issue.
In the method in the first viewController where you activate the segue, do you have beginIgnoringInteractionEvents anywhere? If so the screen you segue to will be frozen and will ignore interaction events like you describe. If this is the case you can fix this by adding an endIgnoringInteractionEvents method before your segue method:
UIApplication.sharedApplication().endIgnoringInteractionEvents()
self.performSegueWithIdentifier("editItemToMyGearSegue", sender: self)
I realize this is an old topic, but appears to be still relevant. I was facing the same problem in Xcode 9, iOS11. My UITextViews are embedded inside UITableViewCells. Same symptoms as described here. The tricks with default text and placeholders did nothing for me, but I solved it by turning off the scrolling indicators for the text view in the xib. They were on by default, I guess, though unused.
Edit: this is probably an important detail... the views that were hanging all had an image NSTextAttachment in the attributed string of the text view. I think the image was wider than the available table cell content. With scrolling turned off, they appear to downscale.

IBAction in Xcode 4.5

Anybody experiencing no response for IBAction touchUpInside in Xcode 4.5, deployment target iOS 5 as well? It works in simulator for me having iOS6, but not iOS5.
I had this same issue because I was using a tap gesture. You should be able to keep your existing code by adding the line below. This will keep your tap gesture from killing any taps on interior buttons and such...
yourTapGesture.cancelsTouchesInView = NO;
Edit:
I have found the solution. I was adding a tap gesture to the view, which was overriding the view's ability to detect a touchUpInside action on any buttons since they are part of the view as well. So what you should do is either remove the gesture recognizer or make it specific to a certain object. For example, I added the touch gesture to the specified part of the view that was not on the subview (I created a new object / outlet and labeled it as such). Still not sure why it's different in 5.1 vs. 6.0, but this should help you.
Original Post:
I am having the same issue. I have a project where buttons on a subview are clickable on version 6.0 of the simulator but not version 5.1. I have some gesture recognizers in there as well but commented them out to see if they were the issue and they are not. The only thing I have found is that the buttons are sometimes clickable on a touch up outside action (even though they are programmed for touch up inside), so I am not sure if maybe Apple changed the eNums for button actions? If I come up with a solution I will be sure to provide it here.
I just created a new demo project. I added a button to a view, handle touchUpInside, built and tested using Xcode4.5 on both deployment target ios6 and ios5 - both worked just fine. Try with a demo project yourself - won't take more than a few min.

xCode crashes when I drag custom object into UIScrollView

I have a custom button that is a subclassed UIButton. When I try to drag it into a UIScrollView in IB Xcode immediately crashes. What gives?
I have this custom button working inside a UIScrollView in at least one other location in my app. Any ideas?
UPDATE:
Uncheck "Use Autolayout" in the File Inspector fixes this problem. See answer below.
I have this custom button working inside a UIScrollView in at least
one other location in my app. Any ideas?
I could crash several Java editor like this. The problem it was in my custom component code:
I have added code, which the designer ( Interface builder) have executed to show my component.
Take extra care at init, viewDidLoad methods in your Button code.
Do not know exactly, But once the same kind of issue happened with me.
My problem was that some of my drawing methods were being called recursively, causing the Xcode to crash. I handled those recursive calls and issue got fixed.
SOLUTION: Uncheck "Use Autolayout" in the File Inspector
Thanks to #BornCoder I decided to try running this on my laptop running Xcode 4.4. When I tried to build I got an error saying this version of Xcode doesn't support Autolayout. I didn't intend to use Autolayout, it looks like Xcode 4.5 does automatically. Unchecking the box fixed it.

iAD on iPAD is transparent but clickable (Monotouch)

I am using monotouch 4.0.7 and was able to get iAd to show up sucessfully on iPhone(normal) and iPhone(retina).
It seems that the iPad version is loaded successfully, clickable but it's completely empty. In the emulator it has the mousedown color too.
I've tried extending the frame of both the view controller and the view to 1024x768 but it's still not showing up.
Is this normal behavior in Portrait mode? I am using ADBannerContentSizeIdentifierPortrait.
By the way, AdLoaded is getting called and there are no warnings in application output.
I've been looking into the issue, the problem (I'm guessing) is that you're using "ADBannerContentSizeIdentifierPortrait" as the identifier in your "RequiredContentSizeIdentifiers" set. The problem is that the string is not the same as the identifier. You should instead use the class properties on ADBannerView which are ADBannerView.SizeIdentifierPortrait or ADBannerView.SizeIdentifierLandscape.
Let me know if this sorts out your issue,
ChrisNTR

Resources