UINavigationController's setViewControllers adds back button in IOS10 - uinavigationcontroller

Noticed strange thing: when you replace view controllers stack in UINavigationController using setViewControllers:animated: back button is displayed during animation and disappears when animation completes. Found only in iOS10 (both device and simulator), iOS8 and 9 work correctly (no back button). Has anybody faced this issue?

Same Problem here but even with animated:false.
I also realized that the memory goes up when I keep repeating. Do they stay in background?
My code:
firstNavigationViewController.setViewControllers([firstRootViewController, secondViewController], animated: false)//
UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.rootViewController = firstNavigationViewController
My workaround is to set the following in viewWillAppear:
navigationController?.navigationBar.backItem?.title = "Protokoll"

Related

Blazor Wasm button disappearing on subsequent Pre-render

I cam across very weird problem.
I was trying check some other issue, but incidentally found this one.
In the video you can see that I can see button rendered from the loop at position 10.
But on subsequent button clicks this button is never re-rendered.
Here I am trying to understand what is going on.
source code at : https://github.com/nssidhu/BlazoredModalIssue
screen recording at : https://1drv.ms/v/s!AtHk7h6Srnk_h_wcGLilnKZPDo_RWA

iOS7 Custom Button Fading with UIActionSheet

I'm running into an issue where for navigation, we have to use a custom back button, which we are matching to iOS7. So we're creating a UIButton with a background image and then setting it as a custom view of a UIBarButtonItem.
The issue is that when an Action sheet is presented by iOS7, the background is faded. However, the custom button does not and it looks mismatched. Question is - is there a property that can be set to provide the image for the faded state? (though this can be done with delegation, I wanted to see if there was a simpler solution before going that route).
I have tried to set a faded image for UIControlStateDisabled, UIControlStateSystem, UIControlStateReserved with no avail.
Screen shot below:
I ended up using delegation. When the action sheet is presented, my controller received a message and switched the button to faded. When action sheet was dismissed, my controller again received a messaged and switched button to normal.
Actionsheet was subclassed here, which is why I had to do this dance.
I have actually resolved this issue without delegation. The solution is to have a png with clear background. So just the blue of the back arrow. In that case, iOS handles the fading and desaturating. If you add background, it will not.

ios7 new pan gesture to go back in navigation stack does not clear tableview selection

I have a Notes-like app: uitableviewcontroller showing up individual notes by pushing them onto navigation stack). And I decided to use an ios7 Back button and a pan gesture recognizer coming with it.
My only modification is removing text from the button by setting navigationItem title of the from-controller to an empty string before pushing the detail-view-controller, as it is advised at https://stackoverflow.com/questions/18870128/ios-7-navigation-bar-custom-back-button-without-title
The button itself works just fine, but when I am going back from my note to the notes table view by means of the pan gesture, tableview selection is not cleaned! The row of the note I've just transitioned from is still shown as a selected one.
Any ideas what could be wrong here?
I've checked the standard Notes app and it works like a charm.
This answer did help me: https://stackoverflow.com/questions/897071/iphone-uitableview-cells-stay-selected
- (void) viewWillAppear:(BOOL)animated {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
[super viewWillAppear:animated];
}
At least for the cases we were seeing this happen, it seems to be fixed in iOS 7.0.4. (We've actually noticed that a number of glitches with the back gesture have been fixed during the 7.0.x releases.)

Swipe to go back in navigation controller on iOS 7

I've been looking through the iOS 7 / UIKIT framework, and although it looks quite different aesthetically it's really the same SDK underneath from what I can see.
My question, is there any extra code that needs to be included to get the draggable behaviour between pushed tableviews/views?
When you push a view onto a UINavigationController you can now drag back to the previous controller from the side rather than pressing the back button.
This behavior can be seen in mail.
How is this achieved, do I need to add any code to add it to my app?
This has nothing to do with UITableView or UITableViewController, but with UINavigationController. And yes, you get this behavior for free as long as the back button is visible.

UINavigationController Layout Broken after Presenting Modal

Ever since iOS5, I have a problem where when I present and then dismiss a modal view, my Navigation Controller bar is hidden underneath the status bar. I have read the forums and tried many things but I cannot find the fix for this behavior.
Also, I get this behavior when presenting any modal view controller so it does not appear to be specific to the view controller I am presenting. At first I thought it was a problem with ZXing but this seems to be generic with the iOS5 update.
Additionally, if I select a UITextField after dismissing the modal and my navigation bar is hidden under the status bar, the keyboard comes up misplaced in my window. Again, if I do a rotate back and forth, the navigation controller bar and the keyboard work just fine.
Any ideas would be appreciated.
RESOLVED
OK. I finally found the problem here. Again this only appeared in iOS5 but when my RootViewController launches it holds off on rotations until the animation is done. Once it is done, then it allows rotations again. The problem was that it was returning NO for all aspects (including portrait). The view showed fine but when I would present a modal and return, the view geometry was mangled. Once I changed it to return YES for portrait mode even during animation, the problem went away.
RESOLVED OK. I finally found the problem here. Again this only appeared in iOS5 but when my RootViewController launches it holds off on rotations until the animation is done. Once it is done, then it allows rotations again. The problem was that it was returning NO for all aspects (including portrait). The view showed fine but when I would present a modal and return, the view geometry was mangled. Once I changed it to return YES for portrait mode even during animation, the problem went away.

Resources