- 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
32 lines
654 B
Swift
32 lines
654 B
Swift
|
|
import Foundation
|
|
|
|
enum RDEPUBSelectionState: Equatable {
|
|
|
|
case idle
|
|
|
|
case selecting(anchor: Int)
|
|
|
|
case selected(RDEPUBSelection)
|
|
|
|
case committingAction(RDEPUBSelection, action: RDEPUBAnnotationMenuAction)
|
|
|
|
var hasSelection: Bool {
|
|
switch self {
|
|
case .idle:
|
|
return false
|
|
case .selecting, .selected, .committingAction:
|
|
return true
|
|
}
|
|
}
|
|
|
|
var selection: RDEPUBSelection? {
|
|
switch self {
|
|
case .idle, .selecting:
|
|
return nil
|
|
case .selected(let selection), .committingAction(let selection, _):
|
|
return selection
|
|
}
|
|
}
|
|
}
|