Skip to content

Commit

Permalink
Remove unnecessary layout assert (airbnb#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryankeller authored Jan 11, 2022
1 parent 21e9362 commit 1e98736
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion HorizonCalendar.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "HorizonCalendar"
spec.version = "1.13.2"
spec.version = "1.13.3"
spec.license = "Apache License, Version 2.0"
spec.summary = "A declarative, performant, calendar UI component that supports use cases ranging from simple date pickers to fully-featured calendar apps."

Expand Down
4 changes: 2 additions & 2 deletions HorizonCalendar.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.13.2;
MARKETING_VERSION = 1.13.3;
PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.HorizonCalendar;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down Expand Up @@ -652,7 +652,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
MARKETING_VERSION = 1.13.2;
MARKETING_VERSION = 1.13.3;
PRODUCT_BUNDLE_IDENTIFIER = com.airbnb.HorizonCalendar;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
13 changes: 3 additions & 10 deletions Sources/Internal/FrameProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ final class FrameProvider {
let height = width * content.dayAspectRatio
daySize = CGSize(width: width, height: height)

validateCalendarMetrics(size: size)
if daySize.width <= 0 || daySize.height <= 0 {
print("Calendar metrics and size resulted in a negative-or-zero size of (\(daySize.debugDescription) points for each day. If ignored, this will cause incorrect / unexpected layouts.")
}
}

// MARK: Internal
Expand Down Expand Up @@ -325,15 +327,6 @@ final class FrameProvider {
content.monthsLayout
}

private func validateCalendarMetrics(size: CGSize) {
assert(
daySize.width > 0,
"""
Calendar metrics and size resulted in a negative-or-zero size of \(daySize.width) points for
each day. If ignored, this will cause very odd / incorrect layouts.
""")
}

private func minXOfItem(
at dayOfWeekPosition: DayOfWeekPosition,
minXOfContainingRow: CGFloat)
Expand Down

0 comments on commit 1e98736

Please sign in to comment.