Custom keyboard appears with ~5seconds delay - ios

I'm making custom keyboard with obj-c, Xcode 7 (tried 6 too). The issue is that keyboard is loading too slow.
I tried to load completely empty UIInputViewController's view - no changes. I have no xibs, no heavy resources. Please if someone know any solution of this problem, write an answer. user won't be glad to wait every time keyboard lags.

It's a known issue that the keyboard (custom or not) may load slowly the first time it's opened after the app launch.
It happens only in debug mode and should not happen on a release build thanks to the high optimization level.

Related

iOS debugging with instruments - lag in real device

I am using Instruments (for the first time) as I am trying to debug a lag time arising on a real device but not on the simulator. I have collected some data but I am stuck now since I don't know very well how to interpret them.
Briefly, when I try to present a presentationController in my app I am faced with a lag time (about 5 sec) before the UIView appears on screen. I want to display a UITextView with attributed text. I registered the process with Instruments and here is what I can see (4 figures):
All I have understood so far is that there is maybe a problem with Core Graphics and Font. Could anyone help me to figure out what is going wrong and how I could get rid of this problem? I can give more code if needed.
EDIT:
This is what I obtained when applying the advice given, but I can still not figure out how I can refer those lines to my code.
You want to click these check boxes at the bottom of the time profiler:
from:
http://imgur.com/j0anIdf
to:
http://imgur.com/8PFU5VX
Now you should see your calls rather than all calls

iOS Swift 2.0 UITextView freezes app depending on text

I'm experiencing a weird issue with my Swift 2.0 app.
I have a (editable) UITextView defined in my storyboard.
If I leave the text property empty in the storyboard everything is working as expected. But when I enter the text Kaasje (in the storyboard and recompiling), the app freezes when loading the nib (navigating through segue) and the CPU jumps to 100% (the app remains stuck).
The app will never reach viewDidLoad at this point.
It makes no difference when changing between fonts or fontsizes, behavior remains.
Pausing in Xcode does not leave me with anything useful, the main thread is busy without specifying any function. Nothing is logged to output nor any logs are created.
I'm running iOS9 on a iPad Air, the app has a built target of iOS8 and runs landscape-only.
Has anyone ever experienced anything like this before, and might have an explanation for this behaviour?
As far as my assumptions: Something goes wrong when calculating the text-size which results in a infinite loop while either calculating the size or adjusting the frame.
P.S. It happens with other texts too, but "Kaasje" always fails. It seems to fail when the the text is only 1 line. Longer texts tend to succeed aswel as leaving it empty.
As suggested in the comments there seems to be a bug in Xcode 7 in combination with iOS9.
I ended up recreating the entire view, the problem did not occur again.

iPhone app Debug Is very fast but (Adhoc and appstore) Release is very slow

Does anyone know of any potential causes of chuggy slowness through out an iPhone app, as a result of some kind of config or third party library in the release version of an app?
I have libTestFlight, libGoogleAnalytics, libBlitFeedback, MKNetwork as well as Bolts, NewRelic, Parse and the Facebook SDK... everything else is a standard iOS SDK library.
When I build for Debug, she runs lightning fast... I simply change to 'archive' and release the app on test flight and walah it runs like a piece of crap.
I use images heavily which are all generally loaded by using "UIImageView+WebCache.h" and the SDWebImage package https://github.com/rs/SDWebImage.
I'm just in the process of elimation at the moment as the app never used to run chuggy, but I made a lot of changes in the space of a week which were all intended to make the app smoother and faster.
An example use case is:
User opens App.
Table View loads cells with images and text.
Network call updates data.
User taps tab bar to change to a UICollectionViewController. It reloads.
User taps Profile VC, it refreshes some data.
In Debug... this use case is lightnining fast, transitions smooth and quick on iPhone 4 or 5
In Release mode.. Tapping on the tab bar takes 3 seconds to transition. Scrolling is clunky in the tableview or collection view.
In answer to my own question, the reason was the result of dropping this particular piece of code in my release target.
https://gist.github.com/steipete/5664345
And more precisely this piece of code #define PROPERTY(propName) ##propName:
// Compile-time selector checks.
if DEBUG
define PROPERTY(propName) NSStringFromSelector(#selector(propName))
else
define PROPERTY(propName) ##propName
endif
Was found to be the cause of our problems only discovered by using profiler and realising that it was just soaking up the available CPU cycles. iPhone 4 was so slow it basically was unresponsive.
Anyway, the generic answer is to profile your app to see whats slowing the CPU down.

UIScrollview is Not Scrolling Properly After Application is Entered Background

In my application i have 3 scrollview, once the application is used for long time or application is in background for long time. Scrollview in my application is not scrolling properly and it is responding very slow compare to previously when the application is installed.
I tested the application using instruments but i am not able to find out the real cause of the application. Please help me in this issue?
Hy this is gues work,
without more details one could only take a look into a glas bowl,
based on my experience scrolling has no general problems so it has to be your code which causes this problem.
I could only advise you to check your state, may adding some Log statements to show the state of your scrolling brings more light into the problem?

CoreAnimation stack going crazy

I've been asked to help fix a bug for a client, who is an inexperienced developer. However, I'm absolutely stumped by this one.
The problem is that after a string of opening and closing a view controller, which is being pushed onto a navigation controller, all of the subviews will disappear (including the navigation bar items) and show straight through to the window. After this happens, I can still press the buttons on the navigation bar, but they will immediately disappear on touch-up, and restoring a stable UI state is impossible without a quit & relaunch. Another obscure side effect is that after closing the app, Springboard will flash as I swipe between screens. My initial thoughts were that this was a memory issue (e.g. subviews getting released on memory warning), but I have since cleaned all the leaks & checked all the viewDidLoad/viewDidUnload handling of outlets and the problem is still happening. So now I think that with the Springboard effect, that the code is somehow messing up the state of core animation entirely.
Has anyone seen anything like this before? Or have any idea how it would be possible to make this much of a mess? I would attach some screenshots, but trying to take a screenshot with the phone when the app is in this state causes a system crash.
I've not experienced this, but maybe a memory warning is eating some of your views?
I know that iOS is free to unload view controllers that aren't visible.
I'd stick a breakpoint in viewdidunload or similar and see if that triggers.
As it turned out, this bug was caused by a UIView being deallocated while it had a superview.

Resources