Music_Player3/Pods/JXSegmentedView/Sources/Core/JXSegmentedCollectionView.swift
2024-05-14 15:04:59 +08:00

38 lines
836 B
Swift

//
// JXSegmentedCollectionView.swift
// JXSegmentedView
//
// Created by jiaxin on 2018/12/26.
// Copyright © 2018 jiaxin. All rights reserved.
//
import UIKit
open class JXSegmentedCollectionView: UICollectionView {
open var indicators = [JXSegmentedIndicatorProtocol]() {
willSet {
for indicator in indicators {
indicator.removeFromSuperview()
}
}
didSet {
for indicator in indicators {
addSubview(indicator)
}
}
}
open override func layoutSubviews() {
super.layoutSubviews()
for indicator in indicators {
sendSubviewToBack(indicator)
if let backgroundView = backgroundView {
sendSubviewToBack(backgroundView)
}
}
}
}