-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
사이즈 캐싱 로직 구현 및
usesCachedViewSize
피쳐플래그 연동해요.
- Loading branch information
1 parent
b4ef008
commit b597f56
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
Sources/KarrotListKit/Extension/UIView+TraitCollection.swift .swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Copyright (c) 2025 Danggeun Market Inc. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIView { | ||
|
||
func shouldInvalidateContentSize( | ||
previousTraitCollection: UITraitCollection? | ||
) -> Bool { | ||
if traitCollection.preferredContentSizeCategory != previousTraitCollection?.preferredContentSizeCategory { | ||
return true | ||
} | ||
|
||
if traitCollection.legibilityWeight != previousTraitCollection?.legibilityWeight { | ||
return true | ||
} | ||
|
||
if traitCollection.horizontalSizeClass != previousTraitCollection?.horizontalSizeClass || | ||
traitCollection.verticalSizeClass != previousTraitCollection?.verticalSizeClass { | ||
return true | ||
} | ||
|
||
return false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters