Closed acegreen closed 8 years ago
More info: Ended up having to calculate my starButton center by converting it first.
let center = starButton.superview!.convertPoint(starButton.center, toView: self.view)
transition.startingPoint = center
Now the bubble starts from the button. But there is still the first time lag.
It might be related to what your view is loading. Is there by any chance a mapkit object inside? I always notice a considerable lag the first time I load a map view.
Yea I know what you mean. Had that before but my current segue is super simple and the VC is basically empty. Also the segue perform perfectly from the second time onwards. It's only the first time that it needs to think for a little.
Also I got the whole idea from another project and in that project there is no lag the first time around. Also nowhere else is there a lag to find in my project except with that one button segue.
So if you remove the custom transition and use the basic modal, the lag disappears?
Let me try that.
device update to iOS 9.2 overnight so give me 5 minutes.
@andreamazz i removed the transition by removing the code in PrepareForSegue but seems to also be a lag there the first time.
It shouldn't be related to the bubble then. Time to fire up the time profiler :grin:
He issue is described here exactly as I'm seeing it: http://stackoverflow.com/questions/28509252/performseguewithidentifier-very-slow-when-segue-is-modal
I perform the segue on storyboard so how according to the solution I would need to perform the segue programmatically and use dispatch.
What do you think?
Might be worth a try, still it's pretty weird, I never encountered this issue.
Doesn't work for me. I'm really surprised but this
Did you try to profile it?
Never really played around with instruments or the other tools.
Always a good time to start :)
It's pretty easy for basic forensics, pick the time profiler, start recording, trigger the segue and stop the recording. Then you can drill down in the list of calls to see which one takes the most time.
Just took a shot at it. every time I hit record, my Xcode crashes with thread 1 error
NVM Xcode session shouldn't be running
Awesome. Try launching instruments on its own and attach it to the running process on your phone.
Ok did that and performed the segue and stopped. Now I see stuff I need translated
You should see the calls tack with the time it took for each stack. Drill down and check which func takes the most percentage.
Ok I see 73% on the main thread
Keep opening the disclosure triangle until you reach a func call that you can recognize (either from UIKit or your code)
Ah this is just not for me. I rather go at it the old fashion way.
Do you happen to have 5 minutes to Skype?
I can't read through this at all
@andreamazz
Ahh I knew it was going to be something super trivial. So as mentioned, I took some stuff from another project and forgot one small thing. In my VC I'm using a custom font that I didnt have as a system font or in my project bundle.
So it seems its an Apple glitch because it resorts to System font but takes longer on first segue. Adding the fonts to the bundle, solves the issue.
Good to know :+1:
Hello @andreamazz ,
First of thanks for the great work. Library works awesome.
I'm not sure if my problem is directly linked to bubbleTransition, but I'm noticing a lag on the FIRST button press. From there on after, its smooth as butter.
Note: The startingPoint is incorrect because it appears somewhere on the top though I don't think its CGPointZero but a little under the navigation bar and centered horizontally. This is weird because I specified it as below and that button is at the bottom of the screen. I'm not sure if the button lagged without bubbleTransition.
I create the segue using storyboard and just do:
extension ViewController: UIViewControllerTransitioningDelegate {
}