Tiny markdown parser, makes tutorial screens editing much simpler

This commit is contained in:
relikd
2020-08-31 17:10:11 +02:00
parent ff4218981f
commit 8bb77ef741
13 changed files with 182 additions and 94 deletions

View File

@@ -126,49 +126,15 @@ class VCRecordings: UIViewController, UINavigationControllerDelegate {
@IBAction private func showInfo(_ sender: UIButton) {
let x = TutorialSheet()
x.addSheet().addArrangedSubview(QuickUI.text(attributed: NSMutableAttributedString()
.h1("How to record?\n")
.normal("\nThere are two types: specific app recordings and general background activity. " +
"The former are usually 3  5 minutes long, the latter need to be at least an hour long.")
.h2("\n\nApp recording\n")
.normal("Before you begin make sure that you quit all running applications and wait a few seconds. " +
"Tap on the 'App' recording button and switch to the application you'd like to inspect. " +
"Use the App as you would normally. Try to get to all corners and functionality the App provides. " +
"When you feel that you have captured enough content, come back to ").italic("AppCheck").normal(" and stop the recording.")
.h2("\n\nBackground recording\n")
.normal("Will answer one simple question: What communications happen while you aren't using your device. " +
"You should solely start a background recording when you know you aren't going to use your device in the near future. " +
"For example, before you go to bed.\n" +
"As soon as you start using your device, you should stop the recording to avoid distorting the results.")
.h2("\n\nFinish\n")
.normal("Upon completion you will find your recording in the section below. " +
"You can review your results and remove any user specific information if necessary.\n")
))
x.addSheet().addArrangedSubview(TinyMarkdown.load("tut-recording-howto"))
x.buttonTitleDone = "Close"
x.present()
}
@objc private func showTutorial() {
let x = TutorialSheet()
x.addSheet().addArrangedSubview(QuickUI.text(attributed: NSMutableAttributedString()
.h1("What are Recordings?\n")
.normal("\nSimilar to the default logging, recordings will intercept every request and log it for later review. " +
"App recordings are usually 3  5 minutes long and cover a single application. " +
"You can utilize recordings for App analysis or to get a ground truth on background traffic." +
"\n\n" +
"Optionally, you can help us by providing your app specific recordings. " +
"Together with your findings we can create a community driven privacy monitor. " +
"The research results will help you and others avoid Apps that unnecessarily share data with third-party providers.")
))
x.addSheet().addArrangedSubview(QuickUI.text(attributed: NSMutableAttributedString()
.h1("Share results\n")
.normal("\nThis step is completely ").bold("optional").normal(". " +
"You can choose to share your results with us. " +
"We can compare similar applications and suggest privacy friendly alternatives. " +
"Together with other likeminded individuals we can increase the awareness for privacy friendly design." +
"\n\n" +
"Thank you very much.")
))
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