Is UISplitViewController automatically linked to a UITableView? - ios

I'm trying to make an iPad version of the app I am developing. The app works really well on iPhones but I'm facing problems on iPads.
Basically, in the iPad version, I add a UISplitViewController containing a UITabBarController as main controller ( left side of the screen ) whose first view controller contains a UITableViewController.
There is a UISearchBar to allow the user to filter the table view.
The problem is, on the iPad version, when I use the search bar, an other table view - with filtered content - pops up with an "arrow" pointing at the search bar.
My question is : what is this other table view that appears and how can I disable it ?
EDIT
I found this on this website
In a few situations, the framework will automatically create and
display a popover for you. One such situation is what happens when a
search bar (a UISearchBar) tied to a search display controller
(UISearchDisplayController) appears in a toolbar (UIToolbar) on the
iPad.
That's exactly what I'm talking about. How can I disable this popover ?
EDIT 2
Just found this topic : UISearchDisplayController automatically creates a UIPopovercontroller to display content search result ?! How to dismiss it?
Problem is : the provided solution doesn't fit my needs. I'd like to be able to search directly through my table view, I just don't want this popover to appear at all.
EDIT 3
Solutions founds :
I am not using UISearchDisplayController anymore.
Either UISearchController or just a selector triggered whenever changes are made on my UISearchBar's text field.

Related

UISearchController iOS 11 not in navigation bar busted?

I have an app in production. On iPad, the layout is 2 table views on one layout. There is a search bar for the left hand table view. In iOS 9/10 this worked fine- the search bar, when expanded, simply appeared in the table view. In iOS 11, the same code will make the search bar expand out of the table view and attach to the nav bar area at the top of the screen.
If I change the presentation context of the search controller, then in iOS 11 it is completely broken and does not work.
self.definesPresentationContext = YES; //YES PRESENTS SEARCH BAR IN TABLE VIEW
I have created a demo project to simplify the example, this is directly Apple's table demo with the table view made as not full screen. The presentation context can be set to either the table view or not, and the search bar scope buttons can be easily added or not.
In the demo, the search controller, when presented inside of the table view, can be tapped in order to start a search, but is completely unresponsive to any taps - the cancel button, the X to clear text, trying to move the cursor. Keyboard text entry works and it will correctly filter the items. But then you're stuck and can't exit.
Here's a link to the demo project. Am I missing something or is this an Apple bug? Majority of code in APLMainTableViewController.m.
DOWNLOAD CODE EXAMPLE at this link
Full app image:
Correctly working search in iOS 10:
Demo project screenshot with bad search controller:

CNContactViewController and SFSafariViewController on iOS cannot be used within a UITabBarController

I have been trying to use CNContactViewController without success. I want to show a list of contacts (which I expected there to be a built-in VC for), then tap into the detail of that contact and have it displayed as in the Contacts or Phone built-in app. This doesn't seem to be possible, as pushing these new VCs seems to break the UI in weird ways, see below.
My main question is: am I stuck re-creating the UI for this functionality myself, or are there known workarounds?
This example uses a UINavigationController within UITabBarController:
Initial presentation works as expected:
Tapping the "Share" button attempts to show a UIAlertController, which appears behind the tab bar, and also removes the UINavigationController's top bar:
This is similar to the issues faced in this question: CNContactViewController forUnknownContact unusable, destroys interface

UISearchDisplayController click-through bug on iOS7

We use the standard UISearchDisplayController in a project built on iOS 6.1 SDK. There appears to be a bug when running the application on an iOS7 device - The controller lying underneath the modal controller gets the user interaction instead of the UISearchDisplayController.
Steps to reproduce:
Click on the search bar to give the UISearchDisplayController focus (modal view is shown on top of the viewcontroller lying underneath and the search bar is moved to the top of the window)
Write something in the search field to get the table view with results to show up
Click on the clear search field icon (X) or backspace the text in the search field
Now the modal view is shown instead of the table view
At this point if the user clicks on the modal view, the click is caught by the viewcontroller lying underneath the modal view causing faulty behaviour. This problem still remains even if the table view is shown again after the user has done another search.
Has someone else noticed this bug, and has anyone a solution to this problem?

View Controller in the "More" tab doesn't rotate, but it will if it's on the home row.

I have an app built in storyboard that needs to support landscape mode in just one view controller. I decided to support iOS 6 after some issues with supporting iOS 5 and running iOS 6 on my phone. I used this Stack Overflow answer: https://stackoverflow.com/a/12505461/1050388 but I'm still seeing a weird quirk. (For those interested, my controller scheme is Tab Controller -> Navigation Controller -> TableViewController -> UIWebView. The UIWebView is the only VC I need to rotate.)
I blocked all but one VC from turning, but that VC is in the "More" tab. I initially had a quirk where this "More" VC would change orientation to landscape when rotated and then any subsequent VC would be in landscape, but I found this (https://stackoverflow.com/a/12526152/1050388) and creating a category for UINavigationController helped to solve that issue.
However, when I navigate to that tab in the "More" list, and turn the VC, it doesn't rotate. But when I click "Edit" and move that tab to the home row of the initial 4 tabs, it rotates just fine. If I move it back, it doesn't rotate. Anyone have an idea why this is happening?
I believe the problem stems from the fact that the More navigation controller is generated dynamically by iOS and is read-only.
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarController_Class/Reference/Reference.html#//apple_ref/occ/instp/UITabBarController/moreNavigationController
It would be great if the technique of using a custom category would work here but based on your experience I guess it doesn't.
I also need better control of orientations for More tab views. Please post anything you come up with. Thanks.

UISplitView : Need to hide left view for initial two screens

I have gone through various threads and tutorials but not able to find any solutions, so need to post the question. So the questions is :
For initial three screens need to display only the detail view without any popover button at navigation bar in landscape. Now in third screen on button click i need to load the splitview with both left and right view.
I am aware of the methods which hides the left view panel in landscape mode. The only part i am worried id to load the splitview from 3rd screen .So need some suggestion to proceed further.
Thanks.
Try Matt Gemmel's custom split view controller.

Resources