- Rename source module from RDReaderView to RDEpubReaderView - Move all source files from Sources/RDReaderView/ to Sources/RDEpubReaderView/ - Update podspec: RDReaderView.podspec -> RDEpubReaderView.podspec - Update Podfile, demo project, and CocoaPods config for new pod name - Delete old RDReaderView pod support files from ReadViewDemo/Pods - Add new RDEpubReaderView pod support files - Update documentation (API ref, architecture, UML, conventions, etc.) - Add FixedLayoutRotationTests - Update .gitignore: exclude .DS_Store, manual unpack backups, _ssoft-output
51 lines
1.4 KiB
Swift
51 lines
1.4 KiB
Swift
|
|
import UIKit
|
|
|
|
class RDEpubReaderPageChildViewController: UIViewController {
|
|
|
|
private let contentContainerView = UIView()
|
|
|
|
var contentView: UIView? {
|
|
didSet {
|
|
guard isViewLoaded else { return }
|
|
installContentView()
|
|
}
|
|
}
|
|
|
|
var pageNum: Int = 0
|
|
|
|
init(contentView: UIView?, pageNum: Int = 0) {
|
|
self.contentView = contentView
|
|
self.pageNum = pageNum
|
|
super.init(nibName: nil, bundle: nil)
|
|
}
|
|
|
|
override func loadView() {
|
|
view = UIView()
|
|
view.backgroundColor = .clear
|
|
contentContainerView.frame = view.bounds
|
|
contentContainerView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
contentContainerView.backgroundColor = .clear
|
|
view.addSubview(contentContainerView)
|
|
installContentView()
|
|
}
|
|
|
|
required init?(coder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
}
|
|
|
|
private func installContentView() {
|
|
contentContainerView.subviews.forEach { $0.removeFromSuperview() }
|
|
guard let contentView else { return }
|
|
contentView.removeFromSuperview()
|
|
contentView.frame = contentContainerView.bounds
|
|
contentView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
|
contentContainerView.addSubview(contentView)
|
|
}
|
|
|
|
}
|