Disable Long Press back Button (callout menu) [duplicate] - ios

This question already has answers here:
Is it possible to disable the back navigation menu in iOS 14+?
(5 answers)
Closed 2 years ago.
iOS14 introduced that long-press on back button which opens a callout menu to go back to specific VC in stack.
I would like to disable it, is there a possibility to do such a thing, and if yes how ?
Thanks

Try to set backButtonDisplayMode to .minimal on your VC ->
if #available(iOS 14.0, *) {
navigationItem.backButtonDisplayMode = .minimal
}
https://developer.apple.com/documentation/uikit/uinavigationitem/3656350-backbuttondisplaymode

Related

When I updated the Xcode, in my app, my root view controller can be seen at the top of the current view [duplicate]

This question already has answers here:
Presenting modal in iOS 13 fullscreen
(27 answers)
Closed 3 years ago.
So when I drag it down the app will dismiss the current view an go to there. I don't want it, how should I fix it? Everything was okay till update
In iOS 13, the default modal presentation is sheet, which is what you got.
To get the old modal style, do:
loginVC.modalPresentationStyle = .currentContext
In the iOS 13 SDK the color handling changed crucially due to the introduction of Dark Mode.
Set the background color of the current view to System Background color.
And consider that all modally presented view controllers are presented as sheet by default.

Prevent view controller from stacking IOS 13 (swift) [duplicate]

This question already has answers here:
Presenting modal in iOS 13 fullscreen
(27 answers)
Closed 3 years ago.
I am working on an app and recently updated to my Xcode. With this update the way view controllers are presented is changed and I want to revert it back to its old ways. They used to display over the other ones but now they "stack".
I would like the iPhone on the left, while what I currently have is the iPhone on the right.
Thanks.
You just need to change presented view controller modalPresentationStyle to full screen.
let myModalController = MyModalController()
myModalController.modalPresentationStyle = .overFullScreen
self.present(myModalController, animated: true, completion: nil)

Setting text field as first responder on app launch in Swift iOS [duplicate]

This question already has an answer here:
How can I force my keyboard to be up on my program's start in Swift?
(1 answer)
Closed 4 years ago.
I have a simple app with a couple text entry fields. When I launch the app, nothing happens until I tap a field or use a control. How do I set the focus to be on the first text field and open the keyboard when the app launches, saving the user a tap? (new to swift - is this setting the first responder? - not sure how that works)
in viewWillAppear/viewDidAppear do
#IBOutlet weak var firstTexF:UITextField!
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
firstTexF.becomeFirstResponder()
}
Agreed with #Sh_Khan's answer,
Just verify one more thing to disable the hardware keyboard. You'll need to toggle your keyboard through ⌘K or through below steps,
iOS Simulator -> Hardware -> Keyboard
Uncheck Connect Hardware Keyboard

Drag UIKeyboard to hide [duplicate]

This question already has answers here:
iMessage Style Receding Keyboard in an iOS App
(3 answers)
Closed 8 years ago.
I wonder how to prepare similar functionality to Skype app, which allow user down drag UITableVIew to hide in live mode UIKeyboard.
Do you have any suggestions to resolve this issue, or maybe have used before of some cocopods?
As of iOS 7, this functionality has been built into the UIScrollView class
Choose whichever of these fits your needs best.
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
If however you want to achieve this in an older iOS version, you can't do anything interactive, but you can use the UIScrollViewDelegate method scrollViewWillBeginDragging: to dismiss the keyboard when the user starts scrolling.

Cancel and Clear button behaving differently in iOS 6 and iOS 7 [duplicate]

This question already has answers here:
UISearchBar's Cancel and Clear Buttons Not Working in iOS 7
(6 answers)
Closed 8 years ago.
In iOS 6 the Cancel and Clear button in UISearchBar work with single click but in iOS 7 it takes long tap and hold to get them work. I am confused why is it so?
I want those buttons to work with a single click in iOS 7 as well.
Maybe have a view(or something else) overlap this Cancel/Clear button. Or it's not have the right frame. So it's just work when you tap on the right position and this behavior make user confuse and they think those button not work.
My Bad.
In one of the implementation files a category was written on UIButton purposefully. See code below:
#implementation UIButton(PassTapGesture)
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
return YES;
}
#end
I just removed above code and everything is charm in iOS 7 too. Still I am confused that with the same code why it was working in iOS 6.

Resources