Duplicate Title Text when placing GooglePlaces SearchController into NavigationItem in iOS 13 - ios

I have an iOS app that uses GooglePlaces API. I use the "Add a Results Controller" technique to implement the search bar, but instead of assigning the searcher to the navigationItem.titleview like so:
navigationItem.titleView = searchController?.searchBar
I assign the searchController to the navigationItem.searchController like this:
navigationItem.searchController = searchController
This has worked for me up until iOS 12.4. I don't like the way it looks when the searcher is in the titleView.
Now in iOS 13.x this results in duplicated title text which can be seen in the attached images.
This duplicate appears when the search bar has been activated then Cancelled or when the focus moves to another control. When you pull down on the underlying table, you can see the duplicate in the live app.
It also causes the Search page title to bleed through when you navigate to the detail page. I don't know if this is a GooglePLaces API issue or an iOS 13 issue, but it causes my app to be rejected from the app store.
If anybody has seen this behavior please let me know. i have a sample project that shows the behavior.

I've been struggling with the very same issue. It's definitely a problem with UISearchController.
For now, what's known is:
It can be avoided by setting searchController.hidesNavigationBarDuringPresentation to true (thanks to Chris' comment).
If you absolutely must have searchController.hidesNavigationBarDuringPresentation to be set to false, you can manually remove offending labels as in this answer.
Finally, it's been reported that iOS 13.2 fixes that bug.
For more details see this question.
P.S. It was so hard to find any info about that bug, so I decided to collect all available clues in one answer for all of those who's faced the same problem.

This has been fixed with iOS 13.2

Related

Empty line rendered in UINavigationBar with UISearchController in iOS 11

This is most likely to be an iOS bug, I've reported to Apple already (35410538) but I'd like to find a workaround to temporary fix it.
When you have an UITableViewController inside UITabBarController which is embedded by UINavigationController an empty line is rendered when scrolling. This happens on both simulator and device. the navigation controller has to be set to show iOS 11's large titles and have an UISearchController in it.
I've setup a sample project demonstrating it here.
Has anyone found a workaround to fill that line?
Thanks!

Share sheet Cancel buttons invisible swift

Is anyone else running into this problem. I recently noticed that the cancel/save buttons on the share sheets are now white making them impossible to read.
I've tried changing the navigation bar color but that doesn't even seem to work so clearly I'm missing something else.
This still works properly on devices running IOS 10 but having issues with devices running IOS 11
messanger
Mail
Notes
Twitter
I've ran into similar issues. It seems like title text attributes set on UINavigationBar get passed down to the UIActivityViewController from iOS 11 on.
So something like this:
let barButtonItemTextAttributes = ...
let barButtonItemAppearance = UIBarButtonItem.appearance(whenContainedInInstancesOf: [UINavigationBar.self])
barButtonItemAppearance.setTitleTextAttributes(barButtonItemTextAttributes, for: UIControlState())
... affects the sharing sheets as well. In my case, the foregroundColor attribute was set to .clear to disable Back button labels on the navigation bar, but it also removed the above mentioned cancel/save buttons.
Maybe this applies to your case as well.

A way to achieve UISearchController appearance similar to Photos app in iOS 11

I would like to update my old iOS 10 application's UISearchController appearance to have effect similar to native Photos app in iOS 11.
But I am not sure how to get such smooth animation of NavigationBar transition from LargeTitle to UISearchController.
UPDATE
I know that there is UINavigationItem's property UISearchController, but it just shows UISearchBar under the Large Title and its appearance with hidesNavigationBarDuringPresentation set to true looks completely different.
Thanks for any suggestions.
In iOS 11 there's a new way to add the UISearchController to the UINavigationItem. Check the documentation from Apple.

UISearchContainerViewController linker failure in iOS 9.1/Xcode 7.1.1

I have severe problems implementing UISearchController wrapped up in UISearchContainerViewController for a universal tabbed bar application.
Basically what I am trying to implement is search like in the Apple music app where UISearchController is not set as a tableHeaderView but is presented upon tapping a magnifying glass button in the navigation bar.
It's very important that the UISearchController is initialised like this: searchController = UISearchController(searchResultsController: searchResultsController) not with nil, as there are all kinds of scopes and searchable content could be core data and server.
I am currently presenting the UISearchController modally which completely screws up the view hierarchy as search happens in UISplitViewController installed in one of tabs (both master and detail view controllers).
This is the linker error.
My deployment target is 9.1 - I have seen on Apple forums here that somebody else had the same problem.
So is it an Apple bug or I should be looking somewhere in my app?

UITextField visibility false in appium test iOS

I have devoleped a simple iOS app and on test using Appium all the UIControls staus is shown as visibility false. The below image is the screenshot of the test. I set accessibility label on storyboard
The code I wrote for a simple textfield is given below.
self.txt_txt.isAccessibilityElement = YES;
self.txt_txt.accessibilityElementsHidden=NO;
I have done a little R&D on this and haven't found anything keep 'visibility ' true for UIControls.How to keep visibility true in the above case.If not in code are there any other scripts to run?. Any thoughts are welcome.
I believe this is a bug when using iOS8, based on the information shown in the Appium bug database here:
https://github.com/appium/appium/issues/4131
Looking at the last comment to this bug, it seems that in iOS7 elements are correctly identified as "visible: true", but the same ones in iOS8 are not.
As far as I understand it, at the moment it's not yet clear if this is a bug in Appium or in iOS8.

Resources