Automatic constraints violations in stack view, Swift 2, iOS 9.3, XCode 7 - swift

I couldn't find a similar problem anywhere, so here is my first post: I am working on a swift 2 project for iPhone. I have devised a "settings" screen with embedded stack views:
Layout showing bounds boxes and constraints
So, there is a main "vertical" stack view with two subviews, spaced equally: the top one corresponds to color palette settings, with the following elements:
The window's main label ("Color Scheme")
A slider to change hue (tint), with name label ("Hue")
A switch to toggle color/B&W, with name label ("Color")
A switch to toggle monochrome palette vs "rainbow" palette, with name label ("Rainbow")
An horizontal stack view with 9 subviews, one for each palette color
The bottom view is for weather view settings, and doesn't have any problems.
The main stack view is set up to change from "vertical" to "horizontal" when changing from portrait to landscape orientation:
Landscape orientation layout, showing all bounds boxes and constraints
The storyboard editor shows no constraint error whatsoever in either orientation (all show in blue), but at runtime, when running in the simulator, changing the settings screen orientation to landscape generates multiple "unable to satisfy constraints" errors, although the screen shows and behaves perfectly.
The weird thing, is that the constraint error messages repeat several times, each time trying to recover by breaking constraints within the second stack view! (which are supposed to be handled automatically by the stack view itself). In particular, the system is trying to break multiple "equal bottom" constraints setting the bottoms of different pairs of embedded subviews to equal values. That is, the nine subviews within the second stack view are supposed to have their bottom bounds at the same level (this is imposed by the stack view itself, so I can't modify it in my program). Each time the systems tries this, it fails, so a new error is output to the console, and the system tries to break another "bottom == bottom" constraint within the stack view, with a new failure.
This goes on several times (from 5 to 8 times), until it settles by trying to break the main label ("Color Scheme") vertical size constraint. In view of this final result, I changed the compression priority of the main label vertical size, but I am still getting the errors. Here is a console dump:
2016-04-22 10:06:14.061 Just Now[9468:534833] 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.
(
"<_UILayoutSupportConstraint:0x7fa918c200e0 V:[_UILayoutGuide:0x7fa91f55acf0(44)]>",
"<_UILayoutSupportConstraint:0x7fa91f582a20 V:|-(0)-[_UILayoutGuide:0x7fa91f55acf0] (Names: '|':UIView:0x7fa91f53a530 )>",
"<_UILayoutSupportConstraint:0x7fa91f5c65a0 V:[_UILayoutGuide:0x7fa91f5d2350(0)]>",
"<_UILayoutSupportConstraint:0x7fa918c11a20 _UILayoutGuide:0x7fa91f5d2350.bottom == UIView:0x7fa91f53a530.bottom>",
"<NSLayoutConstraint:0x7fa91f5d7bd0 V:[UISlider:0x7fa91f5d74e0(30)]>",
"<NSLayoutConstraint:0x7fa91f5c5ef0 V:[UILabel:0x7fa91f5c5c90'Color Scheme'(32)]>",
"<NSLayoutConstraint:0x7fa91f5d49d0 V:[UISwitch:0x7fa91f5d4810(31)]>",
"<NSLayoutConstraint:0x7fa91f53e850 V:[UILabel:0x7fa91f511840'Hue'(21)]>",
"<NSLayoutConstraint:0x7fa91f539a00 V:|-(8)-[UILabel:0x7fa91f5c5c90'Color Scheme'] (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539af0 V:[UILabel:0x7fa91f5c5c90'Color Scheme']-(5)-[UILabel:0x7fa91f511840'Hue']>",
"<NSLayoutConstraint:0x7fa91f539b40 V:[UILabel:0x7fa91f511840'Hue']-(8)-[UISlider:0x7fa91f5d74e0]>",
"<NSLayoutConstraint:0x7fa91f539dc0 V:[UISwitch:0x7fa91f5d4810]-(19)-[UIStackView:0x7fa91f5c6650]>",
"<NSLayoutConstraint:0x7fa91f539e10 V:[UIStackView:0x7fa91f5c6650]-(8)-| (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539f50 V:[UISlider:0x7fa91f5d74e0]-(37)-[UISwitch:0x7fa91f5d4810]>",
"<NSLayoutConstraint:0x7fa91f582f10 V:[_UILayoutGuide:0x7fa91f55acf0]-(0)-[UIStackView:0x7fa91f53a6a0]>",
"<NSLayoutConstraint:0x7fa91f582f60 V:[UIStackView:0x7fa91f53a6a0]-(0)-[_UILayoutGuide:0x7fa91f5d2350]>",
"<NSLayoutConstraint:0x7fa91f41c650 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c67e0.bottom>",
"<NSLayoutConstraint:0x7fa91f417010 'UISV-alignment' UIView:0x7fa91f5c5850.top == UIView:0x7fa91f5c67e0.top>",
"<NSLayoutConstraint:0x7fa91f434df0 'UISV-canvas-connection' UIStackView:0x7fa91f5c6650.top == UIView:0x7fa91f5c5850.top>",
"<NSLayoutConstraint:0x7fa91f40dad0 'UISV-canvas-connection' V:[UIView:0x7fa91f5c5850]-(0)-| (Names: '|':UIStackView:0x7fa91f5c6650 )>",
"<NSLayoutConstraint:0x7fa91ffc1160 'UISV-canvas-connection' UIStackView:0x7fa91f53a6a0.top == UIView:0x7fa91f5c5b00.top>",
"<NSLayoutConstraint:0x7fa9228831e0 'UISV-canvas-connection' V:[UIView:0x7fa91f53a830]-(0)-| (Names: '|':UIStackView:0x7fa91f53a6a0 )>",
"<NSLayoutConstraint:0x7fa921301830 'UISV-fill-equally' UIView:0x7fa91f53a830.height == UIView:0x7fa91f5c5b00.height>",
"<NSLayoutConstraint:0x7fa91ffc15b0 'UISV-spacing' V:[UIView:0x7fa91f5c5b00]-(0)-[UIView:0x7fa91f53a830]>",
"<NSLayoutConstraint:0x7fa91ffb8540 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7fa91f53a530(414)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fa91f41c650 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c67e0.bottom>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-04-22 10:06:14.063 Just Now[9468:534833] 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.
(
"<_UILayoutSupportConstraint:0x7fa918c200e0 V:[_UILayoutGuide:0x7fa91f55acf0(44)]>",
"<_UILayoutSupportConstraint:0x7fa91f582a20 V:|-(0)-[_UILayoutGuide:0x7fa91f55acf0] (Names: '|':UIView:0x7fa91f53a530 )>",
"<_UILayoutSupportConstraint:0x7fa91f5c65a0 V:[_UILayoutGuide:0x7fa91f5d2350(0)]>",
"<_UILayoutSupportConstraint:0x7fa918c11a20 _UILayoutGuide:0x7fa91f5d2350.bottom == UIView:0x7fa91f53a530.bottom>",
"<NSLayoutConstraint:0x7fa91f5d7bd0 V:[UISlider:0x7fa91f5d74e0(30)]>",
"<NSLayoutConstraint:0x7fa91f5c5ef0 V:[UILabel:0x7fa91f5c5c90'Color Scheme'(32)]>",
"<NSLayoutConstraint:0x7fa91f5d49d0 V:[UISwitch:0x7fa91f5d4810(31)]>",
"<NSLayoutConstraint:0x7fa91f53e850 V:[UILabel:0x7fa91f511840'Hue'(21)]>",
"<NSLayoutConstraint:0x7fa91f539a00 V:|-(8)-[UILabel:0x7fa91f5c5c90'Color Scheme'] (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539af0 V:[UILabel:0x7fa91f5c5c90'Color Scheme']-(5)-[UILabel:0x7fa91f511840'Hue']>",
"<NSLayoutConstraint:0x7fa91f539b40 V:[UILabel:0x7fa91f511840'Hue']-(8)-[UISlider:0x7fa91f5d74e0]>",
"<NSLayoutConstraint:0x7fa91f539dc0 V:[UISwitch:0x7fa91f5d4810]-(19)-[UIStackView:0x7fa91f5c6650]>",
"<NSLayoutConstraint:0x7fa91f539e10 V:[UIStackView:0x7fa91f5c6650]-(8)-| (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539f50 V:[UISlider:0x7fa91f5d74e0]-(37)-[UISwitch:0x7fa91f5d4810]>",
"<NSLayoutConstraint:0x7fa91f582f10 V:[_UILayoutGuide:0x7fa91f55acf0]-(0)-[UIStackView:0x7fa91f53a6a0]>",
"<NSLayoutConstraint:0x7fa91f582f60 V:[UIStackView:0x7fa91f53a6a0]-(0)-[_UILayoutGuide:0x7fa91f5d2350]>",
"<NSLayoutConstraint:0x7fa921340700 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c6970.bottom>",
"<NSLayoutConstraint:0x7fa91f417120 'UISV-alignment' UIView:0x7fa91f5c5850.top == UIView:0x7fa91f5c6970.top>",
"<NSLayoutConstraint:0x7fa91f434df0 'UISV-canvas-connection' UIStackView:0x7fa91f5c6650.top == UIView:0x7fa91f5c5850.top>",
"<NSLayoutConstraint:0x7fa91f40dad0 'UISV-canvas-connection' V:[UIView:0x7fa91f5c5850]-(0)-| (Names: '|':UIStackView:0x7fa91f5c6650 )>",
"<NSLayoutConstraint:0x7fa91ffc1160 'UISV-canvas-connection' UIStackView:0x7fa91f53a6a0.top == UIView:0x7fa91f5c5b00.top>",
"<NSLayoutConstraint:0x7fa9228831e0 'UISV-canvas-connection' V:[UIView:0x7fa91f53a830]-(0)-| (Names: '|':UIStackView:0x7fa91f53a6a0 )>",
"<NSLayoutConstraint:0x7fa921301830 'UISV-fill-equally' UIView:0x7fa91f53a830.height == UIView:0x7fa91f5c5b00.height>",
"<NSLayoutConstraint:0x7fa91ffc15b0 'UISV-spacing' V:[UIView:0x7fa91f5c5b00]-(0)-[UIView:0x7fa91f53a830]>",
"<NSLayoutConstraint:0x7fa91ffb8540 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7fa91f53a530(414)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fa921340700 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c6970.bottom>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-04-22 10:06:14.064 Just Now[9468:534833] 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.
(
"<_UILayoutSupportConstraint:0x7fa918c200e0 V:[_UILayoutGuide:0x7fa91f55acf0(44)]>",
"<_UILayoutSupportConstraint:0x7fa91f582a20 V:|-(0)-[_UILayoutGuide:0x7fa91f55acf0] (Names: '|':UIView:0x7fa91f53a530 )>",
"<_UILayoutSupportConstraint:0x7fa91f5c65a0 V:[_UILayoutGuide:0x7fa91f5d2350(0)]>",
"<_UILayoutSupportConstraint:0x7fa918c11a20 _UILayoutGuide:0x7fa91f5d2350.bottom == UIView:0x7fa91f53a530.bottom>",
"<NSLayoutConstraint:0x7fa91f5d7bd0 V:[UISlider:0x7fa91f5d74e0(30)]>",
"<NSLayoutConstraint:0x7fa91f5c5ef0 V:[UILabel:0x7fa91f5c5c90'Color Scheme'(32)]>",
"<NSLayoutConstraint:0x7fa91f5d49d0 V:[UISwitch:0x7fa91f5d4810(31)]>",
"<NSLayoutConstraint:0x7fa91f53e850 V:[UILabel:0x7fa91f511840'Hue'(21)]>",
"<NSLayoutConstraint:0x7fa91f539a00 V:|-(8)-[UILabel:0x7fa91f5c5c90'Color Scheme'] (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539af0 V:[UILabel:0x7fa91f5c5c90'Color Scheme']-(5)-[UILabel:0x7fa91f511840'Hue']>",
"<NSLayoutConstraint:0x7fa91f539b40 V:[UILabel:0x7fa91f511840'Hue']-(8)-[UISlider:0x7fa91f5d74e0]>",
"<NSLayoutConstraint:0x7fa91f539dc0 V:[UISwitch:0x7fa91f5d4810]-(19)-[UIStackView:0x7fa91f5c6650]>",
"<NSLayoutConstraint:0x7fa91f539e10 V:[UIStackView:0x7fa91f5c6650]-(8)-| (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539f50 V:[UISlider:0x7fa91f5d74e0]-(37)-[UISwitch:0x7fa91f5d4810]>",
"<NSLayoutConstraint:0x7fa91f582f10 V:[_UILayoutGuide:0x7fa91f55acf0]-(0)-[UIStackView:0x7fa91f53a6a0]>",
"<NSLayoutConstraint:0x7fa91f582f60 V:[UIStackView:0x7fa91f53a6a0]-(0)-[_UILayoutGuide:0x7fa91f5d2350]>",
"<NSLayoutConstraint:0x7fa921340870 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c6b00.bottom>",
"<NSLayoutConstraint:0x7fa91f4171f0 'UISV-alignment' UIView:0x7fa91f5c5850.top == UIView:0x7fa91f5c6b00.top>",
"<NSLayoutConstraint:0x7fa91f434df0 'UISV-canvas-connection' UIStackView:0x7fa91f5c6650.top == UIView:0x7fa91f5c5850.top>",
"<NSLayoutConstraint:0x7fa91f40dad0 'UISV-canvas-connection' V:[UIView:0x7fa91f5c5850]-(0)-| (Names: '|':UIStackView:0x7fa91f5c6650 )>",
"<NSLayoutConstraint:0x7fa91ffc1160 'UISV-canvas-connection' UIStackView:0x7fa91f53a6a0.top == UIView:0x7fa91f5c5b00.top>",
"<NSLayoutConstraint:0x7fa9228831e0 'UISV-canvas-connection' V:[UIView:0x7fa91f53a830]-(0)-| (Names: '|':UIStackView:0x7fa91f53a6a0 )>",
"<NSLayoutConstraint:0x7fa921301830 'UISV-fill-equally' UIView:0x7fa91f53a830.height == UIView:0x7fa91f5c5b00.height>",
"<NSLayoutConstraint:0x7fa91ffc15b0 'UISV-spacing' V:[UIView:0x7fa91f5c5b00]-(0)-[UIView:0x7fa91f53a830]>",
"<NSLayoutConstraint:0x7fa91ffb8540 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7fa91f53a530(414)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fa921340870 'UISV-alignment' UIView:0x7fa91f5c5850.bottom == UIView:0x7fa91f5c6b00.bottom>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-04-22 10:06:14.065 Just Now[9468:534833] 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.
(
"<_UILayoutSupportConstraint:0x7fa918c200e0 V:[_UILayoutGuide:0x7fa91f55acf0(44)]>",
"<_UILayoutSupportConstraint:0x7fa91f582a20 V:|-(0)-[_UILayoutGuide:0x7fa91f55acf0] (Names: '|':UIView:0x7fa91f53a530 )>",
"<_UILayoutSupportConstraint:0x7fa91f5c65a0 V:[_UILayoutGuide:0x7fa91f5d2350(0)]>",
"<_UILayoutSupportConstraint:0x7fa918c11a20 _UILayoutGuide:0x7fa91f5d2350.bottom == UIView:0x7fa91f53a530.bottom>",
"<NSLayoutConstraint:0x7fa91f5d7bd0 V:[UISlider:0x7fa91f5d74e0(30)]>",
"<NSLayoutConstraint:0x7fa91f5c5ef0 V:[UILabel:0x7fa91f5c5c90'Color Scheme'(32)]>",
"<NSLayoutConstraint:0x7fa91f5d49d0 V:[UISwitch:0x7fa91f5d4810(31)]>",
"<NSLayoutConstraint:0x7fa91f53e850 V:[UILabel:0x7fa91f511840'Hue'(21)]>",
"<NSLayoutConstraint:0x7fa91f539a00 V:|-(8)-[UILabel:0x7fa91f5c5c90'Color Scheme'] (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539af0 V:[UILabel:0x7fa91f5c5c90'Color Scheme']-(5)-[UILabel:0x7fa91f511840'Hue']>",
"<NSLayoutConstraint:0x7fa91f539b40 V:[UILabel:0x7fa91f511840'Hue']-(8)-[UISlider:0x7fa91f5d74e0]>",
"<NSLayoutConstraint:0x7fa91f539dc0 V:[UISwitch:0x7fa91f5d4810]-(19)-[UIStackView:0x7fa91f5c6650]>",
"<NSLayoutConstraint:0x7fa91f539e10 V:[UIStackView:0x7fa91f5c6650]-(8)-| (Names: '|':UIView:0x7fa91f5c5b00 )>",
"<NSLayoutConstraint:0x7fa91f539f50 V:[UISlider:0x7fa91f5d74e0]-(37)-[UISwitch:0x7fa91f5d4810]>",
"<NSLayoutConstraint:0x7fa91f582f10 V:[_UILayoutGuide:0x7fa91f55acf0]-(0)-[UIStackView:0x7fa91f53a6a0]>",
"<NSLayoutConstraint:0x7fa91f582f60 V:[UIStackView:0x7fa91f53a6a0]-(0)-[_UILayoutGuide:0x7fa91f5d2350]>",
"<NSLayoutConstraint:0x7fa91ffc1160 'UISV-canvas-connection' UIStackView:0x7fa91f53a6a0.top == UIView:0x7fa91f5c5b00.top>",
"<NSLayoutConstraint:0x7fa9228831e0 'UISV-canvas-connection' V:[UIView:0x7fa91f53a830]-(0)-| (Names: '|':UIStackView:0x7fa91f53a6a0 )>",
"<NSLayoutConstraint:0x7fa921301830 'UISV-fill-equally' UIView:0x7fa91f53a830.height == UIView:0x7fa91f5c5b00.height>",
"<NSLayoutConstraint:0x7fa91ffc15b0 'UISV-spacing' V:[UIView:0x7fa91f5c5b00]-(0)-[UIView:0x7fa91f53a830]>",
"<NSLayoutConstraint:0x7fa91ffb8540 'UIView-Encapsulated-Layout-Height' V:[UIView:0x7fa91f53a530(414)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x7fa91f5c5ef0 V:[UILabel:0x7fa91f5c5c90'Color Scheme'(32)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
I have tried moving things around, but I get no errors in the storyboard editor and the runtime errors continue when rotating the screen. The fact that it's trying to break automatic constraints within a stack view makes me think this may be a bug. Regardless of the errors, the program works and looks as it is supposed to, so I am at a loss.
Any help will be appreciated. Thanks in advance!

Ok. I guess everyone knew this, and that's why I didn't get any answers... But this error went away and Xcode is no longer complaining. I will post a follow up in case it returns.

Related

Fix hundreds of lines of warnings re layout constraints from DatePicker

Using the new (iOS 14) DatePicker in SwiftUI, it works as expected and looks fine in the simulator & on the device, BUT as soon as the calendar pops up, I get a few HUNDRED lines of warning in the output window. Which is a little annoying!
While the logs are posted below, the seemingly relevant content seems to be:
UIDatePicker 0x7fbd66fc49f0 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
But, as the code below shows, I'm not constraining anything narrower than 300 points. And, everything shows up fine.
Either of two solutions would work fine from my standpoint:
suppress all warnings, or
add whatever fixes to the code to eliminate the warnings
The code that pops up the Date Picker, which generates all the warnings as soon as the control is tapped:
struct MyCustomDatePicker : View {
var doSomething : (Date) -> ()
#State var title: String
#State var ignoreSelStart : Bool
#State var ignoreSelEnd : Bool
#State var selectedDate : Date
#ObservedObject var limits : DateRangeLimits
var body: some View {
VStack {
DatePicker(
"\(title)", selection: $selectedDate,
in: ((ignoreSelStart ? limits.hardStart : limits.selectedStart)...(ignoreSelEnd ? limits.hardEnd : limits.selectedEnd)), displayedComponents: [.date]
)
.onChange(of: selectedDate, perform: { value in
doSomething(selectedDate)
})
}
.frame(width: 400, height: 100, alignment: .center)
.background(Color.white)
}
}
This struct is called from here:
struct FlexChoice : View {
#ObservedObject var limits = DateRangeLimits()
func setStart(d: Date) {
// stuff
}
func setEnd(d: Date) {
// stuff
}
var body: some View {
VStack(spacing: 0) {
if customDateRangePossible {
HStack {
MyCustomDatePicker(doSomething: self.setStart, title: "Begin ",
ignoreSelStart: true, ignoreSelEnd: false,
selectedDate: limits.selectedStart, limits: limits)
MyCustomDatePicker(doSomething: self.setEnd, title: "Finish ",
ignoreSelStart: false, ignoreSelEnd: true,
selectedDate: limits.selectedEnd, limits: limits)
} // closes HStack
} // closes "if customDateRangePossible..."
} // closes VStack
} // closes body
} // closes struct
The first bit of the warnings:
2021-01-23 10:06:35.707334-0600 MyAppName[28362:46367754] [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.
(
"<_UISystemBaselineConstraint:0x6000011979d0 H:[_UIDatePickerLinkedLabel:0x7fbd66ffda10]-(NSLayoutAnchorConstraintSpace(8))-[UILayoutGuide:0x6000008f4540''] (active)>",
"<_UISystemBaselineConstraint:0x600001196f30 H:[UILayoutGuide:0x6000008f4540'']-(>=NSLayoutAnchorConstraintSpace(8))-[_UIDatePickerTouchOutsetButton:0x7fbd66f8e9d0] (active)>",
"<NSLayoutConstraint:0x600001197070 _UIDatePickerLinkedLabel:0x7fbd66ffda10.leading == UILayoutGuide:0x6000008f41c0'UIViewLayoutMarginsGuide'.leading (active)>",
"<NSLayoutConstraint:0x600001194fa0 H:[_UIDatePickerTouchOutsetButton:0x7fbd66f8e9d0]-(28)-[_UIDatePickerTouchOutsetButton:0x7fbd72922e40] (active)>",
"<NSLayoutConstraint:0x600001197340 _UIDatePickerTouchOutsetButton:0x7fbd72922e40.trailing == UILayoutGuide:0x6000008f41c0'UIViewLayoutMarginsGuide'.trailing (active)>",
"<NSLayoutConstraint:0x6000011975c0 UILayoutGuide:0x6000008f4540''.width == UIImageView:0x7fbd66f8e800.width (active)>",
"<NSLayoutConstraint:0x60000125fca0 _UIDatePickerCalendarContentStackView:0x7fbd66f8ad40.width <= _UIDatePickerCalendarView:0x7fbd66fc49f0.width (active)>",
"<NSLayoutConstraint:0x6000011c2f30 H:|-(0)-[_UIDatePickerCalendarView:0x7fbd66fc49f0] (active, names: '|':UIDatePicker:0x7fbd7298e840 )>",
"<NSLayoutConstraint:0x6000011c0500 _UIDatePickerCalendarView:0x7fbd66fc49f0.trailing == UIDatePicker:0x7fbd7298e840.trailing (active)>",
"<NSLayoutConstraint:0x60000125ee90 H:|-(8)-[UIDatePicker:0x7fbd7298e840] (active, names: '|':UIView:0x7fbd72d46870 )>",
"<NSLayoutConstraint:0x6000012573e0 UIDatePicker:0x7fbd7298e840.trailing == UIView:0x7fbd72d46870.trailing - 8 (active)>",
"<NSLayoutConstraint:0x6000011de120 'UISV-canvas-connection' _UIDatePickerCalendarContentStackView:0x7fbd66f8ad40.leading == _UIDatePickerCalendarHeaderView:0x7fbd66f8aed0.leading (active)>",
"<NSLayoutConstraint:0x6000011df390 'UISV-canvas-connection' H:[_UIDatePickerCalendarHeaderView:0x7fbd66f8aed0]-(0)-| (active, names: '|':_UIDatePickerCalendarContentStackView:0x7fbd66f8ad40 )>",
"<NSLayoutConstraint:0x6000011cfca0 'UIView-Encapsulated-Layout-Width' UIView:0x7fbd72d46870.width == 0 (active)>",
"<NSLayoutConstraint:0x60000119cd20 'UIView-leftMargin-guide-constraint' H:|-(8)-[UILayoutGuide:0x6000008f41c0'UIViewLayoutMarginsGuide'](LTR) (active, names: '|':_UIDatePickerCalendarHeaderView:0x7fbd66f8aed0 )>",
"<NSLayoutConstraint:0x6000011977a0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000008f41c0'UIViewLayoutMarginsGuide']-(8)-|(LTR) (active, names: '|':_UIDatePickerCalendarHeaderView:0x7fbd66f8aed0 )>"
)
Will attempt to recover by breaking constraint
<_UISystemBaselineConstraint:0x600001196f30 H:[UILayoutGuide:0x6000008f4540'']-(>=NSLayoutAnchorConstraintSpace(8))-[_UIDatePickerTouchOutsetButton:0x7fbd66f8e9d0] (active)>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
What follows are many repetitions of basically that same warning (minus the constraint that was just broken on each successive iteration).
At the very end of the hundreds of lines of warning are the following:
2021-01-23 10:06:35.734386-0600 MyAppName[28362:46367754] [DatePicker] UIDatePicker 0x7fbd66fc49f0 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
2021-01-23 10:06:35.740477-0600 MyAppName[28362:46367754] [DatePicker] UIDatePicker 0x7fbd66fc49f0 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
2021-01-23 10:06:35.752360-0600 MyAppName[28362:46367754] [DatePicker] UIDatePicker 0x7fbd66fc49f0 is being laid out below its minimum width of 280. This may not look like expected, especially with larger than normal font sizes.
Is there a way to make the DatePicker happy & make it so that these warnings don't flood the output window, either by fixing things or suppressing the warnings?
I'm getting the same warnings and I'm doing all my constraints programmatically (below). I tried setting my constraints to lower priority (900), so that they wouldn't conflict with any system constraints that might be there but it didn't make any difference.
"V:[timePeriodControl]-(0#900)-[datePicker]"
"H:[datePicker]-(0#900)-|"
The compact picker displays the date fine at first. It's only when I tap on the compact picker and the _UIDatePickerIOSCompactViewController is created to display the calendar that the warnings occur. All the constraint warnings are on the calendar view, which is created by the SDK, not us.
In this screenshot from the debugger you can even see the compact date picker view is still in its right place and is the right size (blue box on right). I checked it's constraints and they are fine (you can print out a list from the debugger). So it's not the compact picker that's the problem, it's definitely the calendar view controller needs a radar. This is an iOS SDK bug.
If you use GraphicalDatePickerStyle, try:
DatePicker("", ....)
.datePickerStyle(GraphicalDatePickerStyle())
.padding() // this line solves the problem.
I use the CompactDatePickerStyle and the problem unfortunately still exists.

Recreate height constraint

So I have a button that I want to toggle the height of a view with. This means I can't use priority to update these values. However, when I tap in the table it updates correctly.
let shown = false;
tableHeaderView.snp.makeConstraints { make in
make.width.equalTo(self.tableView.snp.width)
make.height.equalTo(50)
}
filterButton.rx.tap.subscribe(onNext: {
self.tableHeaderView.snp.updateConstraints { make in
if (shown) {
make.height.equalTo(50)
} else {
make.height.equalTo(100)
}
self.shown.toggle()
}
})
This code just breaks the constraint I want to add. How can I avoid this?
(
"<SnapKit.LayoutConstraint:0x600002574780#AthleteSearchController.swift#54 UIView:0x7fccf0441c20.height == 100.0>",
"<NSLayoutConstraint:0x600002235db0 'UIView-Encapsulated-Layout-Height' UIView:0x7fccf0441c20.height == 50 (active)>"
)
Will attempt to recover by breaking constraint
<SnapKit.LayoutConstraint:0x600002574780#AthleteSearchController.swift#54 UIView:0x7fccf0441c20.height == 100.0>

UIAlertController conflicts with UICollectionViewFlowLayout

I have a strange problem, where my extension of UICollectionViewFlowLayout conflicts with a UIAlertController, and removes its button.
My app has a uicollectionviewcontroller with paging enabled, and my uicollectionviewflowlayout extension makes sure a single cell fills the whole screen
// Extension to make a UICollectionViewCell fill the whole screen
extension UICollectionViewFlowLayout {
public override func prepareLayout() {
let ratio : CGFloat = 5.6 / 8.7
let cardHeight = collectionView!.frame.height * 0.7
let cardWidth = cardHeight * ratio
let spacing = (collectionView!.frame.height - cardHeight) / 2
itemSize = CGSize(width: cardWidth, height: cardHeight)
minimumLineSpacing = spacing*2
sectionInset = UIEdgeInsets(top: spacing, left: 0, bottom: spacing, right: 0)
}
}
And whenever I call a UIAlertController
let alertController = UIAlertController(title: "Error", message: "Error", preferredStyle: .Alert)
alertController.addAction(UIAlertAction(title: "OK", style: .Cancel) { (action) in })
self.presentViewController(alertController, animated: true) {}
I get the following message in the console
2016-01-01 21:04:48.924 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c4e80 h=--& v=--& H:[_UIAlertControllerActionView:0x15f53d9e0(19.8253)]>",
"<NSLayoutConstraint:0x15f67b370 H:|-(>=12)-[UIView:0x15f53e0c0] (Names: '|':_UIAlertControllerActionView:0x15f53d9e0 )>",
"<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-01-01 21:04:48.926 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c62a0 h=--& v=--& V:[_UIAlertControllerActionView:0x15f53d9e0(30.8)]>",
"<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-01-01 21:04:48.927 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c4e80 h=--& v=--& H:[_UIAlertControllerActionView:0x15f53d9e0(19.8253)]>",
"<NSLayoutConstraint:0x15f67b370 H:|-(>=12)-[UIView:0x15f53e0c0] (Names: '|':_UIAlertControllerActionView:0x15f53d9e0 )>",
"<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-01-01 21:04:48.927 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c62a0 h=--& v=--& V:[_UIAlertControllerActionView:0x15f53d9e0(30.8)]>",
"<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-01-01 21:04:48.938 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c4e80 h=--& v=--& H:[_UIAlertControllerActionView:0x15f53d9e0(19.8253)]>",
"<NSLayoutConstraint:0x15f67b370 H:|-(>=12)-[UIView:0x15f53e0c0] (Names: '|':_UIAlertControllerActionView:0x15f53d9e0 )>",
"<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67b3c0 UIView:0x15f53e0c0.trailing <= _UIAlertControllerActionView:0x15f53d9e0.trailing - 12>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2016-01-01 21:04:48.940 Jeg Har Aldrig[10912:3649777] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15f6c62a0 h=--& v=--& V:[_UIAlertControllerActionView:0x15f53d9e0(30.8)]>",
"<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15f67bd50 V:[_UIAlertControllerActionView:0x15f53d9e0(>=44)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
While the button on my UIAlertControllers don't appear, see the image
Any suggestiens?
Solution based on Mattvens answer
Instead of making an extension I made a subclass:
class FullCellLayout: UICollectionViewFlowLayout {
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
let ratio : CGFloat = 5.6 / 8.7
let cardHeight = UIScreen.mainScreen().bounds.height * 0.7
let cardWidth = cardHeight * ratio
let spacing = (UIScreen.mainScreen().bounds.height - cardHeight) / 2
itemSize = CGSize(width: cardWidth, height: cardHeight)
minimumLineSpacing = spacing*2
sectionInset = UIEdgeInsets(top: spacing, left: 0, bottom: spacing, right: 0)
}
}
Short answer: Don't use an extension for this.
Extensions in Swift are global, so your extension to UICollectionViewLayout is affecting all UICollectionViewLayout classes.
Judging from the error you are getting, UIAlertController is internally using UICollectionView to layout buttons, and your extension is breaking that functionality.
You should use a subclass, if you really need it, but there's no reason (that I know of) you can't initialize UICollectionViewFlowLayout, assign it to a var and use that.

Unable to simultaneously satisfy constraints - Cartography

I`m using the AutoLayout with code on my application written in Swift 2.0 and that uses Cartograph to help with constrains.
But something are blocking my app, otherwise, I use this to add a view programmatically.
func addButtonOne() -> Void {
buttonOne = UIButton()
buttonOne.backgroundColor = UIColor.greenColor()
self.view.addSubview(buttonOne)
constrain(buttonOne, view) { buttonOne, view in
buttonOne.left == view.right - 12
buttonOne.right == view.left + 12
buttonOne.bottom == view.bottom - 12
}
}
But after the compile, this returns:
2015-09-23 00:54:24.489 Fun With Swift[24809:2358352] 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.
(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand,
refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSLayoutConstraint:0x7afe2160 H:[UIView:0x7afdfe90]-(-12)-[UIButton:0x7afe13b0](LTR)>",
"<NSLayoutConstraint:0x7afe2730 UIButton:0x7afe13b0.right == UIView:0x7afdfe90.left + 12>",
"<NSLayoutConstraint:0x7b0866e0 'UIView-Encapsulated-Layout-Width' H:[UIView:0x7afdfe90(320)]>"
)
Anyone know what I can do? This is a different issue because I use a library.
The add constrain code should be like following
constrain(buttonOne, view) { buttonOne, view in
buttonOne.left == view.left + 12
buttonOne.right == view.right - 12
buttonOne.bottom == view.bottom - 12
}
If you need a button in the bottom with 12 pt margin from left right and bottom

How to expand UICollectionView frame size dynamically in swift

Using storyboard, I added, Scrollview -> View -> CollectionView.
my_collxn_view frame size is, (5, 200, 310, 368),
my_view frame size is, (0, 0, 320, 568),
my_scroll_view frame size is, (0, 0, 320, 568)
I am having 10 Cells. So Content size is too large. I don't know how to expand UICollectionView frame size through coding. Kindly guide me.
I have tried something. My coding is below.
First Attempt
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
my_collxn_view.frame.size.height = my_collxn_view.contentSize.height //635.0
my_view.frame.size.height = 200 + my_collxn_view.frame.size.height //835.0
my_scroll_view.contentSize = CGSizeMake(320, my_view.frame.size.height) //Scrolling
my_collxn_view.frame = CGRectMake(5, 200, 310, my_collxn_view.frame.size.height) //Not Expanding
return CGSizeMake(150, 205) //CELL Size
}
Second Attepmt
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
my_collxn_view.frame.size.height = my_collxn_view.contentSize.height //635.0
my_view.frame.size.height = 200 + my_collxn_view.frame.size.height //835.0
my_collxn_view.frame = CGRectMake(5, 200, 320, my_collxn_view.frame.size.height) //Not Expanding
my_view.frame = CGRectMake(0, 0, 320, my_view.frame.size.height) //Not Expanding
my_scroll_view.contentSize = CGSizeMake(320, my_view.frame.size.height) //Scrolling
}
Updated
my_view.setTranslatesAutoresizingMaskIntoConstraints(true)
my_collxn_view.setTranslatesAutoresizingMaskIntoConstraints(true)
I have used the above two lines. Exact output received. But, Some warnings has been displayed in debug area.
Warning
2015-04-21 18:43:52.974 E Commerce[9475:1673654] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a010 'IB auto generated at build time for view with fixed frame' V:|-(200)-[UICollectionView:0x7fcf6a84b000] (Names: '|':UIView:0x7fcf6957abe0 )>",
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a0b0 'IB auto generated at build time for view with fixed frame' V:[UICollectionView:0x7fcf6a84b000(368)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7fcf696745c0 h=--& v=--& UICollectionView:0x7fcf6a84b000.midY == + 517.5>"
)
Will attempt to recover by breaking constraint
<NSIBPrototypingLayoutConstraint:0x7fcf6958a010 'IB auto generated at build time for view with fixed frame' V:|-(200)-[UICollectionView:0x7fcf6a84b000] (Names: '|':UIView:0x7fcf6957abe0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-04-21 18:43:52.978 Test_work[9475:1673654] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a0b0 'IB auto generated at build time for view with fixed frame' V:[UICollectionView:0x7fcf6a84b000(368)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7fcf69674630 h=--& v=--& V:[UICollectionView:0x7fcf6a84b000(635)]>"
)
Will attempt to recover by breaking constraint
<NSIBPrototypingLayoutConstraint:0x7fcf6958a0b0 'IB auto generated at build time for view with fixed frame' V:[UICollectionView:0x7fcf6a84b000(368)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-04-21 18:43:52.980 Test_work[9475:1673654] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a6c0 'IB auto generated at build time for view with fixed frame' V:|-(0)-[UIView:0x7fcf6957abe0] (Names: '|':UIScrollView:0x7fcf6957a8b0 )>",
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a760 'IB auto generated at build time for view with fixed frame' V:[UIView:0x7fcf6957abe0(568)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7fcf69674910 h=--& v=--& UIView:0x7fcf6957abe0.midY == + 442.5>"
)
Will attempt to recover by breaking constraint
<NSIBPrototypingLayoutConstraint:0x7fcf6958a6c0 'IB auto generated at build time for view with fixed frame' V:|-(0)-[UIView:0x7fcf6957abe0] (Names: '|':UIScrollView:0x7fcf6957a8b0 )>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
2015-04-21 18:43:52.990 Test_work[9475:1673654] 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. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSIBPrototypingLayoutConstraint:0x7fcf6958a760 'IB auto generated at build time for view with fixed frame' V:[UIView:0x7fcf6957abe0(568)]>",
"<NSAutoresizingMaskLayoutConstraint:0x7fcf69674980 h=--& v=--& V:[UIView:0x7fcf6957abe0(885)]>"
)
Will attempt to recover by breaking constraint
<NSIBPrototypingLayoutConstraint:0x7fcf6958a760 'IB auto generated at build time for view with fixed frame' V:[UIView:0x7fcf6957abe0(568)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Kindly guide me.
Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints
You need to setTranslatesAutoresizingMaskIntoConstraints(false) on each view you manually set one or more NSLayoutConstraint to.