Skip to content

Commit

Permalink
Merge pull request #41 from amiantos/add-help-screen
Browse files Browse the repository at this point in the history
Add Help Screen
  • Loading branch information
amiantos authored Apr 10, 2023
2 parents 43853c8 + 73fcf4c commit c9d9c0d
Show file tree
Hide file tree
Showing 10 changed files with 189 additions and 184 deletions.
4 changes: 2 additions & 2 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ opt_in_rules:
- empty_count
- empty_string
line_length:
warning: 150
error: 200
warning: 300
error: 500
function_body_length:
warning: 300
error: 500
Expand Down
20 changes: 6 additions & 14 deletions GamebookEngine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
4451A4B7232DCD36003D9FE9 /* PreviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4451A4B6232DCD36003D9FE9 /* PreviewViewController.swift */; };
4451A4BA232DCD36003D9FE9 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4451A4B8232DCD36003D9FE9 /* MainInterface.storyboard */; };
4451A4BE232DCD36003D9FE9 /* GamebookPreviewExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 4451A4B2232DCD36003D9FE9 /* GamebookPreviewExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
44764DB829E1535C00CD95DD /* HelpView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44764DB729E1535C00CD95DD /* HelpView.swift */; };
44ADBA8623404BBB00855649 /* fileicon-iphone-44x58.png in Resources */ = {isa = PBXBuildFile; fileRef = 44ADBA8223404BBA00855649 /* fileicon-iphone-44x58.png */; };
44ADBA8723404BBB00855649 /* fileicon-ipad-64px.png in Resources */ = {isa = PBXBuildFile; fileRef = 44ADBA8323404BBB00855649 /* fileicon-ipad-64px.png */; };
44ADBA8823404BBB00855649 /* fileicon-iphone-22x29.png in Resources */ = {isa = PBXBuildFile; fileRef = 44ADBA8423404BBB00855649 /* fileicon-iphone-22x29.png */; };
Expand All @@ -47,7 +48,6 @@
B402FFEF2315FEFA00900020 /* MarkdownEditorViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B402FFED2315FEFA00900020 /* MarkdownEditorViewController.xib */; };
B402FFF22316055000900020 /* BRMarkdownParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = B402FFF12316055000900020 /* BRMarkdownParser.swift */; };
B402FFF5231613FA00900020 /* GameSerializer.swift in Sources */ = {isa = PBXBuildFile; fileRef = B402FFF4231613FA00900020 /* GameSerializer.swift */; };
B407897F2313587200D09F87 /* Help.md in Resources */ = {isa = PBXBuildFile; fileRef = B407897E2313587100D09F87 /* Help.md */; };
B407898223136E2F00D09F87 /* DecisionEditorRuleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B407898023136E2F00D09F87 /* DecisionEditorRuleTableViewCell.swift */; };
B407898323136E2F00D09F87 /* DecisionEditorRuleTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B407898123136E2F00D09F87 /* DecisionEditorRuleTableViewCell.xib */; };
B43EE2F0231F3FF7005D563D /* GameOverviewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B43EE2EF231F3FF7005D563D /* GameOverviewViewController.swift */; };
Expand Down Expand Up @@ -87,8 +87,6 @@
B4F7C1452311ACDC00EE055C /* Page+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F7C1432311ACDC00EE055C /* Page+CoreDataProperties.swift */; };
B4F7C1482311AEB800EE055C /* PageEditorConsequenceTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F7C1462311AEB800EE055C /* PageEditorConsequenceTableViewCell.swift */; };
B4F7C1492311AEB800EE055C /* PageEditorConsequenceTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B4F7C1472311AEB800EE055C /* PageEditorConsequenceTableViewCell.xib */; };
B4F7C14C2311B3E800EE055C /* HelpViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4F7C14A2311B3E700EE055C /* HelpViewController.swift */; };
B4F7C14D2311B3E800EE055C /* HelpViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = B4F7C14B2311B3E800EE055C /* HelpViewController.xib */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -143,6 +141,7 @@
4451A4B6232DCD36003D9FE9 /* PreviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewViewController.swift; sourceTree = "<group>"; };
4451A4B9232DCD36003D9FE9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
4451A4BB232DCD36003D9FE9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
44764DB729E1535C00CD95DD /* HelpView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpView.swift; sourceTree = "<group>"; };
44ADBA8223404BBA00855649 /* fileicon-iphone-44x58.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fileicon-iphone-44x58.png"; sourceTree = "<group>"; };
44ADBA8323404BBB00855649 /* fileicon-ipad-64px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fileicon-ipad-64px.png"; sourceTree = "<group>"; };
44ADBA8423404BBB00855649 /* fileicon-iphone-22x29.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "fileicon-iphone-22x29.png"; sourceTree = "<group>"; };
Expand All @@ -155,7 +154,6 @@
B402FFED2315FEFA00900020 /* MarkdownEditorViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MarkdownEditorViewController.xib; sourceTree = "<group>"; };
B402FFF12316055000900020 /* BRMarkdownParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BRMarkdownParser.swift; sourceTree = "<group>"; };
B402FFF4231613FA00900020 /* GameSerializer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameSerializer.swift; sourceTree = "<group>"; };
B407897E2313587100D09F87 /* Help.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = Help.md; sourceTree = "<group>"; };
B407898023136E2F00D09F87 /* DecisionEditorRuleTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DecisionEditorRuleTableViewCell.swift; sourceTree = "<group>"; };
B407898123136E2F00D09F87 /* DecisionEditorRuleTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DecisionEditorRuleTableViewCell.xib; sourceTree = "<group>"; };
B43EE2EF231F3FF7005D563D /* GameOverviewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameOverviewViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -197,8 +195,6 @@
B4F7C1432311ACDC00EE055C /* Page+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Page+CoreDataProperties.swift"; sourceTree = "<group>"; };
B4F7C1462311AEB800EE055C /* PageEditorConsequenceTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageEditorConsequenceTableViewCell.swift; sourceTree = "<group>"; };
B4F7C1472311AEB800EE055C /* PageEditorConsequenceTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PageEditorConsequenceTableViewCell.xib; sourceTree = "<group>"; };
B4F7C14A2311B3E700EE055C /* HelpViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpViewController.swift; sourceTree = "<group>"; };
B4F7C14B2311B3E800EE055C /* HelpViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HelpViewController.xib; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -262,7 +258,6 @@
B4F7C13F23118E4200EE055C /* Consequence Editor */,
B47F7BDA2310F78000BB072A /* Attribute List */,
444358B4230C56FD00A2E004 /* Page List */,
4497ED48232489C70038C6A9 /* Help */,
);
path = Editing;
sourceTree = "<group>";
Expand All @@ -288,12 +283,10 @@
path = GamebookPreviewExtension;
sourceTree = "<group>";
};
4497ED48232489C70038C6A9 /* Help */ = {
44764DB629E1534B00CD95DD /* Help */ = {
isa = PBXGroup;
children = (
B4F7C14A2311B3E700EE055C /* HelpViewController.swift */,
B4F7C14B2311B3E800EE055C /* HelpViewController.xib */,
B407897E2313587100D09F87 /* Help.md */,
44764DB729E1535C00CD95DD /* HelpView.swift */,
);
path = Help;
sourceTree = "<group>";
Expand Down Expand Up @@ -463,6 +456,7 @@
B4789FEF23188B8E008DBE9F /* Game List */,
444358C1230C7BA800A2E004 /* Playing */,
444358BC230C789900A2E004 /* Editing */,
44764DB629E1534B00CD95DD /* Help */,
440EF3F12323279D000A7C9F /* ContentSizedTableView.swift */,
B48C4B8223332297008C77ED /* ContainerView.swift */,
B48C4B8423332896008C77ED /* Alerts.swift */,
Expand Down Expand Up @@ -628,14 +622,12 @@
B4F7C1492311AEB800EE055C /* PageEditorConsequenceTableViewCell.xib in Resources */,
B47F7BDE2310F79900BB072A /* AttributeTableViewCell.xib in Resources */,
44ADBA8623404BBB00855649 /* fileicon-iphone-44x58.png in Resources */,
B4F7C14D2311B3E800EE055C /* HelpViewController.xib in Resources */,
B47F7BD92310F77B00BB072A /* AttributesTableViewController.xib in Resources */,
4417DC2A2314867C00A6F96B /* RuleEditorViewController.xib in Resources */,
B4789FEA231887E3008DBE9F /* GameListTableViewController.xib in Resources */,
444358BA230C665E00A2E004 /* PagesTableViewController.xib in Resources */,
B4B6B3BA23174CBD00E72320 /* MetadataEditorViewController.xib in Resources */,
B402FFEF2315FEFA00900020 /* MarkdownEditorViewController.xib in Resources */,
B407897F2313587200D09F87 /* Help.md in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -696,8 +688,8 @@
4439E662230B534D00C6A23C /* Consequence+CoreDataClass.swift in Sources */,
4439E65D230B534D00C6A23C /* Game+CoreDataProperties.swift in Sources */,
B48C4B8523332896008C77ED /* Alerts.swift in Sources */,
B4F7C14C2311B3E800EE055C /* HelpViewController.swift in Sources */,
B4A13AD5230F6D24004929B8 /* PageEditorDecisionTableViewCell.swift in Sources */,
44764DB829E1535C00CD95DD /* HelpView.swift in Sources */,
B48C4B8323332297008C77ED /* ContainerView.swift in Sources */,
B448874F23063A0D000E2FDD /* AppDelegate.swift in Sources */,
B4B6B3B523170B9F00E72320 /* CodableModels.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class GameOverviewViewController: UIViewController, PagesTableViewDelegate {
navigationItem.leftBarButtonItem = exitButton
navigationItem.rightBarButtonItem = metaButton

navigationItem.backBarButtonItem = UIBarButtonItem(
title: "Overview", style: .plain, target: nil, action: nil
)

searchButton = UIButton()
searchButton.translatesAutoresizingMaskIntoConstraints = false
searchButton.addTarget(self, action: #selector(searchButtonTapped), for: .touchUpInside)
Expand Down
29 changes: 0 additions & 29 deletions GamebookEngine/Views/Editing/Help/Help.md

This file was deleted.

24 changes: 0 additions & 24 deletions GamebookEngine/Views/Editing/Help/HelpViewController.swift

This file was deleted.

54 changes: 0 additions & 54 deletions GamebookEngine/Views/Editing/Help/HelpViewController.xib

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2019 Brad Root. All rights reserved.
//

import SwiftUI
import UIKit

protocol PageEditorDelegate: AnyObject {
Expand Down Expand Up @@ -122,11 +123,11 @@ class PageEditorViewController: UIViewController {

addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(showAddActionSheet))
backButton = UIBarButtonItem(title: "Prev Page", style: .plain, target: self, action: #selector(goToPreviousPage))
mapButton = UIBarButtonItem(title: "Overview", style: .plain, target: self, action: #selector(exitAction))
helpButton = UIBarButtonItem(title: "Help", style: .plain, target: self, action: #selector(helpAction))
helpButton = UIBarButtonItem(image: UIImage(systemName: "questionmark.circle"), style: .plain, target: self, action: #selector(helpAction))

navigationItem.leftItemsSupplementBackButton = true
navigationItem.rightBarButtonItems = [addButton, backButton]
navigationItem.leftBarButtonItems = [mapButton, helpButton]
navigationItem.leftBarButtonItems = [helpButton]

navigationItem.largeTitleDisplayMode = .never

Expand Down Expand Up @@ -218,7 +219,10 @@ class PageEditorViewController: UIViewController {
}

@objc func helpAction() {
navigationController?.pushViewController(HelpViewController(), animated: true)
let swiftUIViewController = UIHostingController(rootView: HelpView())
swiftUIViewController.modalPresentationStyle = .pageSheet
// present(swiftUIViewController, animated: true, completion: nil)
navigationController?.pushViewController(swiftUIViewController, animated: true)
}

@objc func exitAction() {
Expand Down
Loading

0 comments on commit c9d9c0d

Please sign in to comment.