UIAlertController's actionSheet gives constraint error on iOS 12.2 / 12.3 [duplicate]Swift default AlertViewController breaking constraintsUIAlertView's action sheet didn't separating cancel button from others in IOS 12.2Runtime Exception coming when show UIAlertController(actionsheet) iOS8Presenting UIAlertController ActionSheet in popover on iPhoneActionSheet Source View BarButtonItemActionSheet crash on iPad (camera button)UIAlertController ActionSheet Which Triggers A 2nd ActionSheetAttempt to present alertcontroller whose view is not in window hierarchyActionSheet lagsinputAccessoryView animating down when alertController (actionSheet) presentedWhat's the difference between preferredStyle: .alert and preferredStyle: .actionSheet?How to edit UIAlertController of type .actionSheet (font, background color)

What's this thing in a peltier cooler?

As a 16 year old, how can I keep my money safe from my mother?

What is my malfunctioning AI harvesting from humans?

How quickly could a country build a tall concrete wall around a city?

Acceptable to cut steak before searing?

How should an administrative assistant reply to student addressing them as "Professor" or "Doctor"?

What are good ways to improve as a writer other than writing courses?

What does Apple mean by "This may decrease battery life"?

Does this Foo machine halt?

How can I iterate this process?

Max Order of an Isogeny Class of Rational Elliptic Curves is 8?

Why should we care about syntactic proofs if we can show semantically that statements are true?

How do Mogwai reproduce?

I was asked to prove the Principle of Cauchy Induction

How to mark beverage cans in a cooler for a blind person?

If a Contingency spell has been cast on a creature, does the Simulacrum spell transfer the contingent spell to its duplicate?

show stdout containing n with line breaks

Is refreshing multiple times a test case for web applications?

Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?

Looking for a new job because of relocation - is it okay to tell the real reason?

Team goes to lunch frequently, I do intermittent fasting but still want to socialize

How do I calculate the difference in lens reach between a superzoom compact and a DSLR zoom lens?

Does a code snippet compile? Or does it get compiled?

Trying to create a folder with date and time with a space



UIAlertController's actionSheet gives constraint error on iOS 12.2 / 12.3 [duplicate]


Swift default AlertViewController breaking constraintsUIAlertView's action sheet didn't separating cancel button from others in IOS 12.2Runtime Exception coming when show UIAlertController(actionsheet) iOS8Presenting UIAlertController ActionSheet in popover on iPhoneActionSheet Source View BarButtonItemActionSheet crash on iPad (camera button)UIAlertController ActionSheet Which Triggers A 2nd ActionSheetAttempt to present alertcontroller whose view is not in window hierarchyActionSheet lagsinputAccessoryView animating down when alertController (actionSheet) presentedWhat's the difference between preferredStyle: .alert and preferredStyle: .actionSheet?How to edit UIAlertController of type .actionSheet (font, background color)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








35
















This question already has an answer here:



  • Swift default AlertViewController breaking constraints

    1 answer



On iOS 12.2. while using UIAlertController's actionSheet Xcode, gives constraint error anyone having this problem



This same code runs on iOS 12.1 with no error



I have tested this code on Xcode 10.2 and 10.1



class ViewController: UIViewController 

let Click : UIButton =
let button = UIButton(type: UIButton.ButtonType.system)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("OK", for: .normal)
button.tintColor = UIColor.blue
button.addTarget(self, action: #selector(click(_:)), for: UIControl.Event.touchUpInside)
return button
()

override func viewDidLoad()
super.viewDidLoad()
view.addSubview(Click)
Click.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Click.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true



@objc func click(_ sender: UIButton)
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)





[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>


PS:



Just to make sure that the problem is on UIAlertController I remove everything and update the code as below but same error.



class ViewController: UIViewController 
override func viewDidLoad()
super.viewDidLoad()


override func viewDidAppear(_ animated: Bool)
super.viewDidAppear(animated)

let optionMenu = UIAlertController(title: "Test", message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)












share|improve this question
















marked as duplicate by Baum mit Augen Jun 13 at 21:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • i've tested your code, it runs perfectly. can you provide an actual screen shot

    – Sanad Barjawi
    Mar 27 at 8:05






  • 3





    suppose that its the 12.2 update issue then

    – Sanad Barjawi
    Mar 27 at 10:27






  • 5





    I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

    – Becky Hansmeyer
    Mar 29 at 19:44






  • 1





    Same issue with 12.2. 12.1 doesn't have this problem.

    – Alexey Chekanov
    Apr 7 at 23:59






  • 1





    Even with 12.3 as well, XCode 10.2.1

    – Rajan Maheshwari
    May 27 at 11:03


















35
















This question already has an answer here:



  • Swift default AlertViewController breaking constraints

    1 answer



On iOS 12.2. while using UIAlertController's actionSheet Xcode, gives constraint error anyone having this problem



This same code runs on iOS 12.1 with no error



I have tested this code on Xcode 10.2 and 10.1



class ViewController: UIViewController 

let Click : UIButton =
let button = UIButton(type: UIButton.ButtonType.system)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("OK", for: .normal)
button.tintColor = UIColor.blue
button.addTarget(self, action: #selector(click(_:)), for: UIControl.Event.touchUpInside)
return button
()

override func viewDidLoad()
super.viewDidLoad()
view.addSubview(Click)
Click.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Click.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true



@objc func click(_ sender: UIButton)
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)





[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>


PS:



Just to make sure that the problem is on UIAlertController I remove everything and update the code as below but same error.



class ViewController: UIViewController 
override func viewDidLoad()
super.viewDidLoad()


override func viewDidAppear(_ animated: Bool)
super.viewDidAppear(animated)

let optionMenu = UIAlertController(title: "Test", message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)












share|improve this question
















marked as duplicate by Baum mit Augen Jun 13 at 21:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • i've tested your code, it runs perfectly. can you provide an actual screen shot

    – Sanad Barjawi
    Mar 27 at 8:05






  • 3





    suppose that its the 12.2 update issue then

    – Sanad Barjawi
    Mar 27 at 10:27






  • 5





    I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

    – Becky Hansmeyer
    Mar 29 at 19:44






  • 1





    Same issue with 12.2. 12.1 doesn't have this problem.

    – Alexey Chekanov
    Apr 7 at 23:59






  • 1





    Even with 12.3 as well, XCode 10.2.1

    – Rajan Maheshwari
    May 27 at 11:03














35












35








35


13







This question already has an answer here:



  • Swift default AlertViewController breaking constraints

    1 answer



On iOS 12.2. while using UIAlertController's actionSheet Xcode, gives constraint error anyone having this problem



This same code runs on iOS 12.1 with no error



I have tested this code on Xcode 10.2 and 10.1



class ViewController: UIViewController 

let Click : UIButton =
let button = UIButton(type: UIButton.ButtonType.system)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("OK", for: .normal)
button.tintColor = UIColor.blue
button.addTarget(self, action: #selector(click(_:)), for: UIControl.Event.touchUpInside)
return button
()

override func viewDidLoad()
super.viewDidLoad()
view.addSubview(Click)
Click.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Click.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true



@objc func click(_ sender: UIButton)
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)





[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>


PS:



Just to make sure that the problem is on UIAlertController I remove everything and update the code as below but same error.



class ViewController: UIViewController 
override func viewDidLoad()
super.viewDidLoad()


override func viewDidAppear(_ animated: Bool)
super.viewDidAppear(animated)

let optionMenu = UIAlertController(title: "Test", message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)












share|improve this question

















This question already has an answer here:



  • Swift default AlertViewController breaking constraints

    1 answer



On iOS 12.2. while using UIAlertController's actionSheet Xcode, gives constraint error anyone having this problem



This same code runs on iOS 12.1 with no error



I have tested this code on Xcode 10.2 and 10.1



class ViewController: UIViewController 

let Click : UIButton =
let button = UIButton(type: UIButton.ButtonType.system)
button.translatesAutoresizingMaskIntoConstraints = false
button.setTitle("OK", for: .normal)
button.tintColor = UIColor.blue
button.addTarget(self, action: #selector(click(_:)), for: UIControl.Event.touchUpInside)
return button
()

override func viewDidLoad()
super.viewDidLoad()
view.addSubview(Click)
Click.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
Click.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true



@objc func click(_ sender: UIButton)
let optionMenu = UIAlertController(title: nil, message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)





[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>"
)

Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x6000001b6ee0 UIView:0x7fe3b6513020.width == - 16 (active)>


PS:



Just to make sure that the problem is on UIAlertController I remove everything and update the code as below but same error.



class ViewController: UIViewController 
override func viewDidLoad()
super.viewDidLoad()


override func viewDidAppear(_ animated: Bool)
super.viewDidAppear(animated)

let optionMenu = UIAlertController(title: "Test", message: "Choose Option", preferredStyle: .actionSheet)

let deleteAction = UIAlertAction(title: "Delete", style: .default)
let saveAction = UIAlertAction(title: "Save", style: .default)

let cancelAction = UIAlertAction(title: "Cancel", style: .cancel)

optionMenu.addAction(deleteAction)
optionMenu.addAction(saveAction)
optionMenu.addAction(cancelAction)

self.present(optionMenu, animated: true, completion: nil)







This question already has an answer here:



  • Swift default AlertViewController breaking constraints

    1 answer







uialertcontroller swift5






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 27 at 11:04









Rajan Maheshwari

11k3 gold badges49 silver badges81 bronze badges




11k3 gold badges49 silver badges81 bronze badges










asked Mar 27 at 7:45









L03nL03n

2163 silver badges10 bronze badges




2163 silver badges10 bronze badges





marked as duplicate by Baum mit Augen Jun 13 at 21:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.











marked as duplicate by Baum mit Augen Jun 13 at 21:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Baum mit Augen Jun 13 at 21:09


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • i've tested your code, it runs perfectly. can you provide an actual screen shot

    – Sanad Barjawi
    Mar 27 at 8:05






  • 3





    suppose that its the 12.2 update issue then

    – Sanad Barjawi
    Mar 27 at 10:27






  • 5





    I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

    – Becky Hansmeyer
    Mar 29 at 19:44






  • 1





    Same issue with 12.2. 12.1 doesn't have this problem.

    – Alexey Chekanov
    Apr 7 at 23:59






  • 1





    Even with 12.3 as well, XCode 10.2.1

    – Rajan Maheshwari
    May 27 at 11:03


















  • i've tested your code, it runs perfectly. can you provide an actual screen shot

    – Sanad Barjawi
    Mar 27 at 8:05






  • 3





    suppose that its the 12.2 update issue then

    – Sanad Barjawi
    Mar 27 at 10:27






  • 5





    I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

    – Becky Hansmeyer
    Mar 29 at 19:44






  • 1





    Same issue with 12.2. 12.1 doesn't have this problem.

    – Alexey Chekanov
    Apr 7 at 23:59






  • 1





    Even with 12.3 as well, XCode 10.2.1

    – Rajan Maheshwari
    May 27 at 11:03

















i've tested your code, it runs perfectly. can you provide an actual screen shot

– Sanad Barjawi
Mar 27 at 8:05





i've tested your code, it runs perfectly. can you provide an actual screen shot

– Sanad Barjawi
Mar 27 at 8:05




3




3





suppose that its the 12.2 update issue then

– Sanad Barjawi
Mar 27 at 10:27





suppose that its the 12.2 update issue then

– Sanad Barjawi
Mar 27 at 10:27




5




5





I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

– Becky Hansmeyer
Mar 29 at 19:44





I'm experiencing this same problem in Xcode 10.2 running iOS 12.2--guessing it's a bug! I'm planning to just ignore it.

– Becky Hansmeyer
Mar 29 at 19:44




1




1





Same issue with 12.2. 12.1 doesn't have this problem.

– Alexey Chekanov
Apr 7 at 23:59





Same issue with 12.2. 12.1 doesn't have this problem.

– Alexey Chekanov
Apr 7 at 23:59




1




1





Even with 12.3 as well, XCode 10.2.1

– Rajan Maheshwari
May 27 at 11:03






Even with 12.3 as well, XCode 10.2.1

– Rajan Maheshwari
May 27 at 11:03













1 Answer
1






active

oldest

votes


















8














It's a new bug in iOS versions:



  • 12.2

  • 12.3

  • 12.4

  • 13 beta 2

The only thing we can do is to file a bug report to Apple (just did that).



I'll try to update answer for a new version(s) of iOS when it come out.






share|improve this answer






















  • 2





    The bug continues in iOS 13 beta 2.

    – nugae
    Jun 27 at 9:05














1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









8














It's a new bug in iOS versions:



  • 12.2

  • 12.3

  • 12.4

  • 13 beta 2

The only thing we can do is to file a bug report to Apple (just did that).



I'll try to update answer for a new version(s) of iOS when it come out.






share|improve this answer






















  • 2





    The bug continues in iOS 13 beta 2.

    – nugae
    Jun 27 at 9:05















8














It's a new bug in iOS versions:



  • 12.2

  • 12.3

  • 12.4

  • 13 beta 2

The only thing we can do is to file a bug report to Apple (just did that).



I'll try to update answer for a new version(s) of iOS when it come out.






share|improve this answer






















  • 2





    The bug continues in iOS 13 beta 2.

    – nugae
    Jun 27 at 9:05













8












8








8







It's a new bug in iOS versions:



  • 12.2

  • 12.3

  • 12.4

  • 13 beta 2

The only thing we can do is to file a bug report to Apple (just did that).



I'll try to update answer for a new version(s) of iOS when it come out.






share|improve this answer















It's a new bug in iOS versions:



  • 12.2

  • 12.3

  • 12.4

  • 13 beta 2

The only thing we can do is to file a bug report to Apple (just did that).



I'll try to update answer for a new version(s) of iOS when it come out.







share|improve this answer














share|improve this answer



share|improve this answer








edited Jul 25 at 13:29

























answered Jun 2 at 22:48









Andrei KonstantinovAndrei Konstantinov

3,3852 gold badges24 silver badges48 bronze badges




3,3852 gold badges24 silver badges48 bronze badges










  • 2





    The bug continues in iOS 13 beta 2.

    – nugae
    Jun 27 at 9:05












  • 2





    The bug continues in iOS 13 beta 2.

    – nugae
    Jun 27 at 9:05







2




2





The bug continues in iOS 13 beta 2.

– nugae
Jun 27 at 9:05





The bug continues in iOS 13 beta 2.

– nugae
Jun 27 at 9:05








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.





Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript