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

Adding a static menu and necessary components #324

Merged
merged 17 commits into from
Jun 11, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Emojis for the following are chosen based on [gitmoji](https://gitmoji.dev/).

- German indefinite pronouns are now selectable from the case-declension display.
- German imperfect verb conjugations now insert both the auxiliary verb and the past participle with the cursor between them.
- Adds a new menu to the Scribe app allowing users to set their preferences for their respective language keyboards!

# Scribe-iOS 2.3.0

Expand Down
104 changes: 100 additions & 4 deletions Scribe.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
1406B7872A2DFCDD001DF45B /* AboutTableData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1406B7862A2DFCDD001DF45B /* AboutTableData.swift */; };
147797AC2A2CD2F70044A53E /* ParentTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147797AA2A2CD2F70044A53E /* ParentTableViewCell.swift */; };
147797AD2A2CD2F70044A53E /* ParentTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 147797AB2A2CD2F70044A53E /* ParentTableViewCell.xib */; };
147797B02A2CD3370044A53E /* InfoChildTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147797AE2A2CD3370044A53E /* InfoChildTableViewCell.swift */; };
147797B12A2CD3370044A53E /* InfoChildTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 147797AF2A2CD3370044A53E /* InfoChildTableViewCell.xib */; };
147797B32A2CD5AB0044A53E /* ParentTableCellModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147797B22A2CD5AB0044A53E /* ParentTableCellModel.swift */; };
147797B52A2CFB490044A53E /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147797B42A2CFB490044A53E /* SettingsViewController.swift */; };
147797C02A2D0CDF0044A53E /* SettingsTableData.swift in Sources */ = {isa = PBXBuildFile; fileRef = 147797BF2A2D0CDF0044A53E /* SettingsTableData.swift */; };
14AC56842A24AED3006B1DDF /* AboutViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14AC56832A24AED3006B1DDF /* AboutViewController.swift */; };
14AC568A2A261663006B1DDF /* InformationScreenVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14AC56892A261663006B1DDF /* InformationScreenVC.swift */; };
30453951293B9106003AE55B /* ENAppText.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A2DCB027AD37BD0057A10D /* ENAppText.swift */; };
30453952293B9106003AE55B /* ENAppText.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A2DCB027AD37BD0057A10D /* ENAppText.swift */; };
30453953293B9107003AE55B /* ENAppText.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1A2DCB027AD37BD0057A10D /* ENAppText.swift */; };
Expand Down Expand Up @@ -87,7 +97,7 @@
30489C252936DB0100B59393 /* ToolTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30489C1D2936DAB700B59393 /* ToolTipView.swift */; };
30489C262936DB0200B59393 /* ToolTipView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 30489C1D2936DAB700B59393 /* ToolTipView.swift */; };
38BD213422D5907F00C6795D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38BD213322D5907F00C6795D /* AppDelegate.swift */; };
38BD213622D5907F00C6795D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38BD213522D5907F00C6795D /* ViewController.swift */; };
38BD213622D5907F00C6795D /* InstallationVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38BD213522D5907F00C6795D /* InstallationVC.swift */; };
38BD213922D5907F00C6795D /* AppScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 38BD213722D5907F00C6795D /* AppScreen.storyboard */; };
38BD213E22D5908100C6795D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 38BD213D22D5908100C6795D /* Assets.xcassets */; };
38BD214122D5908100C6795D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 38BD213F22D5908100C6795D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -790,6 +800,16 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
1406B7862A2DFCDD001DF45B /* AboutTableData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutTableData.swift; sourceTree = "<group>"; };
147797AA2A2CD2F70044A53E /* ParentTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentTableViewCell.swift; sourceTree = "<group>"; };
147797AB2A2CD2F70044A53E /* ParentTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ParentTableViewCell.xib; sourceTree = "<group>"; };
147797AE2A2CD3370044A53E /* InfoChildTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoChildTableViewCell.swift; sourceTree = "<group>"; };
147797AF2A2CD3370044A53E /* InfoChildTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoChildTableViewCell.xib; sourceTree = "<group>"; };
147797B22A2CD5AB0044A53E /* ParentTableCellModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentTableCellModel.swift; sourceTree = "<group>"; };
147797B42A2CFB490044A53E /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
147797BF2A2D0CDF0044A53E /* SettingsTableData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsTableData.swift; sourceTree = "<group>"; };
14AC56832A24AED3006B1DDF /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = "<group>"; };
14AC56892A261663006B1DDF /* InformationScreenVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InformationScreenVC.swift; sourceTree = "<group>"; };
30453963293B9D18003AE55B /* InformationToolTipData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InformationToolTipData.swift; sourceTree = "<group>"; };
30453966293B9D31003AE55B /* ViewThemeable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewThemeable.swift; sourceTree = "<group>"; };
30453968293B9DB4003AE55B /* ToolTipViewUpdatable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipViewUpdatable.swift; sourceTree = "<group>"; };
Expand All @@ -799,7 +819,7 @@
30489C1D2936DAB700B59393 /* ToolTipView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolTipView.swift; sourceTree = "<group>"; };
38BD213022D5907E00C6795D /* Scribe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Scribe.app; sourceTree = BUILT_PRODUCTS_DIR; };
38BD213322D5907F00C6795D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
38BD213522D5907F00C6795D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
38BD213522D5907F00C6795D /* InstallationVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallationVC.swift; sourceTree = "<group>"; };
38BD213822D5907F00C6795D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/AppScreen.storyboard; sourceTree = "<group>"; };
38BD213D22D5908100C6795D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
38BD214022D5908100C6795D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1017,6 +1037,67 @@
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
1406B7832A2DFCA2001DF45B /* Components */ = {
isa = PBXGroup;
children = (
1406B7852A2DFCBE001DF45B /* InfoChildTableViewCell */,
1406B7842A2DFCAB001DF45B /* ParentTableViewCell */,
);
path = Components;
sourceTree = "<group>";
};
1406B7842A2DFCAB001DF45B /* ParentTableViewCell */ = {
isa = PBXGroup;
children = (
147797AA2A2CD2F70044A53E /* ParentTableViewCell.swift */,
147797AB2A2CD2F70044A53E /* ParentTableViewCell.xib */,
);
path = ParentTableViewCell;
sourceTree = "<group>";
};
1406B7852A2DFCBE001DF45B /* InfoChildTableViewCell */ = {
isa = PBXGroup;
children = (
147797AE2A2CD3370044A53E /* InfoChildTableViewCell.swift */,
147797AF2A2CD3370044A53E /* InfoChildTableViewCell.xib */,
);
path = InfoChildTableViewCell;
sourceTree = "<group>";
};
1406B7882A2DFE4C001DF45B /* InstallationTab */ = {
isa = PBXGroup;
children = (
38BD213522D5907F00C6795D /* InstallationVC.swift */,
);
path = InstallationTab;
sourceTree = "<group>";
};
147797A92A2CD2B50044A53E /* AboutTab */ = {
isa = PBXGroup;
children = (
14AC56832A24AED3006B1DDF /* AboutViewController.swift */,
1406B7862A2DFCDD001DF45B /* AboutTableData.swift */,
);
path = AboutTab;
sourceTree = "<group>";
};
147797B62A2CFB560044A53E /* SettingsTab */ = {
isa = PBXGroup;
children = (
147797B42A2CFB490044A53E /* SettingsViewController.swift */,
147797BF2A2D0CDF0044A53E /* SettingsTableData.swift */,
);
path = SettingsTab;
sourceTree = "<group>";
};
14AC568D2A262EE5006B1DDF /* ViewControllers */ = {
isa = PBXGroup;
children = (
14AC56892A261663006B1DDF /* InformationScreenVC.swift */,
);
path = ViewControllers;
sourceTree = "<group>";
};
30453961293B9D05003AE55B /* ToolTip */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1086,11 +1167,16 @@
38BD213222D5907F00C6795D /* Scribe */ = {
isa = PBXGroup;
children = (
1406B7882A2DFE4C001DF45B /* InstallationTab */,
147797B62A2CFB560044A53E /* SettingsTab */,
147797A92A2CD2B50044A53E /* AboutTab */,
D1A2DCAF27AD378F0057A10D /* AppTexts */,
14AC568D2A262EE5006B1DDF /* ViewControllers */,
1406B7832A2DFCA2001DF45B /* Components */,
147797B22A2CD5AB0044A53E /* ParentTableCellModel.swift */,
38BD213322D5907F00C6795D /* AppDelegate.swift */,
D17193C327AEAD7D0038660B /* AppStyling.swift */,
D1A2DCB327AD3EB50057A10D /* AppUISymbols.swift */,
38BD213522D5907F00C6795D /* ViewController.swift */,
38BD213722D5907F00C6795D /* AppScreen.storyboard */,
38BD213F22D5908100C6795D /* LaunchScreen.storyboard */,
38BD213D22D5908100C6795D /* Assets.xcassets */,
Expand Down Expand Up @@ -1716,7 +1802,9 @@
buildActionMask = 2147483647;
files = (
38BD214122D5908100C6795D /* LaunchScreen.storyboard in Resources */,
147797B12A2CD3370044A53E /* InfoChildTableViewCell.xib in Resources */,
38BD213922D5907F00C6795D /* AppScreen.storyboard in Resources */,
147797AD2A2CD2F70044A53E /* ParentTableViewCell.xib in Resources */,
38BD213E22D5908100C6795D /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1870,6 +1958,8 @@
D17193C027AEA33A0038660B /* AppTextStyling.swift in Sources */,
CE1378C428F5D7AC00E1CBC2 /* ScribeColor.swift in Sources */,
D171946527AF31770038660B /* Conjugate.swift in Sources */,
147797B52A2CFB490044A53E /* SettingsViewController.swift in Sources */,
1406B7872A2DFCDD001DF45B /* AboutTableData.swift in Sources */,
D171940827AECCE50038660B /* PTCommandVariables.swift in Sources */,
3045396D293B9DDC003AE55B /* ToolTipViewDatasource.swift in Sources */,
D111E9B227AFE79500746F92 /* Translate.swift in Sources */,
Expand All @@ -1880,15 +1970,19 @@
D17193C927AEC8F90038660B /* FR-AZERTYInterfaceVariables.swift in Sources */,
D1B81D4A27BBBA200085FE5E /* ITCommandVariables.swift in Sources */,
D180EC0328FDFABF0018E29B /* FRInterfaceVariables.swift in Sources */,
38BD213622D5907F00C6795D /* ViewController.swift in Sources */,
38BD213622D5907F00C6795D /* InstallationVC.swift in Sources */,
D171942D27AECEB80038660B /* DEInterfaceVariables.swift in Sources */,
D196B360279A051000228F3F /* ENPrivacyPolicy.swift in Sources */,
147797C02A2D0CDF0044A53E /* SettingsTableData.swift in Sources */,
14AC568A2A261663006B1DDF /* InformationScreenVC.swift in Sources */,
147797B02A2CD3370044A53E /* InfoChildTableViewCell.swift in Sources */,
D1A2DCB427AD3EB50057A10D /* AppUISymbols.swift in Sources */,
D171945427AF04E50038660B /* KeyboardViewController.swift in Sources */,
D171943827AEF0560038660B /* KeyboardStyling.swift in Sources */,
D111E9BA27AFE7B200746F92 /* Annotate.swift in Sources */,
CE1378CC28F5D7AC00E1CBC2 /* UIColor+ScribeColors.swift in Sources */,
D17193F027AECB350038660B /* SVInterfaceVariables.swift in Sources */,
147797AC2A2CD2F70044A53E /* ParentTableViewCell.swift in Sources */,
38BD213422D5907F00C6795D /* AppDelegate.swift in Sources */,
30489C1E2936DAB700B59393 /* ToolTipView.swift in Sources */,
3045396F293B9DF2003AE55B /* ToolTipViewTheme.swift in Sources */,
Expand All @@ -1910,11 +2004,13 @@
D1362A39274C106A00C00E48 /* ColorVariables.swift in Sources */,
D1A2DCB127AD37BD0057A10D /* ENAppText.swift in Sources */,
D171944927AEF7290038660B /* KeyboardKeys.swift in Sources */,
147797B32A2CD5AB0044A53E /* ParentTableCellModel.swift in Sources */,
3045396B293B9DC9003AE55B /* ToolTipViewDatasourceable.swift in Sources */,
D156BC0829CCDBE8007E7362 /* DEPrivacyPolicy.swift in Sources */,
D1B071A027C6A1AA00FD7DBD /* KeyAltChars.swift in Sources */,
D17693DE28FC8D6B00DF0FBB /* FR-QWERTYInterfaceVariables.swift in Sources */,
D1B0719727C63C9100FD7DBD /* KeyAnimation.swift in Sources */,
14AC56842A24AED3006B1DDF /* AboutViewController.swift in Sources */,
D171945527AF05D40038660B /* Extensions.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
38 changes: 38 additions & 0 deletions Scribe/AboutTab/AboutTableData.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// AboutTableData.swift
// Scribe
//
// Created by Saurabh Jamadagni on 05/06/23.
//

import Foundation

struct AboutTableData {
static var aboutTableData = [
ParentTableCellModel(
headingTitle: "Community",
section: [
Section(sectionTitle: "See the code on GitHub", imageString: "github", hasToggle: false),
Section(sectionTitle: "Chat with the team on Matrix", imageString: "matrix", hasToggle: false),
Section(sectionTitle: "Wikimedia and Scribe", imageString: "wikimedia", hasToggle: false),
Section(sectionTitle: "Share Scribe", imageString: "square.and.arrow.up", hasToggle: false)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey hey 👋

Would texts like these, the sectionTitles here, be good candidates for i18n? I see some support for it started already under ./Scribe/AppTexts. Thinking that the app texts here could be good ways as well to continue working i18n into Scribe.


Implementing via the below perhaps?

]
),
ParentTableCellModel(
headingTitle: "Feedback and support",
section: [
Section(sectionTitle: "Rate Scribe", imageString: "star", hasToggle: false),
Section(sectionTitle: "Report a bug", imageString: "ant", hasToggle: false),
Section(sectionTitle: "Send us an email", imageString: "envelope", hasToggle: false),
Section(sectionTitle: "Reset app hints", imageString: "lightbulb", hasToggle: false)
]
),
ParentTableCellModel(
headingTitle: "Legal",
section: [
Section(sectionTitle: "Privacy policy", imageString: "lock.shield", hasToggle: false),
Section(sectionTitle: "Third-party licenses", imageString: "thirdPartyLicenses", hasToggle: false)
]
)
]
}
55 changes: 55 additions & 0 deletions Scribe/AboutTab/AboutViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//
// AboutViewController.swift
// Scribe
//
// Created by Saurabh Jamadagni on 29/05/23.
//

import UIKit

class AboutViewController: UIViewController {

@IBOutlet weak var outerTable: UITableView!

let tableData = AboutTableData.aboutTableData

override func viewDidLoad() {
super.viewDidLoad()

self.title = "About Scribe"

let nib = UINib(nibName: "ParentTableViewCell", bundle: nil)
outerTable.register(nib, forCellReuseIdentifier: "ParentTableViewCell")

outerTable.dataSource = self
outerTable.delegate = self

outerTable.separatorStyle = .none
outerTable.backgroundColor = .clear
}
}


// MARK: UITableViewDataSource
/// Function implementation conforming to the UITableViewDataSource protocol.
extension AboutViewController: UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tableData.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

let cell = tableView.dequeueReusableCell(withIdentifier: "ParentTableViewCell", for: indexPath) as! ParentTableViewCell

cell.configureCell(for: tableData[indexPath.row])

cell.backgroundColor = .clear
cell.selectionStyle = .none

return cell
}
}

// MARK: UITableViewDelegate
/// Function implementation conforming to the UITableViewDelegate protocol.
extension AboutViewController: UITableViewDelegate { }
20 changes: 20 additions & 0 deletions Scribe/AppUISymbols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,23 @@ func getPrivacySymbol(fontSize: CGFloat) -> UIImage {

return privacySymbol
}

func getRequiredIconForMenu(fontSize: CGFloat, imageName: String) -> UIImage {
if let image = UIImage(named: imageName) {

return image
} else {
var iconSymbolConfig = UIImage.SymbolConfiguration(pointSize: fontSize * 0.25, weight: .medium, scale: .medium)
if DeviceType.isPad {
if UIScreen.main.bounds.height < UIScreen.main.bounds.width {
iconSymbolConfig = UIImage.SymbolConfiguration(pointSize: fontSize * 0.15, weight: .medium, scale: .medium)
} else {
iconSymbolConfig = UIImage.SymbolConfiguration(pointSize: fontSize * 0.2, weight: .medium, scale: .medium)
}
}

guard let image = UIImage(systemName: imageName, withConfiguration: iconSymbolConfig) else { return UIImage() }

return image
}
}
6 changes: 6 additions & 0 deletions Scribe/Assets.xcassets/MenuIcons/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
52 changes: 52 additions & 0 deletions Scribe/Assets.xcassets/MenuIcons/github.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"images" : [
{
"filename" : "github.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "github-dark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading