|
7 | 7 |
|
8 | 8 | import SwiftUI
|
9 | 9 |
|
| 10 | +/// A type that represents your presentation slide. |
| 11 | +/// This represents one page of your presentation. |
| 12 | +/// |
| 13 | +/// You can make your slide like this. |
| 14 | +/// ```swift |
| 15 | +/// struct SampleSlide: Slide { |
| 16 | +/// |
| 17 | +/// enum Substep: Int, PhasedState { |
| 18 | +/// case initial, second, third |
| 19 | +/// } |
| 20 | +/// |
| 21 | +/// @Phase var phasedStateStore: PhasedStateStore<Substep> |
| 22 | +/// |
| 23 | +/// var body: some View { |
| 24 | +/// HeaderSlide("Phased Slide") { |
| 25 | +/// Item("1st step", accessory: 1) |
| 26 | +/// |
| 27 | +/// if phasedStateStore.after(.second) { |
| 28 | +/// Item("2nd step", accessory: 2) |
| 29 | +/// } |
| 30 | +/// if phasedStateStore.after(.third) { |
| 31 | +/// Item("3rd step", accessory: 3) |
| 32 | +/// } |
| 33 | +/// } |
| 34 | +/// } |
| 35 | +/// } |
| 36 | +/// ``` |
10 | 37 | public protocol Slide: View {
|
11 | 38 |
|
| 39 | + /// A type which shows sub-steps in your slide. |
| 40 | + /// The default type is ``SimplePhasedState``. |
12 | 41 | associatedtype SlidePhasedState: PhasedState
|
| 42 | + |
13 | 43 | typealias Phase = PhaseWrapper<SlidePhasedState>
|
14 | 44 |
|
| 45 | + /// A store which controls current ``SlidePhasedState``. |
| 46 | + /// |
| 47 | + /// You can get current ``SlidePhasedState`` and forward / back it. |
| 48 | + /// > Note: The property must be defined with ``Phase`` like the bellow. |
| 49 | + /// |
| 50 | + /// ```swift |
| 51 | + /// @Phase var phasedStateStore: PhasedStateStore<SlidePhasedState> |
| 52 | + /// ``` |
15 | 53 | var phasedStateStore: PhasedStateStore<SlidePhasedState> { get }
|
16 | 54 |
|
| 55 | + /// A script for the current slide. The script will be shown on presenter view (macOS only). |
| 56 | + /// The default value is an empty String. |
17 | 57 | var script: String { get }
|
18 | 58 |
|
| 59 | + /// A boolean value indicating whether the slide index at the right bottom is hidden or not. |
| 60 | + /// The default value is `false` |
19 | 61 | var shouldHideIndex: Bool { get }
|
20 | 62 | }
|
21 | 63 |
|
|
0 commit comments