Skip to content

Commit a9eaf35

Browse files
committed
Work on onboarding
1 parent a54a57d commit a9eaf35

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

GUI/Metal/Layers/Onboarding.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ class OnboardingLayerViewController: NSViewController {
5959

6060
@IBOutlet weak var pageContainerView: OnboardingPageContainerView!
6161
@IBOutlet weak var pageDotIndicator: PageDotsIndicator!
62+
@IBOutlet weak var nextButton: NSButton!
63+
@IBOutlet weak var prevButton: NSButton!
64+
@IBOutlet weak var skipButton: NSButton!
65+
6266
var layer: Onboarding!
6367

6468
private var pages: [NSViewController] = []
@@ -73,15 +77,13 @@ class OnboardingLayerViewController: NSViewController {
7377

7478
override func viewDidAppear() {
7579

76-
print("View did appear...")
77-
7880
func instantiate(_ id: String) -> NSViewController {
7981

8082
let storyboard = NSStoryboard(name: "Onboarding", bundle: nil)
8183
return storyboard.instantiateController(withIdentifier: id) as! NSViewController
8284
}
8385

84-
// Remove all child view controllers and their views
86+
// Start over by removing all child view controllers and their views
8587
for child in children {
8688
child.view.removeFromSuperview()
8789
child.removeFromParent()
@@ -139,6 +141,8 @@ class OnboardingLayerViewController: NSViewController {
139141
}
140142

141143
currentPageIndex = index
144+
prevButton.isEnabled = currentPageIndex > 0
145+
nextButton.title = currentPageIndex == pages.count - 1 ? "Finish" : "Continue"
142146
}
143147

144148
@IBAction func nextPage(_ sender: Any?) {

GUI/XIB files/Onboarding.storyboard

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,11 @@ DQ
7676
</subviews>
7777
</view>
7878
<connections>
79+
<outlet property="nextButton" destination="PDd-Tl-hJY" id="Hc8-IX-Odw"/>
7980
<outlet property="pageContainerView" destination="Uot-uQ-lVb" id="bvy-nm-GHT"/>
8081
<outlet property="pageDotIndicator" destination="vad-mh-PS5" id="iGw-vp-icG"/>
82+
<outlet property="prevButton" destination="Z3E-sm-lCI" id="CSU-IQ-rNI"/>
83+
<outlet property="skipButton" destination="DYH-SO-7ZG" id="I7C-Xc-cgf"/>
8184
</connections>
8285
</viewController>
8386
<customObject id="Ba7-d5-KMO" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>

0 commit comments

Comments
 (0)