iOS: View with datepicker and immediately keyboard visible very slow through segue - ios

I have a view with a UIDatePicker (inserted in storyboard) and in which in the viewDidLoad instantly a textfield gets first responder status so the keyboard is visible.
This view loads quite slow (about 2 seconds the first time, 1 second thereafter). I've checked my app in the time profiler and nothing special visible. Just some peaks (as expected) during the segue, however none of my methods or code is responsible for that. After I've removed the UIDatePicker and the immediately visible keyboard it was a lot faster. But I need them both..any advice how to that? Can I preload this datepicker and the keyboard somehow and just reuse them?

Related

iOS random problem of navigation, buttons not reacting for tap each time

I have noticed a problem with the navigation in our app.
Back buttons on UINavigationController for dismiss a viewController, or ok button for dismiss keyboard not reacting on tap each time. I have to press several times to finally enter in the button action method.
But i can see the button hilighting on each tap.
My viewControllers are pushed/presented and dismiss from the main thread.
My viewControllers is pushed/presented once.
There is no hidden view who catch the tap.
In the memory graph, I have no viewController instance leacked.
In the instrument I Have no CPU hight usage, No network call in progress.
App is in swift and uses rxSwift.
We don't use segue, all screens are pushed programmatically.
Has anyone ever encountered this problem ?
Have you something for me to check, explore or some advices ?
I have resolved my problem. It was caused by an override of isEnable method in a UIButton extension for my buttons.
I had changed the isUserInterrationEnable accordingly to isEnable.
Back button in navigation controller and ok button in keyboard InputAccessoryView are also UIButtons.
So my extension makes conflict with the system behavior and makes systems buttons not working all times.
removing isUserInterractionEnable in the isEnable override solve this problem.

Delay after prepareForSegue before UIStoryboardSegue/View shows up

I have a simple iOS application written in Swift that is hanging every 2nd time I tap a row to present the next view.
The first time, 3rd, 5th, etc times I select a row it waits for 5-15 seconds and then a modal MZFormSheetPresentationController (or whatever modal view) is shown.
If I dismiss and tap the row again (to show the same modal) it appears immediately. If I'm in the delay sequence and I tap somewhere else it triggers the appearance immediately. That made me feel like a main thread issue, but I can't find anywhere I get off track.
I found prepareForSegue was missing a super call, but adding it, or commenting entirely has no bearing. Happens regardless of if the Segue kind is Modal or Custom; if it has a custom class or not, if animates is enabled
Sometimes it feels like taps are being dropped entirely (The dismiss button feels especially random).

Why popover segue taking lot of time for the First time?

I've an application where one HomeViewController triggers the popover segue so that destinationView controller may appear as a popover View controller. Everything is fine and destinationView Controllers is opening as popover View controller.
But the problem is when I First touch the button, its taking lot of time to open destinationViewController. and later after that second touch onwards on its opening faster just on touch. why so ?
The answer mostly lies in your code itself.
My guess is you are making some network call or data processing on main thread making UI responsiveness hit. You are probably caching the massaged data and using it second tap onwards.
You can fix this by putting break point and understanding the implementation line by line.

iOS UISearchBar delay in showing keyboard after calling becomeFirstResponder - iOS7

I have a UISearchBar which is an IBOutlet. Tapping on the search bar or calling [searchBar becomeFirstResponder] in viewDidAppear results in a few seconds delay where the UI is locked before the keyboard appears.
I've looked at this in Instruments, and there is a CPU usage spike when becomeFirstResponder is called, but I'm not sure how I can narrow this down to a method / bunch of methods within the spike.
The view controller is not doing anything blocking, and there is nothing else running on the main thread (as far as I can see). This only happens the first time after calling becomeFirstResponder or tapping on the search bar. It does not happen again once the keyboard has been dismissed.
Any help would be much appreciated, as I can't see what's wrong really.
This is all running on iOS7, on iPhone and iPad BTW.

UITextFields intermittently not allowing user interaction

I know it's a very long shot and the problem description is vague at best, but I'm hoping someone might have encountered that as well.
I have a UIViewController subclass that is being presented modally. The view of the controller contains some UIButtons and some UITextFields. The view controller might be presented multiple times during a user session; it is created every time it's presented and gets destroyed when it's dismissed. Most of the time everything works as expected, however, sometimes the text fields don't respond to user touch, i.e. tapping them does not bring up the keyboard. The buttons on the view work fine, it's just the text fields that become disabled.
What could possibly be causing this?
Turns out the reason UITextFields inside a modally presented view controller were not responding was that one of the long-living view controllers in the app called [self becomeFirstResponder] on itself, but never called [self resignFirstResponder]. It had to be the first responder in order for it to receive remote controls events when the app was playing music.

Resources