Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,13 @@ open class UKProgressBar: UIView, UKComponent {
// MARK: - UIView methods

open override func sizeThatFits(_ size: CGSize) -> CGSize {
let width = self.superview?.bounds.width ?? size.width
let width: CGFloat
if let parentWidth = self.superview?.bounds.width,
parentWidth > 0 {
width = parentWidth
} else {
width = 10_000
}
return CGSize(
width: min(size.width, width),
height: min(size.height, self.model.backgroundHeight)
Expand Down
8 changes: 7 additions & 1 deletion Sources/ComponentsKit/Components/Slider/UKSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ open class UKSlider: UIView, UKComponent {
// MARK: - UIView Methods

open override func sizeThatFits(_ size: CGSize) -> CGSize {
let width = self.superview?.bounds.width ?? size.width
let width: CGFloat
if let parentWidth = self.superview?.bounds.width,
parentWidth > 0 {
width = parentWidth
} else {
width = 10_000
}
return CGSize(
width: min(size.width, width),
height: min(size.height, self.model.handleSize.height)
Expand Down