diff --git a/main/Common Classes/Prefs.swift b/main/Common Classes/Prefs.swift index 80b25e0..f73d5c9 100644 --- a/main/Common Classes/Prefs.swift +++ b/main/Common Classes/Prefs.swift @@ -33,6 +33,10 @@ extension Prefs { get { Prefs.Bool("didShowTutorialRecordings") } set { Prefs.Bool("didShowTutorialRecordings", newValue) } } + static var RecordingHowTo: Bool { + get { Prefs.Bool("didShowTutorialRecordingHowTo") } + set { Prefs.Bool("didShowTutorialRecordingHowTo", newValue) } + } } } diff --git a/main/Recordings/VCRecordings.swift b/main/Recordings/VCRecordings.swift index 1aac728..9bc927f 100644 --- a/main/Recordings/VCRecordings.swift +++ b/main/Recordings/VCRecordings.swift @@ -23,7 +23,15 @@ class VCRecordings: UIViewController, UINavigationControllerDelegate { updateUI(setRecording: false, animated: false) } if !Prefs.DidShowTutorial.Recordings { - self.perform(#selector(showTutorial), with: nil, afterDelay: 0.5) + DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { + let x = TutorialSheet() + x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-1")) + x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-2")) + x.buttonTitleDone = "Got it" + x.present { + Prefs.DidShowTutorial.Recordings = true + } + } } } @@ -41,6 +49,15 @@ class VCRecordings: UIViewController, UINavigationControllerDelegate { navigationController?.setNavigationBarHidden(false, animated: animated) } + @IBAction private func showInfo(_ sender: UIButton?) { + let x = TutorialSheet() + x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-howto")) + x.buttonTitleDone = "Close" + x.present() { + Prefs.DidShowTutorial.RecordingHowTo = true + } + } + // MARK: Start New Recording @@ -53,6 +70,10 @@ class VCRecordings: UIViewController, UINavigationControllerDelegate { }.presentIn(self) return } + guard Prefs.DidShowTutorial.RecordingHowTo else { + showInfo(nil) // show at least once. Later, user can click the help icon. + return + } currentRecording = RecordingsDB.startNew() QLog.Debug("start recording #\(currentRecording!.id)") let longterm = sender.selectedSegmentIndex == 1 @@ -120,24 +141,4 @@ class VCRecordings: UIViewController, UINavigationControllerDelegate { stopButton.setTitle(valid ? "Stop" : slow ? "Cancel" : "Discard", for: .normal) } } - - - // MARK: Tutorial View Controller - - @IBAction private func showInfo(_ sender: UIButton) { - let x = TutorialSheet() - x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-howto")) - x.buttonTitleDone = "Close" - x.present() - } - - @objc private func showTutorial() { - let x = TutorialSheet() - x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-1")) - x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-2")) - x.buttonTitleDone = "Got it" - x.present { - Prefs.DidShowTutorial.Recordings = true - } - } } diff --git a/media/tutorials/tut-recording-howto.md b/media/tutorials/tut-recording-howto.md index 3399331..4f4fbed 100644 --- a/media/tutorials/tut-recording-howto.md +++ b/media/tutorials/tut-recording-howto.md @@ -1,6 +1,6 @@ # How to record? -There are two types: app specific recordings and general background activity. The former are usually 3 – 5 minutes long, the latter need to be at least an hour long. +Before you begin, there are two types of recordings: app specific recordings and general background activity. The former are usually 3 – 5 minutes long, the latter need to be at least an hour long. ## App recording