- 实现EPUB阅读器搜索功能及选中注释功能 - 优化CFI模块,修复代码审查发现的11个问题 - 实现大书远距目录跳转与后台补全优化方案 - 优化设置面板与章节运行时联动 - 重构及大量改进优化
36 lines
970 B
Swift
36 lines
970 B
Swift
|
|
import UIKit
|
|
|
|
class RDReaderContentCell: UICollectionViewCell {
|
|
|
|
private var _containerView: UIView? = nil
|
|
|
|
var containerView: UIView? {
|
|
set {
|
|
guard newValue !== _containerView else { return }
|
|
_containerView?.removeFromSuperview()
|
|
_containerView = newValue
|
|
if let containerView = _containerView {
|
|
contentView.addSubview(containerView)
|
|
setNeedsLayout()
|
|
}
|
|
}
|
|
get {
|
|
return _containerView
|
|
}
|
|
}
|
|
|
|
override func layoutSubviews() {
|
|
super.layoutSubviews()
|
|
_containerView?.frame = CGRect(x: 0, y: 0, width: contentView.frame.width, height: contentView.frame.height)
|
|
}
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
accessibilityIdentifier = "epub.reader.content.cell"
|
|
}
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
}
|