final class ParallaxContentView: UIView {
lazy var collectionView = UICollectionView(
frame: .zero,
collectionViewLayout: ParallaxFlowLayout()
).then {
$0.contentInsetAdjustmentBehavior = .never
- ScrollView에 StackView를 감싸서, 많은 양의 subviews들을 처음에 추가할 때 rendering 과부하가 걸리게 됩니다. scrolling시 화면에 보이는 영역의 subviews만 render할 수 있다면 굉장히 퍼포먼스가 좋을 것입니다. SwiftUI에서는 이러한 문제점을 인식했는 지 LazyStack이라는 것을 제공합니다. 하지만 UIKit에서는 그러한 것을 제공하지 않습니다. 이 라이브러리는 해당 이슈를 해결하기 위해 만들어졌습니다.
- on-demand subviews render를 지원합니다.
- Note) subview(LazyDisplayView)를 추가할 때 estimatedHeight(추측 높이)값을 대략적으로 정확히 설정해주지 않으면, LazyDisplayStackScrollView가 좋은 성능을 내기 힘듭니다.
// MARK: - Merge extension Array where Element: Equatable {
func merge(target: [Element]) -> [Element] {
let result = target.filter { item -> Bool in
return self.contains(where: { item == $0}) == false
}
return self + result
}
}
// MARK: - Merge extension Array where Element: Equatable {
func merge(target: [Element]) -> [Element] {
let result = target.filter { item -> Bool in
return self.contains(where: { item == $0}) == false
}
return self + result
}
}
import RIBs
import RxSwift
import RxRelay
import ReactorKit
protocol FAQsRouting: ViewableRouting {
func routeToFAQ(_ faq: FAQ)
func detachFAQ()
}
// completion handler for transitions
typealias PresentationHandler = () -> Void
// completion handler for transitions, which also provides the context
// information about the transition.
typealias ContextPresentationHandler = (
PresentationHandlerContext
) -> Void
const Secret = ({ loggedUser }) => (
<div>
<Content>
Hi <strong>{ loggedUser.email }</string>. This is a secure page!
</Content>
</div>
);
NewerOlder