Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash iOS15 #36

Closed
BobDG opened this issue Sep 23, 2021 · 19 comments
Closed

Crash iOS15 #36

BobDG opened this issue Sep 23, 2021 · 19 comments

Comments

@BobDG
Copy link

BobDG commented Sep 23, 2021

I use a very simple color picker, just the default:

let colorPickerController = DefaultColorPickerViewController()
colorPickerController.delegate = self
colorPickerController.selectedColor = UIColor.init(hex: user.invoice_color_hex)
colorPickerController.navigationItem.title = "Settings_InvoiceLayout_HeadersColor".localized()
self.navigationController?.pushViewController(colorPickerController, animated: true)

It has always worked perfectly, until iOS15. It seems to crash on this line:

public var contentBounds: CGRect {
    layoutIfNeeded()
    return contentView.frame
}

//Previous functions before it arrived here

private func updateCornerRadius() {
    gradientBackgroundView.cornerRadius_ = contentBounds.height / 2
}
open override var bounds: CGRect {
    didSet {
        updateCornerRadius()
        updateThumbAndGradient(isInteractive: false)
    }
}
@RastislavMirek
Copy link
Owner

Hmm, interesting. Do you have more info about the crash? What is the exception, stack trace, etc.? I will definitely look at this and fix the bug.

@BobDG
Copy link
Author

BobDG commented Sep 23, 2021

Hi RastislavMirek,

Thanks for your quick response and really good to hear you'll fix this! When I look at the stack trace, and based on how long it takes to crash, it seems like it's stuck in some loop. Here's the stack, of which I'm only copying about 10%:

Thread 1 Queue : com.apple.main-thread (serial) #0 0x00000001f14d4f9c in ___chkstk_darwin () #1 0x000000019a9b23cc in -[NSISEngine _flushPendingRemovals] () #2 0x000000019a9b9a08 in -[NSISEngine optimize] () #3 0x000000019a9b213c in -[NSISEngine performPendingChangeNotifications] () #4 0x00000001847a856c in -[UIView(Hierarchy) layoutBelowIfNeeded] () #5 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #6 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #7 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #8 0x000000010559ea8c in ColorSliderControl.bounds.setter () #9 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #10 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #11 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #12 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #13 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #14 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #15 0x000000010559ea8c in ColorSliderControl.bounds.setter () #16 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #17 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #18 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #19 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #20 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #21 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #22 0x000000010559ea8c in ColorSliderControl.bounds.setter () #23 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #24 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #25 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #26 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #27 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #28 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #29 0x000000010559ea8c in ColorSliderControl.bounds.setter () #30 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #31 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #32 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #33 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #34 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #35 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #36 0x000000010559ea8c in ColorSliderControl.bounds.setter () #37 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #38 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #39 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #40 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #41 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #42 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #43 0x000000010559ea8c in ColorSliderControl.bounds.setter () #44 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #45 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #46 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #47 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #48 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #49 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #50 0x000000010559ea8c in ColorSliderControl.bounds.setter () #51 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #52 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #53 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #54 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #55 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #56 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #57 0x000000010559ea8c in ColorSliderControl.bounds.setter () #58 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #59 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #60 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #61 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #62 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #63 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #64 0x000000010559ea8c in ColorSliderControl.bounds.setter () #65 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #66 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #67 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #68 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #69 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #70 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #71 0x000000010559ea8c in ColorSliderControl.bounds.setter () #72 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #73 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #74 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #75 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #76 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #77 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #78 0x000000010559ea8c in ColorSliderControl.bounds.setter () #79 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #80 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #81 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #82 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #83 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #84 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #85 0x000000010559ea8c in ColorSliderControl.bounds.setter () #86 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #87 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #88 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #89 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #90 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #91 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #92 0x000000010559ea8c in ColorSliderControl.bounds.setter () #93 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #94 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #95 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #96 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #97 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #98 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #99 0x000000010559ea8c in ColorSliderControl.bounds.setter () #100 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #101 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #102 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #103 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #104 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #105 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #106 0x000000010559ea8c in ColorSliderControl.bounds.setter () #107 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #108 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #109 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #110 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #111 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #112 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #113 0x000000010559ea8c in ColorSliderControl.bounds.setter () #114 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #115 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #116 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #117 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #118 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #119 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #120 0x000000010559ea8c in ColorSliderControl.bounds.setter () #121 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #122 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #123 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #124 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #125 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #126 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #127 0x000000010559ea8c in ColorSliderControl.bounds.setter () #128 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #129 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #130 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #131 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #132 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #133 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #134 0x000000010559ea8c in ColorSliderControl.bounds.setter () #135 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #136 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #137 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #138 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #139 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #140 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #141 0x000000010559ea8c in ColorSliderControl.bounds.setter () #142 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #143 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #144 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #145 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #146 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #147 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #148 0x000000010559ea8c in ColorSliderControl.bounds.setter () #149 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #150 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #151 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #152 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #153 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #154 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #155 0x000000010559ea8c in ColorSliderControl.bounds.setter () #156 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #157 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #158 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #159 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #160 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #161 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #162 0x000000010559ea8c in ColorSliderControl.bounds.setter () #163 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter () #164 0x00000001849cb3e0 in -[UIView(Geometry) _applyISEngineLayoutValuesToBoundsOnly:] () #165 0x00000001847a8820 in -[UIView(Hierarchy) layoutBelowIfNeeded] () #166 0x000000010558d3ac in AdjustedHitBoxColorControl.contentBounds.getter at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/AdjustedHitBoxColorControl.swift:49 #167 0x000000010559ef64 in ColorSliderControl.updateCornerRadius() at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:89 #168 0x000000010559eab8 in ColorSliderControl.bounds.didset at /Users/bobdegraaf/Dropbox (Persoonlijk)/GraafICT/Projecten/Apps/ZZP Admin/Code/Pods/FlexColorPicker/FlexColorPicker/Classes/Controls/ColorSliderControl.swift:63 #169 0x000000010559ea8c in ColorSliderControl.bounds.setter () #170 0x000000010559e9cc in @objc ColorSliderControl.bounds.setter ()

@RastislavMirek
Copy link
Owner

Thank you. Will look into this ASAP. However, if you find time to find the fix in FlexColorPicker yourself, I will gladly accept a pull request.

@chopinist
Copy link

I use a very simple color picker, just the default:

let colorPickerController = DefaultColorPickerViewController()
colorPickerController.delegate = self
colorPickerController.selectedColor = UIColor.init(hex: user.invoice_color_hex)
colorPickerController.navigationItem.title = "Settings_InvoiceLayout_HeadersColor".localized()
self.navigationController?.pushViewController(colorPickerController, animated: true)

It has always worked perfectly, until iOS15. It seems to crash on this line:

public var contentBounds: CGRect {
    layoutIfNeeded()
    return contentView.frame
}

//Previous functions before it arrived here

private func updateCornerRadius() {
    gradientBackgroundView.cornerRadius_ = contentBounds.height / 2
}
open override var bounds: CGRect {
    didSet {
        updateCornerRadius()
        updateThumbAndGradient(isInteractive: false)
    }
}

Same here!

@RastislavMirek
Copy link
Owner

Guys I would really love to help ASAP, but the problem is I am still on Mac 11 Big Sur and I would need to update in order to be able to install a new XCode with iOS 15 support. I cannot do that yet.

If somebody who is facing this problem can patch it and send a pull request that would be accepted and I will release a new CocoaPods version as well. Otherwise, you will have to wait for the patch a little bit. I apologize.

@gintechsystems
Copy link

gintechsystems commented Sep 23, 2021

@RastislavMirek This is the same issue I was having, we can tag one of these as duplicates. I may look into fixing this myself, as I can't use auto layout at all.

Why do you need to update? I have Big Sur and am using Xcode 13 with iOS 15.

@BobDG
Copy link
Author

BobDG commented Sep 24, 2021

I didn't have time to fully dive into it and I needed an update fast, so I fixed it using the ugliest code possible. I knew it was calling some methods over and over, probably a layoutIfNeeded() that automatically called something that then again called layoutIfNeeded(). So I just needed some booleans to only call these one time.
I finally found 3 places where I needed to intervene. Here are the classes and the methods that got it working again for me.
FYI, obviously this is not a correct fix and I will not submit a pull request for this. But this might help someone who is trying to fix it in a good way :)

First class: AdjustedHitBoxColorControl

private var adjustedHitBoxControlAlreadySet = false
public var contentBounds: CGRect {
    #warning("Fix 1")
    if !adjustedHitBoxControlAlreadySet {
        adjustedHitBoxControlAlreadySet = true
        layoutIfNeeded()            
    }
    return contentView.frame
}

Second class: ColorPaletteControl

private var colorPaletteControlAlreadySet = false
open override var bounds: CGRect {
    didSet {
        if !colorPaletteControlAlreadySet {
            #warning("Fix 2")
            colorPaletteControlAlreadySet = true
            updatePaletteImagesAndThumb(isInteractive: false)
        }
    }
}

Third class: ColorSliderControl

private var colorSliderControlAlreadySet = false
open override var bounds: CGRect {
    didSet {
        #warning("Fix 3")
        if !colorSliderControlAlreadySet {
            colorSliderControlAlreadySet = true
            updateCornerRadius()
            updateThumbAndGradient(isInteractive: false)
        }
    }
}

@patrickferreira
Copy link

Having the same crash here. :/ Can't wait for a proper fix!

@RastislavMirek
Copy link
Owner

This should be fixed in 1.4.4

@gintechsystems
Copy link

@RastislavMirek I will test it this weekend and let you know, thanks for the quick fix.

@RastislavMirek
Copy link
Owner

@RastislavMirek I will test it this weekend and let you know, thanks for the quick fix.

@gintechsystems Did you have a chance to test?

@gintechsystems
Copy link

@RastislavMirek Yes, it is working now. I am curious though, why do we need to call layoutIfNeeded twice? Does it not work with one? I guess I would have to go through the code to see what is going on fully to understand...auto layout does work now however I was forced to set a width and height for the view, I couldn't just put it between two elements and it would scale correctly like normal. Something we can look into later.

Anyway, just giving my thoughts. Thanks again for the fix!

@RastislavMirek
Copy link
Owner

I am not sure actually why there are 2 calls to layoutIfNeeded. I coded this a long time ago and I forgot what problem I solved this way...

auto layout does work now however I was forced to set a width and height for the view, I couldn't just put it between two elements and it would scale correctly like normal. Something we can look into later.

This is definitely an issue. Would you mind creating a separate issue for this with example code? I will look into it.

@gintechsystems
Copy link

@RastislavMirek Has it always been an issue? Sure, I can do that for you. I will get back to you when I have time....it may be a little. I have been busy at my FT job.

@RastislavMirek
Copy link
Owner

@gintechsystems No, this is new. Ok, I will wait. Thanks.

@gintechsystems
Copy link

gintechsystems commented Nov 1, 2021

@gintechsystems No, this is new. Ok, I will wait. Thanks.

@RastislavMirek I plan to look at this over the weekend, will keep you updated. Thanks for the patience.

@BobDG
Copy link
Author

BobDG commented Nov 2, 2021

I just got time to look at it, works great! I think it's even better because in the previous version the layout wasn't good when I rotated, but now it updates the layout nicely. Thanks!

@gintechsystems
Copy link

gintechsystems commented Nov 19, 2021

@RastislavMirek - Link to the zip file with an example of the issue I am running into as mentioned earlier, I am required to set a width and height otherwise it just shows the thumb but not the color wheel, which is interesting. I could be wrong but I don't think auto layout is working as I am expecting or it could be I am missing a constraint. All you should have to do is compile and run. I did build using Xcode 13.

@gintechsystems
Copy link

I plan on forking your library and seeing if I can help resolve this issue, along with understanding the need for multiple layout calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants