Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tutorial option in the "More" tab #755

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Apps/.DS_Store
Binary file not shown.
Binary file added Apps/OneBusAway/.DS_Store
Binary file not shown.
Binary file added Apps/OneBusAway/Assets.xcassets/.DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions Apps/OneBusAway/Assets.xcassets/AppIcon 1.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
11 changes: 11 additions & 0 deletions OBAKit/Settings/MoreViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ public class MoreViewController: UIViewController,
comment: "Header for a section that shows the user information about this app.")

return OBAListViewSection(id: "about", title: header, contents: [
OBAListRowView.DefaultViewModel(
title: OBALoc(
"more_controller.tutorial_row_title",
value: "Tutorial",
comment: "A link to how to use the App"),
onSelectAction: { _ in
guard let url = Bundle.main.TutorialURL else { return }
let safari = SFSafariViewController(url: url)
self.application.viewRouter.present(safari, from: self)
}),

OBAListRowView.DefaultViewModel(
title: OBALoc(
"more_controller.credits_row_title",
Expand Down
3 changes: 3 additions & 0 deletions OBAKit/Strings/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@
/* A link to the app's Privacy Policy */
"more_controller.privacy_row_title" = "Privacy Policy";

/* A link to the app's Tutorial */
"more_controller.tutorial_row_title" = "Tutorial";

/* Title of the More tab */
"more_controller.title" = "More";

Expand Down
Binary file added OBAKitCore/.DS_Store
Binary file not shown.
9 changes: 9 additions & 0 deletions OBAKitCore/Extensions/FoundationExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ public extension Bundle {

return URL(string: str)
}
/// A helper method for accessing the bundle's Tutorial URL
var TutorialURL: URL? {
guard
let dict = OBAKitConfig,
let str = dict["TutorialURL"] as? String
else { return nil }

return URL(string: str)
}

var appDevelopersEmailAddress: String? {
guard let dict = OBAKitConfig else { return nil }
Expand Down
Binary file added OBAKitCore/Models/.DS_Store
Binary file not shown.