Standard show segue animation - ios

I'm pretty new to iOS and created a standard show detail segue. Now it works but the result is a bit choppy. I navigate from a UITableViewController to a ViewController but the animation kind of just 'keeps hanging' half way trough.
I've tried making a screen cap of it:
But since the capturing software is also a bit crappy the entire .gif is choppy.
The choppiness occurs about halfway trough the animation and continues just a moment after. Is this standard behavior? Or am I doing something wrong?
The navigation is as follows:
From UITableViewController - Show (e.g. push) segue -> UIViewController

Looks same as in this question While pushing a viewcontroller there is a jerk in animation Unfortunately, it not solved yet. Pretty sure this can be simulator issue\bug. I had same issue with collectionView scrolling (lags on simulator) but it works well on device (even on slow one).

Related

Weird UIViewController hidesBottomBarWhenPushed layout bug that only occurs the very first time a view controller is pushed

I'm really at a loss with this one, especially considering it has previously been working fine and I can't find anything in my commits that would have broken it.
I have a UITabBarController as the master view of a UISplitViewController. Each tab in the UITabBarController has its own UINavigationController that manages a stack of child VCs.
The issue is that any child VCs that have hidesBottomBarWhenPushed set to true results in a glitchy transition, but only the very first time any UINavigationController push occurs.
Here is a video of the transition bug
As you can see, it appears as if the safe area is collapsing on transition (and indeed, this does not occur on iPad or any other iPhone that lacks a bottom safeAreaInset. Yet, on the second (and all subsequent) push, it behaves perfectly fine.
The only thing I can think of is that I'm implementing the UISplitViewControllerDelegate methods to ensure Show Detail segues occur as a push rather than a modal when on the iPhone. However, the issue still happens with a regular push (bypassing the delegate methods altogether).
The various view controllers are all the standard base classes with no overridden layout behaviour, and I'm not implementing any custom transitions or transition coordinators.
Any thoughts on what the issue might be would be greatly appreciated.
So I managed to fix it. I was performing a modal segue before the UITabBarController was coming on screen. Apparently that messes up the layout, as I was able to confirm via a minimal replication. Changing the segue presentation type to "over full screen" rather than "default" stops the underlying UITabBarController from being removed from the view hierarchy and fixes the issue.
While that's six hours of my life I'll never get back I hope it helps someone in future.

Presenting a specific view controller messes up the app on device (works on simulator)

I'm facing a very weird bug. I have a button and I'm pushing a view controller normally, using segues. However, when I push the view controller the whole app layout messes up: it sometimes works, sometimes glitches such as leaving me with a blank view with nothing but the tabbar, or previous view controller still being seen but transformed to somewhere else in the screen etc. If I manage to go back, it always works fine after the first try. Here are some observations:
Problem is specific to device (iPhone X). Simulator (even the same model and same OS version) works perfectly.
Switching to modal doesn't matter. The "glitchy look" animates a bit different, but the problem is still there.
Turning off animation in transition doesn't matter. It presents me a glitchy screen instantly, just without animation.
Pushing/presenting the view controller from code (as opposed to storyboard segue) doesn't matter. Exactly same.
Giving a delay (e.g. half second) after tapping the button before presenting the view controller doesn't change anything. Just wanted to try this to see if some race condition is present on tap, for whatever reason.
The problem is specific to one view controller. Presenting anything else at the same segue/state doesn't cause any problem.
The problematic view controller doesn't have anything special at all: It's actually just a wrapper with three child view controllers, something I commonly do:
When I'm trying to present the problematic controller, I'm always getting this weird log: [Render] CoreAnimation: failed to allocate 1223558576 bytes
My application is definitely not out of memory. It's using ~50MB on iPhone X at the time of problem. It's a media app and can allocate ~500MB with no issues or crashes when shooting/filtering video etc.
The problem occurs if a specific embedded view controller (the second one of three) is present. For example, if I remove the embed segue to that, it seems to run perfectly.
That embedded view controller is a simple UIViewController subclass that just has a table view and some cells.
What might be going on?

iOS 10 - NavigationController, view not being hide completely on dismiss

I'm developing an iOS 10 app using NavigationController and Storyboards. I'm having a difficult time to figure out whats going on with a strange - as I'm calling it - bug:
When I navigate to a new ViewController, it show's nicely, but when the app unwind a segue, the top view controller doesn't go all the way to the right, instead, it left's about 50 points on screen, and then suddenly it goes away...
I'm putting a image that illustrates what I'm talking about...
PS: both ViewControllers uses UIImageView as background...
Thanks a lot!
Please share the code where you are setting the fame for the view(s). It could possibly be an offset that is being added. Though, you do mention that it does go away suddenly, so it could be something else.

UIPageViewController duplicates first ViewController behind PageViewController for iOS 10 but behaves normally with a white background for iOS 9.3

I followed this tutorial to create a PageViewController and it works perfectly when I run it on an iOS 9.3 emulator device. However, when I run it on an iOS 10.0 emulator device, it duplicates the first view controller behind the pageViewController - so that when you scroll left on the first slide, you can see the initial viewController peeking out from behind it, and similarly when you scroll right on the last viewController, you can see that same first viewController peek out from behind that too. On the iOS 9.3 device, there is just a white background.
Additional information:
I'm using the UIPageViewControllerTransitionStyleScroll so there is that 'bounce' effect (which is where you can see the white on iOS 9.3 and the duplicated viewController on iOS 10)
I cannot use another transition style (as some other solutions suggest just using a 'curl' transition)
I've already tried UIPageViewController memory leak (see solution by specialvict in that post)
Just to be clear, I want a white background behind the pageViewController so that when you scroll left on the first slide or right on the last one, you see just white.
Found the solution. The function used to create and setup the viewController and its subviews were standard and had nothing significantly different to the code from the tutorial above. The problem I had was that I called this function in viewDidLayoutSubviews without checking if the containerView was not perhaps already initialised (containerView being the view that I add the pageController to).
To check out what is happening, I print a short message to the log when the containerView is initialised. I removed the check if (!self.containerView) and iOS 9 only initialises the containerView once whilst iOS 10 initialises twice. Thus, adding the check if (!self.containerView) before initialising the containerView fixes this problem for 10.

Top half of UINavigationBar on iOS6 not responding to taps

I'm working on an iPhone app and have the strangest issue.
On iOS 6, buttons on the navigation bar are completely ignoring taps in the top half. Have a look at the image below, I have roughly selected tap areas of my navbar buttons:
https://www.dropbox.com/s/izs6ic5jlubm1yk/navtap_problem.png
Here's some, potentially useful, information:
the app supports iOS 6 and 7
the app is not using autolayout (working with deltas instead)
this issue is present only on iOS 6, it's working fine on iOS 7
the issue is present in all views across the app (that have a navigation bar on top)
the issue present in both navigation bars that are manually added in IB as well as in navigation bars that are coming from the UINavigationController
the problem is not present if I directly start the app from one of affected view controllers
the problem is present when I start the app through my empty InitialViewController and load another VC
I'm using ECSlidingViewController and loading the real VC (that users will see) from the InitialViewController like this:
self.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:#"SearchSplitViewNavigationController"];
[self resetTopView];
It looks like something invisible is covering the top half of the navigation screen. I checked the contents of self.view.subviews, but didn't see anything there.
Any ideas what might be causing this? Or what else could I check?
If you are including any element programmatically, then that element isn't using the deltas you are including through the storyboard.
For these elements you must test for the iOS version you're in and adjust the delta in code.
Check this: Best Way to check for iOS 7 or earlier? for help on the version checking.
I've found a solution (not the cause though). This awesome library helped me a lot to identify the problem.
There was actually a transparent UIView sitting on top of my navigation bars. It was located at 0,20 and had a height of 20 points.
That view is not in the self.view.subviews array, but doing [self.view bringSubviewToFront:myNavigationBar] seems to do the trick...

Resources