Compare commits

...

19 Commits
v1.0 ... main

Author SHA1 Message Date
maddiebaka 0f2cf4af04 Refactor and add legal links to payment pages, change contribute view's layout 2024-01-20 23:50:07 -05:00
maddiebaka 32b3ab5ee1 Add Contribution view with review and donation buttons 2023-12-20 20:35:44 -05:00
maddiebaka be9856a002 Add Non-Exempt Encryption property 2023-11-17 14:55:52 -05:00
maddiebaka e33e3402fc Update widget, iOS 17 + backwards compatibility 2023-11-17 14:48:51 -05:00
maddiebaka 9f9f4c6409 Add Legend button under advanced search 2023-11-17 14:15:27 -05:00
maddiefuzz 7c4b743061 Merge pull request 'Update french translation' (#1) from Infinita740/TokiTrainer:main into main
Reviewed-on: #1
2023-11-17 18:46:03 +00:00
Infinita740 5e262a903c Update french translation 2023-11-17 18:04:40 +00:00
maddiebaka 5a5e56cb66 UI update for advanced search options, search button 2023-11-17 11:46:10 -05:00
maddiebaka da83c34090 Add updated french translations 2023-11-07 12:22:49 -05:00
maddiebaka e2a6ecb341 Run XCode project recommendations update 2023-08-28 14:12:34 -04:00
maddiebaka fcd45115a8 Add french localization support for beta testing 2023-08-28 14:10:28 -04:00
Madeline d87ddbcd8c Comment out toki pona word matching in english mode 2022-11-04 04:09:20 -04:00
Madeline 0fea23b057 Hide keyboard on tap, more robust search algorithm, option to search by dictionary word or definition 2022-10-28 00:52:53 -04:00
Madeline c74a2f520c Fix json values for word "li" 2022-10-28 00:51:58 -04:00
Madeline 8dd57b6742 Version bump to 1.1 2022-10-26 16:54:30 -04:00
Madeline e893a04e13 More robust dictionary search feature, styling tweaks for widgets 2022-10-26 15:46:50 -04:00
Madeline 5999cc3533 Refactor, decompose and add previews. Fix part of speech sheet pop over 2022-10-08 08:35:14 -04:00
Madeline aae0b6c87e Add dictionary view and change how phrase lookup works 2022-10-08 06:36:19 -04:00
Avery Pace b27369596f Widget alpha finish 2021-12-12 06:36:54 -05:00
46 changed files with 9073 additions and 121 deletions

View File

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.396",
"green" : "0.263",
"red" : "0.392"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.702",
"green" : "0.545",
"red" : "0.698"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.895",
"green" : "0.893",
"red" : "0.894"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.895",
"green" : "0.893",
"red" : "0.894"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.927",
"green" : "0.924",
"red" : "0.919"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.927",
"green" : "0.924",
"red" : "0.919"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.702",
"green" : "0.545",
"red" : "0.698"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0.396",
"green" : "0.263",
"red" : "0.392"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>INEnums</key>
<array/>
<key>INIntentDefinitionModelVersion</key>
<string>1.2</string>
<key>INIntentDefinitionNamespace</key>
<string>88xZPY</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20A294</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12A6144</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.0</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescriptionID</key>
<string>tVvJ9c</string>
<key>INIntentEligibleForWidgets</key>
<true/>
<key>INIntentIneligibleForSuggestions</key>
<true/>
<key>INIntentName</key>
<string>Configuration</string>
<key>INIntentResponse</key>
<dict>
<key>INIntentResponseCodes</key>
<array>
<dict>
<key>INIntentResponseCodeName</key>
<string>success</string>
<key>INIntentResponseCodeSuccess</key>
<true/>
</dict>
<dict>
<key>INIntentResponseCodeName</key>
<string>failure</string>
</dict>
</array>
</dict>
<key>INIntentTitle</key>
<string>Configuration</string>
<key>INIntentTitleID</key>
<string>gpCwrM</string>
<key>INIntentType</key>
<string>Custom</string>
<key>INIntentVerb</key>
<string>View</string>
</dict>
</array>
<key>INTypes</key>
<array/>
</dict>
</plist>

View File

@ -0,0 +1,111 @@
//
// Toki_Trainer_Widgets.swift
// Toki Trainer Widgets
//
// Created by Avery Ada Pace on 12/3/21.
//
import WidgetKit
import SwiftUI
import Intents
struct Provider: IntentTimelineProvider {
var tokiJSONLoader = TokiJSONLoader()
var tokiDictionary: [TokiDictEntry]
init() {
tokiDictionary = tokiJSONLoader.loadDictionary()!
}
func getRandomEntry(configuration: ConfigurationIntent) -> DefinitionEntry {
let randomDictionary = tokiDictionary.shuffled()
let entry = DefinitionEntry(date: Date(), configuration: configuration, word: randomDictionary.first!.word, definition: randomDictionary.first!.definitions[0].definition)
return entry
}
func placeholder(in context: Context) -> DefinitionEntry {
getRandomEntry(configuration: ConfigurationIntent())
}
func getSnapshot(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (DefinitionEntry) -> ()) {
let entry = getRandomEntry(configuration: configuration)
completion(entry)
}
func getTimeline(for configuration: ConfigurationIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
var entries: [DefinitionEntry] = []
for _ in 0...5 {
entries.append(getRandomEntry(configuration: configuration))
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
struct DefinitionEntry: TimelineEntry {
let date: Date
let configuration: ConfigurationIntent
let word: String
let definition: String
}
struct Toki_Trainer_WidgetsEntryView : View {
var entry: Provider.Entry
var body: some View {
ZStack {
//Color("LightPurple")
VStack(alignment: .leading) {
Text(entry.word)
.foregroundColor(Color("FontColorTitle"))
.font(.title)
.frame(maxWidth: .infinity, alignment: .topLeading)
.padding(8)
Text(entry.definition)
.foregroundColor(Color("FontColorSubtitle"))
.frame(maxWidth: .infinity, alignment: .leading)
.padding(8)
}
}
.widgetBackground(backgroundView: Color("LightPurple"))
}
}
extension View {
func widgetBackground(backgroundView: some View) -> some View {
if #available(iOSApplicationExtension 17.0, *) {
return containerBackground(for: .widget) {
Color("LightPurple")
}
} else {
return background(Color("LightPurple"))
}
}
}
@main
struct Toki_Trainer_Widgets: Widget {
let kind: String = "Toki_Trainer_Widgets"
var body: some WidgetConfiguration {
IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
Toki_Trainer_WidgetsEntryView(entry: entry)
}
.configurationDisplayName("Toki Pona Random Word")
.description("Gives you a random word of the moment.")
.supportedFamilies([.systemSmall, .systemMedium])
}
}
struct Toki_Trainer_Widgets_Previews: PreviewProvider {
static var tokiDictionary: [TokiDictEntry] = TokiJSONLoader().loadDictionary()!.shuffled()
static var previews: some View {
Toki_Trainer_WidgetsEntryView(entry: DefinitionEntry(date: Date(), configuration: ConfigurationIntent(), word: tokiDictionary.first!.word, definition: tokiDictionary.first!.definitions[0].definition))
.previewContext(WidgetPreviewContext(family: .systemSmall))
}
}

View File

@ -12,13 +12,22 @@
7E2811172733027F0063DC78 /* TokiDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811142733027F0063DC78 /* TokiDictionary.swift */; };
7E2811182733027F0063DC78 /* TokiJSONLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811152733027F0063DC78 /* TokiJSONLoader.swift */; };
7E2811192733027F0063DC78 /* TokiPartOfSpeech.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811162733027F0063DC78 /* TokiPartOfSpeech.swift */; };
7E28111C273302860063DC78 /* toki-partsofspeech.json in Resources */ = {isa = PBXBuildFile; fileRef = 7E28111A273302860063DC78 /* toki-partsofspeech.json */; };
7E28111D273302860063DC78 /* toki-dictionary.json in Resources */ = {isa = PBXBuildFile; fileRef = 7E28111B273302860063DC78 /* toki-dictionary.json */; };
7E28112227330DD30063DC78 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E28112127330DD20063DC78 /* Constants.swift */; };
7E449775275AA0600016B6DC /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E449774275AA0600016B6DC /* WidgetKit.framework */; };
7E449777275AA0600016B6DC /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E449776275AA0600016B6DC /* SwiftUI.framework */; };
7E44977A275AA0600016B6DC /* Toki_Trainer_Widgets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E449779275AA0600016B6DC /* Toki_Trainer_Widgets.swift */; };
7E44977D275AA0620016B6DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7E44977C275AA0620016B6DC /* Assets.xcassets */; };
7E44977F275AA0620016B6DC /* Toki_Trainer_Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 7E44977B275AA0600016B6DC /* Toki_Trainer_Widgets.intentdefinition */; };
7E449780275AA0620016B6DC /* Toki_Trainer_Widgets.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 7E44977B275AA0600016B6DC /* Toki_Trainer_Widgets.intentdefinition */; };
7E449783275AA0620016B6DC /* Toki Trainer WidgetsExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 7E449772275AA0600016B6DC /* Toki Trainer WidgetsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
7E449788275ABF5C0016B6DC /* TokiJSONLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811152733027F0063DC78 /* TokiJSONLoader.swift */; };
7E449789275ABF5C0016B6DC /* TokiLesson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E716B3D273986E5009E2CF6 /* TokiLesson.swift */; };
7E44978A275ABF5C0016B6DC /* TokiPartOfSpeech.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811162733027F0063DC78 /* TokiPartOfSpeech.swift */; };
7E44978B275ABF5C0016B6DC /* TokiDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E2811142733027F0063DC78 /* TokiDictionary.swift */; };
7E44978C275ABF690016B6DC /* TokiDictionaryViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E20D6002734466800D75B9A /* TokiDictionaryViewModel.swift */; };
7E716B3E273986E5009E2CF6 /* TokiLesson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E716B3D273986E5009E2CF6 /* TokiLesson.swift */; };
7E716B4227398CDF009E2CF6 /* FlashCardLessonsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E716B4127398CDF009E2CF6 /* FlashCardLessonsView.swift */; };
7E716B4427398D3D009E2CF6 /* FlashCardLessonsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E716B4327398D3D009E2CF6 /* FlashCardLessonsViewModel.swift */; };
7E716B462739B968009E2CF6 /* FlashCardLessonResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E716B452739B968009E2CF6 /* FlashCardLessonResultsView.swift */; };
7E71E6ED2735D70C007CFF72 /* FlashCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E71E6EC2735D70C007CFF72 /* FlashCardView.swift */; };
7E71E6F12736DAE4007CFF72 /* FlashCardsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E71E6F02736DAE4007CFF72 /* FlashCardsViewModel.swift */; };
7E943A21273211C200E7DDF4 /* Toki_TrainerApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E943A20273211C200E7DDF4 /* Toki_TrainerApp.swift */; };
@ -27,23 +36,64 @@
7E943A28273211C300E7DDF4 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7E943A27273211C300E7DDF4 /* Preview Assets.xcassets */; };
7E943A2A273211C300E7DDF4 /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7E943A29273211C300E7DDF4 /* Persistence.swift */; };
7E943A2D273211C300E7DDF4 /* Toki_Trainer.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 7E943A2B273211C300E7DDF4 /* Toki_Trainer.xcdatamodeld */; };
7EBAE6AA273D65FD00BCFA09 /* toki-lessons.json in Resources */ = {isa = PBXBuildFile; fileRef = 7EBAE6A9273D65FD00BCFA09 /* toki-lessons.json */; };
7EF546162737B8FB00537AE6 /* FlashCardResultsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EF546152737B8FA00537AE6 /* FlashCardResultsView.swift */; };
C13909F62B30ACC300B235EE /* TransactionObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C13909F52B30ACC300B235EE /* TransactionObserver.swift */; };
C13FCE342A9D170B00E8976B /* toki-dictionary.json in Resources */ = {isa = PBXBuildFile; fileRef = C13FCE372A9D170B00E8976B /* toki-dictionary.json */; };
C13FCE352A9D170B00E8976B /* toki-dictionary.json in Resources */ = {isa = PBXBuildFile; fileRef = C13FCE372A9D170B00E8976B /* toki-dictionary.json */; };
C13FCE382A9D171300E8976B /* toki-lessons.json in Resources */ = {isa = PBXBuildFile; fileRef = C13FCE3A2A9D171300E8976B /* toki-lessons.json */; };
C13FCE3B2A9D171600E8976B /* toki-partsofspeech.json in Resources */ = {isa = PBXBuildFile; fileRef = C13FCE3D2A9D171600E8976B /* toki-partsofspeech.json */; };
C19DAB4E2AB38F2C00B17941 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = C19DAB4D2AB38F2C00B17941 /* Localizable.xcstrings */; };
C1A70F5D2B2D78B300CDE5C8 /* ContributeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1A70F5C2B2D78B200CDE5C8 /* ContributeView.swift */; };
C1A70F5F2B2D900200CDE5C8 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C1A70F5E2B2D900200CDE5C8 /* StoreKit.framework */; };
E1A8B364290B905600B53385 /* ViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1A8B363290B905600B53385 /* ViewExtensions.swift */; };
E1D79AE328EC396200A104BF /* DictionaryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D79AE228EC396200A104BF /* DictionaryView.swift */; };
E1D79AE528F1914600A104BF /* TranslatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D79AE428F1914600A104BF /* TranslatorView.swift */; };
E1D79AE728F1925400A104BF /* TokiWordsListEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D79AE628F1925400A104BF /* TokiWordsListEntryView.swift */; };
E1D79AEB28F194EF00A104BF /* LanguageDirectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1D79AEA28F194EF00A104BF /* LanguageDirectionView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
7E449781275AA0620016B6DC /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 7E943A15273211C200E7DDF4 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 7E449771275AA0600016B6DC;
remoteInfo = "Toki Trainer WidgetsExtension";
};
/* End PBXContainerItemProxy section */
/* Begin PBXCopyFilesBuildPhase section */
7E449784275AA0620016B6DC /* Embed Foundation Extensions */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 13;
files = (
7E449783275AA0620016B6DC /* Toki Trainer WidgetsExtension.appex in Embed Foundation Extensions */,
);
name = "Embed Foundation Extensions";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
7E20D5FE2733AFE700D75B9A /* PartsOfSpeechView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PartsOfSpeechView.swift; sourceTree = "<group>"; };
7E20D6002734466800D75B9A /* TokiDictionaryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokiDictionaryViewModel.swift; sourceTree = "<group>"; };
7E2811142733027F0063DC78 /* TokiDictionary.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokiDictionary.swift; sourceTree = "<group>"; };
7E2811152733027F0063DC78 /* TokiJSONLoader.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokiJSONLoader.swift; sourceTree = "<group>"; };
7E2811162733027F0063DC78 /* TokiPartOfSpeech.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokiPartOfSpeech.swift; sourceTree = "<group>"; };
7E28111A273302860063DC78 /* toki-partsofspeech.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "toki-partsofspeech.json"; sourceTree = "<group>"; };
7E28111B273302860063DC78 /* toki-dictionary.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "toki-dictionary.json"; sourceTree = "<group>"; };
7E28112127330DD20063DC78 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
7E449772275AA0600016B6DC /* Toki Trainer WidgetsExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Toki Trainer WidgetsExtension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
7E449774275AA0600016B6DC /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };
7E449776275AA0600016B6DC /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };
7E449779275AA0600016B6DC /* Toki_Trainer_Widgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toki_Trainer_Widgets.swift; sourceTree = "<group>"; };
7E44977B275AA0600016B6DC /* Toki_Trainer_Widgets.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Toki_Trainer_Widgets.intentdefinition; sourceTree = "<group>"; };
7E44977C275AA0620016B6DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
7E44977E275AA0620016B6DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7E44978E275C495E0016B6DC /* Toki Trainer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Toki Trainer.entitlements"; sourceTree = "<group>"; };
7E716B3D273986E5009E2CF6 /* TokiLesson.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokiLesson.swift; sourceTree = "<group>"; };
7E716B4127398CDF009E2CF6 /* FlashCardLessonsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardLessonsView.swift; sourceTree = "<group>"; };
7E716B4327398D3D009E2CF6 /* FlashCardLessonsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardLessonsViewModel.swift; sourceTree = "<group>"; };
7E716B452739B968009E2CF6 /* FlashCardLessonResultsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardLessonResultsView.swift; sourceTree = "<group>"; };
7E71E6EC2735D70C007CFF72 /* FlashCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardView.swift; sourceTree = "<group>"; };
7E71E6F02736DAE4007CFF72 /* FlashCardsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardsViewModel.swift; sourceTree = "<group>"; };
7E943A1D273211C200E7DDF4 /* Toki Trainer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Toki Trainer.app"; sourceTree = BUILT_PRODUCTS_DIR; };
@ -53,15 +103,43 @@
7E943A27273211C300E7DDF4 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
7E943A29273211C300E7DDF4 /* Persistence.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Persistence.swift; sourceTree = "<group>"; };
7E943A2C273211C300E7DDF4 /* Toki_Trainer.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Toki_Trainer.xcdatamodel; sourceTree = "<group>"; };
7EBAE6A9273D65FD00BCFA09 /* toki-lessons.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "toki-lessons.json"; sourceTree = "<group>"; };
7EF546152737B8FA00537AE6 /* FlashCardResultsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardResultsView.swift; sourceTree = "<group>"; };
C13909F52B30ACC300B235EE /* TransactionObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransactionObserver.swift; sourceTree = "<group>"; };
C13FCE362A9D170B00E8976B /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Base; path = "Base.lproj/toki-dictionary.json"; sourceTree = "<group>"; };
C13FCE392A9D171300E8976B /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Base; path = "Base.lproj/toki-lessons.json"; sourceTree = "<group>"; };
C13FCE3C2A9D171600E8976B /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = Base; path = "Base.lproj/toki-partsofspeech.json"; sourceTree = "<group>"; };
C13FCE3E2A9D173000E8976B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = en; path = "en.lproj/toki-partsofspeech.json"; sourceTree = "<group>"; };
C13FCE3F2A9D173A00E8976B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = en; path = "en.lproj/toki-lessons.json"; sourceTree = "<group>"; };
C13FCE402A9D173F00E8976B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = en; path = "en.lproj/toki-dictionary.json"; sourceTree = "<group>"; };
C13FCE412A9D181B00E8976B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = fr; path = "fr.lproj/toki-dictionary.json"; sourceTree = "<group>"; };
C13FCE422A9D181B00E8976B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = fr; path = "fr.lproj/toki-lessons.json"; sourceTree = "<group>"; };
C13FCE432A9D181B00E8976B /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = fr; path = "fr.lproj/toki-partsofspeech.json"; sourceTree = "<group>"; };
C18C977E2B07FC9C0049EEF6 /* Toki-Trainer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Toki-Trainer-Info.plist"; sourceTree = SOURCE_ROOT; };
C19DAB4D2AB38F2C00B17941 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
C1A70F5C2B2D78B200CDE5C8 /* ContributeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContributeView.swift; sourceTree = "<group>"; };
C1A70F5E2B2D900200CDE5C8 /* StoreKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = StoreKit.framework; path = System/Library/Frameworks/StoreKit.framework; sourceTree = SDKROOT; };
E1A8B363290B905600B53385 /* ViewExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewExtensions.swift; sourceTree = "<group>"; };
E1D79AE228EC396200A104BF /* DictionaryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DictionaryView.swift; sourceTree = "<group>"; };
E1D79AE428F1914600A104BF /* TranslatorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslatorView.swift; sourceTree = "<group>"; };
E1D79AE628F1925400A104BF /* TokiWordsListEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TokiWordsListEntryView.swift; sourceTree = "<group>"; };
E1D79AEA28F194EF00A104BF /* LanguageDirectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageDirectionView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
7E44976F275AA0600016B6DC /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7E449777275AA0600016B6DC /* SwiftUI.framework in Frameworks */,
7E449775275AA0600016B6DC /* WidgetKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7E943A1A273211C200E7DDF4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C1A70F5F2B2D900200CDE5C8 /* StoreKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -75,6 +153,7 @@
7E2811152733027F0063DC78 /* TokiJSONLoader.swift */,
7E2811162733027F0063DC78 /* TokiPartOfSpeech.swift */,
7E716B3D273986E5009E2CF6 /* TokiLesson.swift */,
C13909F52B30ACC300B235EE /* TransactionObserver.swift */,
);
path = Models;
sourceTree = "<group>";
@ -82,13 +161,13 @@
7E2811122733024F0063DC78 /* Views */ = {
isa = PBXGroup;
children = (
E1D79AE828F1947F00A104BF /* WordListViews */,
7E943A20273211C200E7DDF4 /* Toki_TrainerApp.swift */,
7E943A22273211C200E7DDF4 /* ContentView.swift */,
7E20D5FE2733AFE700D75B9A /* PartsOfSpeechView.swift */,
7E71E6EC2735D70C007CFF72 /* FlashCardView.swift */,
7EF546152737B8FA00537AE6 /* FlashCardResultsView.swift */,
7E716B4127398CDF009E2CF6 /* FlashCardLessonsView.swift */,
7E716B452739B968009E2CF6 /* FlashCardLessonResultsView.swift */,
C1A70F5C2B2D78B200CDE5C8 /* ContributeView.swift */,
);
path = Views;
sourceTree = "<group>";
@ -106,17 +185,40 @@
7E28111E273302890063DC78 /* JSON Data */ = {
isa = PBXGroup;
children = (
7E28111B273302860063DC78 /* toki-dictionary.json */,
7EBAE6A9273D65FD00BCFA09 /* toki-lessons.json */,
7E28111A273302860063DC78 /* toki-partsofspeech.json */,
C13FCE372A9D170B00E8976B /* toki-dictionary.json */,
C13FCE3A2A9D171300E8976B /* toki-lessons.json */,
C13FCE3D2A9D171600E8976B /* toki-partsofspeech.json */,
);
path = "JSON Data";
sourceTree = "<group>";
};
7E449773275AA0600016B6DC /* Frameworks */ = {
isa = PBXGroup;
children = (
C1A70F5E2B2D900200CDE5C8 /* StoreKit.framework */,
7E449774275AA0600016B6DC /* WidgetKit.framework */,
7E449776275AA0600016B6DC /* SwiftUI.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
7E449778275AA0600016B6DC /* Toki Trainer Widgets */ = {
isa = PBXGroup;
children = (
7E449779275AA0600016B6DC /* Toki_Trainer_Widgets.swift */,
7E44977B275AA0600016B6DC /* Toki_Trainer_Widgets.intentdefinition */,
7E44977C275AA0620016B6DC /* Assets.xcassets */,
7E44977E275AA0620016B6DC /* Info.plist */,
);
path = "Toki Trainer Widgets";
sourceTree = "<group>";
};
7E943A14273211C200E7DDF4 = {
isa = PBXGroup;
children = (
7E943A1F273211C200E7DDF4 /* Toki Trainer */,
7E449778275AA0600016B6DC /* Toki Trainer Widgets */,
7E449773275AA0600016B6DC /* Frameworks */,
7E943A1E273211C200E7DDF4 /* Products */,
);
sourceTree = "<group>";
@ -125,6 +227,7 @@
isa = PBXGroup;
children = (
7E943A1D273211C200E7DDF4 /* Toki Trainer.app */,
7E449772275AA0600016B6DC /* Toki Trainer WidgetsExtension.appex */,
);
name = Products;
sourceTree = "<group>";
@ -132,6 +235,9 @@
7E943A1F273211C200E7DDF4 /* Toki Trainer */ = {
isa = PBXGroup;
children = (
C18C977E2B07FC9C0049EEF6 /* Toki-Trainer-Info.plist */,
E1A8B362290B903B00B53385 /* Extensions */,
7E44978E275C495E0016B6DC /* Toki Trainer.entitlements */,
7E28111E273302890063DC78 /* JSON Data */,
7E281113273302530063DC78 /* ViewModels */,
7E2811122733024F0063DC78 /* Views */,
@ -141,6 +247,7 @@
7E943A29273211C300E7DDF4 /* Persistence.swift */,
7E943A2B273211C300E7DDF4 /* Toki_Trainer.xcdatamodeld */,
7E943A26273211C300E7DDF4 /* Preview Content */,
C19DAB4D2AB38F2C00B17941 /* Localizable.xcstrings */,
);
path = "Toki Trainer";
sourceTree = "<group>";
@ -153,9 +260,54 @@
path = "Preview Content";
sourceTree = "<group>";
};
E1A8B362290B903B00B53385 /* Extensions */ = {
isa = PBXGroup;
children = (
E1A8B363290B905600B53385 /* ViewExtensions.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
E1D79AE828F1947F00A104BF /* WordListViews */ = {
isa = PBXGroup;
children = (
E1D79AE928F1949900A104BF /* SharedViews */,
E1D79AE228EC396200A104BF /* DictionaryView.swift */,
E1D79AE428F1914600A104BF /* TranslatorView.swift */,
);
path = WordListViews;
sourceTree = "<group>";
};
E1D79AE928F1949900A104BF /* SharedViews */ = {
isa = PBXGroup;
children = (
E1D79AE628F1925400A104BF /* TokiWordsListEntryView.swift */,
7E20D5FE2733AFE700D75B9A /* PartsOfSpeechView.swift */,
E1D79AEA28F194EF00A104BF /* LanguageDirectionView.swift */,
);
path = SharedViews;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
7E449771275AA0600016B6DC /* Toki Trainer WidgetsExtension */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E449787275AA0620016B6DC /* Build configuration list for PBXNativeTarget "Toki Trainer WidgetsExtension" */;
buildPhases = (
7E44976E275AA0600016B6DC /* Sources */,
7E44976F275AA0600016B6DC /* Frameworks */,
7E449770275AA0600016B6DC /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = "Toki Trainer WidgetsExtension";
productName = "Toki Trainer WidgetsExtension";
productReference = 7E449772275AA0600016B6DC /* Toki Trainer WidgetsExtension.appex */;
productType = "com.apple.product-type.app-extension";
};
7E943A1C273211C200E7DDF4 /* Toki Trainer */ = {
isa = PBXNativeTarget;
buildConfigurationList = 7E943A30273211C300E7DDF4 /* Build configuration list for PBXNativeTarget "Toki Trainer" */;
@ -163,10 +315,12 @@
7E943A19273211C200E7DDF4 /* Sources */,
7E943A1A273211C200E7DDF4 /* Frameworks */,
7E943A1B273211C200E7DDF4 /* Resources */,
7E449784275AA0620016B6DC /* Embed Foundation Extensions */,
);
buildRules = (
);
dependencies = (
7E449782275AA0620016B6DC /* PBXTargetDependency */,
);
name = "Toki Trainer";
productName = "Toki Trainer";
@ -181,8 +335,11 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1310;
LastUpgradeCheck = 1310;
LastUpgradeCheck = 1430;
TargetAttributes = {
7E449771275AA0600016B6DC = {
CreatedOnToolsVersion = 13.1;
};
7E943A1C273211C200E7DDF4 = {
CreatedOnToolsVersion = 13.1;
};
@ -195,6 +352,7 @@
knownRegions = (
en,
Base,
fr,
);
mainGroup = 7E943A14273211C200E7DDF4;
productRefGroup = 7E943A1E273211C200E7DDF4 /* Products */;
@ -202,44 +360,76 @@
projectRoot = "";
targets = (
7E943A1C273211C200E7DDF4 /* Toki Trainer */,
7E449771275AA0600016B6DC /* Toki Trainer WidgetsExtension */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
7E449770275AA0600016B6DC /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C13FCE352A9D170B00E8976B /* toki-dictionary.json in Resources */,
7E44977D275AA0620016B6DC /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7E943A1B273211C200E7DDF4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7EBAE6AA273D65FD00BCFA09 /* toki-lessons.json in Resources */,
C13FCE382A9D171300E8976B /* toki-lessons.json in Resources */,
7E943A28273211C300E7DDF4 /* Preview Assets.xcassets in Resources */,
C19DAB4E2AB38F2C00B17941 /* Localizable.xcstrings in Resources */,
7E943A25273211C300E7DDF4 /* Assets.xcassets in Resources */,
7E28111D273302860063DC78 /* toki-dictionary.json in Resources */,
7E28111C273302860063DC78 /* toki-partsofspeech.json in Resources */,
C13FCE342A9D170B00E8976B /* toki-dictionary.json in Resources */,
C13FCE3B2A9D171600E8976B /* toki-partsofspeech.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
7E44976E275AA0600016B6DC /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E44977A275AA0600016B6DC /* Toki_Trainer_Widgets.swift in Sources */,
7E44977F275AA0620016B6DC /* Toki_Trainer_Widgets.intentdefinition in Sources */,
7E449789275ABF5C0016B6DC /* TokiLesson.swift in Sources */,
7E449788275ABF5C0016B6DC /* TokiJSONLoader.swift in Sources */,
7E44978C275ABF690016B6DC /* TokiDictionaryViewModel.swift in Sources */,
7E44978B275ABF5C0016B6DC /* TokiDictionary.swift in Sources */,
7E44978A275ABF5C0016B6DC /* TokiPartOfSpeech.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
7E943A19273211C200E7DDF4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E943A2D273211C300E7DDF4 /* Toki_Trainer.xcdatamodeld in Sources */,
C1A70F5D2B2D78B300CDE5C8 /* ContributeView.swift in Sources */,
7E943A2A273211C300E7DDF4 /* Persistence.swift in Sources */,
C13909F62B30ACC300B235EE /* TransactionObserver.swift in Sources */,
7E20D5FF2733AFE700D75B9A /* PartsOfSpeechView.swift in Sources */,
7E71E6F12736DAE4007CFF72 /* FlashCardsViewModel.swift in Sources */,
E1D79AEB28F194EF00A104BF /* LanguageDirectionView.swift in Sources */,
E1D79AE528F1914600A104BF /* TranslatorView.swift in Sources */,
7E20D6012734466800D75B9A /* TokiDictionaryViewModel.swift in Sources */,
7E716B4427398D3D009E2CF6 /* FlashCardLessonsViewModel.swift in Sources */,
7E2811192733027F0063DC78 /* TokiPartOfSpeech.swift in Sources */,
7E449780275AA0620016B6DC /* Toki_Trainer_Widgets.intentdefinition in Sources */,
E1D79AE328EC396200A104BF /* DictionaryView.swift in Sources */,
7E943A23273211C200E7DDF4 /* ContentView.swift in Sources */,
7EF546162737B8FB00537AE6 /* FlashCardResultsView.swift in Sources */,
7E716B4227398CDF009E2CF6 /* FlashCardLessonsView.swift in Sources */,
7E2811172733027F0063DC78 /* TokiDictionary.swift in Sources */,
E1D79AE728F1925400A104BF /* TokiWordsListEntryView.swift in Sources */,
E1A8B364290B905600B53385 /* ViewExtensions.swift in Sources */,
7E71E6ED2735D70C007CFF72 /* FlashCardView.swift in Sources */,
7E943A21273211C200E7DDF4 /* Toki_TrainerApp.swift in Sources */,
7E716B462739B968009E2CF6 /* FlashCardLessonResultsView.swift in Sources */,
7E2811182733027F0063DC78 /* TokiJSONLoader.swift in Sources */,
7E716B3E273986E5009E2CF6 /* TokiLesson.swift in Sources */,
7E28112227330DD30063DC78 /* Constants.swift in Sources */,
@ -248,11 +438,107 @@
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
7E449782275AA0620016B6DC /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 7E449771275AA0600016B6DC /* Toki Trainer WidgetsExtension */;
targetProxy = 7E449781275AA0620016B6DC /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
C13FCE372A9D170B00E8976B /* toki-dictionary.json */ = {
isa = PBXVariantGroup;
children = (
C13FCE362A9D170B00E8976B /* Base */,
C13FCE402A9D173F00E8976B /* en */,
C13FCE412A9D181B00E8976B /* fr */,
);
name = "toki-dictionary.json";
sourceTree = "<group>";
};
C13FCE3A2A9D171300E8976B /* toki-lessons.json */ = {
isa = PBXVariantGroup;
children = (
C13FCE392A9D171300E8976B /* Base */,
C13FCE3F2A9D173A00E8976B /* en */,
C13FCE422A9D181B00E8976B /* fr */,
);
name = "toki-lessons.json";
sourceTree = "<group>";
};
C13FCE3D2A9D171600E8976B /* toki-partsofspeech.json */ = {
isa = PBXVariantGroup;
children = (
C13FCE3C2A9D171600E8976B /* Base */,
C13FCE3E2A9D173000E8976B /* en */,
C13FCE432A9D181B00E8976B /* fr */,
);
name = "toki-partsofspeech.json";
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
7E449785275AA0620016B6DC /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = W9ASV855X5;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Toki Trainer Widgets/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Toki Trainer Widgets";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "info.maddie.Toki-Trainer.Toki-Trainer-Widgets";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
7E449786275AA0620016B6DC /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = W9ASV855X5;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Toki Trainer Widgets/Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Toki Trainer Widgets";
INFOPLIST_KEY_NSHumanReadableCopyright = "";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "info.maddie.Toki-Trainer.Toki-Trainer-Widgets";
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
7E943A2E273211C300E7DDF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -300,7 +586,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -314,6 +600,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -355,7 +642,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
@ -368,24 +655,30 @@
7E943A31273211C300E7DDF4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "Toki Trainer/Toki Trainer.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"Toki Trainer/Preview Content\"";
DEVELOPMENT_TEAM = W9ASV855X5;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Toki-Trainer-Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Toki Trainer";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "info.maddie.Toki-Trainer";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@ -397,24 +690,30 @@
7E943A32273211C300E7DDF4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "Toki Trainer/Toki Trainer.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_ASSET_PATHS = "\"Toki Trainer/Preview Content\"";
DEVELOPMENT_TEAM = W9ASV855X5;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = "Toki-Trainer-Info.plist";
INFOPLIST_KEY_CFBundleDisplayName = "Toki Trainer";
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.education";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "info.maddie.Toki-Trainer";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
@ -426,6 +725,15 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
7E449787275AA0620016B6DC /* Build configuration list for PBXNativeTarget "Toki Trainer WidgetsExtension" */ = {
isa = XCConfigurationList;
buildConfigurations = (
7E449785275AA0620016B6DC /* Debug */,
7E449786275AA0620016B6DC /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
7E943A18273211C200E7DDF4 /* Build configuration list for PBXProject "Toki Trainer" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>

View File

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E449771275AA0600016B6DC"
BuildableName = "Toki Trainer WidgetsExtension.appex"
BlueprintName = "Toki Trainer WidgetsExtension"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "_XCWidgetKind"
value = ""
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "_XCWidgetDefaultView"
value = "timeline"
isEnabled = "NO">
</EnvironmentVariable>
<EnvironmentVariable
key = "_XCWidgetFamily"
value = "medium"
isEnabled = "NO">
</EnvironmentVariable>
</EnvironmentVariables>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -4,6 +4,11 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>Toki Trainer WidgetsExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Toki Trainer.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "40DDD45F-6012-439E-A226-7CACD11FE451"
type = "1"
version = "2.0">
</Bucket>

View File

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = "fr"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "7E943A1C273211C200E7DDF4"
BuildableName = "Toki Trainer.app"
BlueprintName = "Toki Trainer"
ReferencedContainer = "container:Toki Trainer.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Toki Trainer French.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>Toki Trainer WidgetsExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>Toki Trainer.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>7E449771275AA0600016B6DC</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>7E943A1C273211C200E7DDF4</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
uuid = "67504E59-573C-478E-8136-93CA344B943E"
type = "1"
version = "2.0">
</Bucket>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Toki Trainer WidgetsExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Toki Trainer.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@ -24,7 +24,25 @@ struct K {
"oth": UIColor.systemBrown,
"extra": UIColor.systemBrown
]
struct UserDefaults {
static let donationHearts = "donationHearts"
static let hasDonated = "hasDonated"
}
struct ConsumableTransactions {
static let TierOne = "SingleTimeTipTierOne"
static let TierTwo = "SingleTimeTipTierTwo"
static let TierThree = "SingleTimeTipTierThree"
static let TierFour = "SingleTimeTipTierFour"
}
struct MonthlyTransactions {
static let TierOne = "TierOne"
static let TierTwo = "TierTwo"
static let TierThree = "TierThree"
}
static var getFlashCardAnswersFetchRequest: NSFetchRequest<FlashCardAnswer> {
let request: NSFetchRequest<FlashCardAnswer> = FlashCardAnswer.fetchRequest()
request.sortDescriptors = []

View File

@ -0,0 +1,15 @@
//
// ViewExtensions.swift
// Toki Trainer
//
// Created by maddiefuzz on 10/28/22.
//
import SwiftUI
extension View {
func hideKeyboard() {
let resign = #selector(UIResponder.resignFirstResponder)
UIApplication.shared.sendAction(resign, to: nil, from: nil, for: nil)
}
}

View File

@ -578,7 +578,7 @@
"definitions": [
{
"pos": "sep",
"definition": "\\\"(between any subject except mi and sina and its verb\": null, \" also used to introduce a new verb for the same subject)\\\""
"definition": "(between any subject except mi and sina and its verb, also used to introduce a new verb for the same subject)"
}
]
},
@ -1748,4 +1748,4 @@
}
]
}
]
]

View File

@ -94,7 +94,7 @@
"definitions": [
{
"pos": "sep",
"definition": "\\\"(between any subject except mi and sina and its verb\": null, \" also used to introduce a new verb for the same subject)\\\""
"definition": "(between any subject except mi and sina and its verb, also used to introduce a new verb for the same subject)"
}
]
}
@ -1711,4 +1711,4 @@
}
]
}
]
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
[
{
"pos": "n",
"definition": "head noun"
},
{
"pos": "mod",
"definition": "modifier (adjective or adverb)"
},
{
"pos": "sep",
"definition": "separator"
},
{
"pos": "vt",
"definition": "verb, transitive (normally used with e)"
},
{
"pos": "vi",
"definition": "verb, intransitive"
},
{
"pos": "interj",
"definition": "interjection"
},
{
"pos": "prep",
"definition": "quasi-preposition"
},
{
"pos": "conj",
"definition": "conjunction"
},
{
"pos": "kama",
"definition": "compound verb preceded by kama"
},
{
"pos": "cont",
"definition": "context word used before la"
},
{
"pos": "oth",
"definition": "special, other word"
}
]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
[
{
"pos": "n",
"definition": "nom principal"
},
{
"pos": "mod",
"definition": "modificateur (adjectif ou adverbe)"
},
{
"pos": "sep",
"definition": "séparateur"
},
{
"pos": "vt",
"definition": "verbe transitif (généralement utilisé avec \"e\")"
},
{
"pos": "vi",
"definition": "verbe intransitif"
},
{
"pos": "interj",
"definition": "interjection"
},
{
"pos": "prep",
"definition": "quasi-préposition"
},
{
"pos": "conj",
"definition": "conjonction"
},
{
"pos": "kama",
"definition": "verbe composé précédé de \"kama\""
},
{
"pos": "cont",
"definition": "mot de contexte utilisé avant \"la\""
},
{
"pos": "oth",
"definition": "mot spécial, autre"
}
]

View File

@ -0,0 +1,258 @@
{
"sourceLanguage" : "en",
"strings" : {
"" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : ""
}
}
}
},
"%@ %%" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : ""
}
}
}
},
"%lld 💕" : {
},
"Contribute" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Contribuer"
}
}
}
},
"Correct" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Correct"
}
}
}
},
"Definitions" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Définitions"
}
}
}
},
"Dictionary" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Dictionnaire"
}
}
}
},
"Donate Monthly" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Faire un don mensuel"
}
}
}
},
"Donate Once" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Don unique"
}
}
}
},
"Enter Toki Pona Word or Phrase" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Entrer un mot ou une phrase en Toki Pona"
}
}
}
},
"Flash Cards" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Flash Cards"
}
}
}
},
"Incorrect" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Incorrect"
}
}
}
},
"Language" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Langage"
}
}
}
},
"Legend" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Légende"
}
}
}
},
"Lessons" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Leçons"
}
}
}
},
"One-Time Donation" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Don unique"
}
}
}
},
"Parts of Speech" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Légende"
}
}
}
},
"Phrase Lookup" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Recherche d'expressions"
}
}
}
},
"Please Select a Lesson" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Veuillez sélectionner une leçon"
}
}
}
},
"Privacy Policy" : {
},
"Results" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Résultats"
}
}
}
},
"Search" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Rechercher"
}
}
}
},
"Search for:" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Options de recherche"
}
}
}
},
"Source Code" : {
},
"Terms of Use" : {
},
"Thank you for donating!" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Merci pour votre don !"
}
}
}
},
"Words" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Mots"
}
}
}
},
"Write Review" : {
"localizations" : {
"fr" : {
"stringUnit" : {
"state" : "translated",
"value" : "Ecrire une critique"
}
}
}
}
},
"version" : "1.0"
}

View File

@ -0,0 +1,97 @@
//
// TransactionObserver.swift
// Toki Trainer
//
// Created by Madeline Pace on 12/18/23.
//
import CoreData
import StoreKit
@MainActor
final class TransactionObserver: ObservableObject {
var updates: Task<Void, Never>? = nil
@Published var donationHearts: Int = 0
@Published var hasDonated = false
init() {
updates = newTransactionListenerTask()
donationHearts = UserDefaults.standard.integer(forKey: K.UserDefaults.donationHearts)
hasDonated = UserDefaults.standard.bool(forKey: K.UserDefaults.hasDonated)
}
deinit {
updates?.cancel()
}
func addDonationHearts(_ amount: Int) {
if hasDonated == false {
hasDonated = true
UserDefaults.standard.set(hasDonated, forKey: K.UserDefaults.hasDonated)
}
DispatchQueue.main.async {
self.donationHearts += amount
}
UserDefaults.standard.set(donationHearts, forKey: K.UserDefaults.donationHearts)
}
private func newTransactionListenerTask() -> Task<Void, Never> {
Task(priority: .background) {
for await verificationResult in Transaction.updates {
await self.handle(updatedTransaction: verificationResult)
}
}
}
private func handle(updatedTransaction verificationResult: VerificationResult<Transaction>) async {
guard case .verified(let transaction) = verificationResult else {
return
}
switch transaction.productType {
case Product.ProductType.consumable:
processConsumable(transaction.productID)
case Product.ProductType.nonRenewable, Product.ProductType.autoRenewable:
processSubscription(transaction.productID)
default:
return
}
print("Finishing transaction")
await transaction.finish()
}
func processConsumable(_ productID: String) {
print("Consumable ID: \(productID)")
switch productID {
case K.ConsumableTransactions.TierOne:
self.addDonationHearts(100)
case K.ConsumableTransactions.TierTwo:
self.addDonationHearts(500)
case K.ConsumableTransactions.TierThree:
self.addDonationHearts(1000)
case K.ConsumableTransactions.TierFour:
self.addDonationHearts(2000)
default:
return
}
}
func processSubscription(_ productID: String) {
print("Subscription ID: \(productID)")
switch productID {
case K.MonthlyTransactions.TierOne:
self.addDonationHearts(100)
case K.MonthlyTransactions.TierTwo:
self.addDonationHearts(500)
case K.MonthlyTransactions.TierThree:
self.addDonationHearts(1000)
default:
return
}
}
}

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.info.maddie.tokitrainer</string>
</array>
</dict>
</plist>

View File

@ -17,6 +17,8 @@ class TokiDictionaryViewModel: ObservableObject {
@Published var dictionary: [TokiDictEntry] = []
@Published var partsOfSpeech: [TokiPartOfSpeech] = []
@Published var translatedDictionary: [TokiSubWordListEntry] = []
init() {
if let safeDictionary = jsonLoader.loadDictionary() {
dictionary = safeDictionary
@ -30,18 +32,75 @@ class TokiDictionaryViewModel: ObservableObject {
func filterDictionary(_ input: String) {
dictionary = []
if(input.isEmpty) {
dictionary = fullDictionary
} else {
let capturePattern = #"(\w+)"#
let captures = self.searchStringForRegex(string: input, regex: capturePattern)
for capture in captures {
print(capture)
for value in fullDictionary {
if value.word == capture {
dictionary.append(value)
for value in fullDictionary {
if value.word.hasPrefix(input) {
dictionary.append(value)
}
}
}
func filterDictionaryEnglishMode(_ input: String) {
dictionary = []
for value in fullDictionary {
var entryMatch = false
// Check if word matches toki pona form, even partially
// Commented out because toki words shouldn't be matched in english mode
// if value.word.hasPrefix(input) {
// entryMatch = true
// }
// Check if any part of the word definitions match in English, even partially, but
// only by prefix (if one of the definition words matches the beginning of the word with
// the search term)
for definition in value.definitions {
let capturePattern = #"(\w+)"#
let captures = self.searchStringForRegex(string: definition.definition, regex: capturePattern)
for capture in captures {
if capture.hasPrefix(input) {
entryMatch = true
}
}
// Commented out, less strict matching that will match on any substring match
// if definition.definition.contains(input) {
// entryMatch = true
// }
}
// Add to dictionary
if entryMatch == true {
dictionary.append(value)
}
}
}
func translatePhrase(_ input: String) {
dictionary = []
translatedDictionary = []
if input.isEmpty {
dictionary = fullDictionary
translatedDictionary.append(TokiSubWordListEntry("Dictionary"))
}
let capturePattern = #"(\w+)"#
let captures = self.searchStringForRegex(string: input, regex: capturePattern)
for capture in captures {
let translatedWord = TokiSubWordListEntry(capture)
translatedDictionary.append(translatedWord)
for value in fullDictionary {
if value.word == capture {
dictionary.append(value)
translatedWord.subDictionary.removeAll()
translatedWord.subDictionary.append(value)
break
} else if value.word.hasPrefix(capture) {
dictionary.append(value)
translatedWord.subDictionary.append(value)
}
}
}
}
@ -58,3 +117,12 @@ class TokiDictionaryViewModel: ObservableObject {
}
}
}
class TokiSubWordListEntry: Identifiable {
let header: String
var subDictionary: [TokiDictEntry] = []
init(_ header: String) {
self.header = header
}
}

View File

@ -6,6 +6,7 @@
//
import SwiftUI
import StoreKit
import CoreData
extension String: Identifiable {
@ -14,11 +15,16 @@ extension String: Identifiable {
struct ContentView: View {
@Environment(\.managedObjectContext) private var viewContext
@State private var tokiInput: String = ""
@StateObject var transactions: TransactionObserver = TransactionObserver()
var body: some View {
TabView {
DictionaryView()
.tabItem {
Image(systemName: "book")
Text("Dictionary")
}
TranslatorView()
.tabItem {
Image(systemName: "message")
@ -29,67 +35,20 @@ struct ContentView: View {
Image(systemName: "character.textbox")
Text("Flash Cards")
}
// FlashCardResultsView()
// .tabItem {
// Image(systemName: "number.circle")
// Text("Flash Card Results")
// }
ContributeView()
.tabItem {
Image(systemName: "heart.circle.fill")
Text("Contribute")
}
}
.environmentObject(transactions)
}
func openPartsOfSpeechView() {
print("Button pressed.")
}
}
struct TranslatorView: View {
@ObservedObject var tokiDictViewModel = TokiDictionaryViewModel()
@State private var selectedPartOfSpeech: String?
@State private var tokiInput: String = ""
var body: some View {
VStack {
TextField("Enter Toki Pona Word or Phrase", text: $tokiInput)
.multilineTextAlignment(.center)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.padding(8)
.onSubmit {
tokiDictViewModel.filterDictionary(tokiInput)
}
List(tokiDictViewModel.dictionary, id: \.word) { entry in
VStack(alignment: .leading) {
Text(entry.word)
.font(.title)
ForEach(entry.definitions, id: \.pos) { definition in
HStack(alignment: .top) {
Button(action: {
self.selectedPartOfSpeech = String(definition.pos)
}) {
Text(definition.pos)
.frame(width: 45, height: 22, alignment: .center)
.foregroundColor(.black)
.background(Color(K.posColors[definition.pos]!))
.cornerRadius(5.0)
.padding(4)
}
.buttonStyle(BorderlessButtonStyle())
Text(definition.definition)
.fixedSize(horizontal: false, vertical: true)
.padding(4)
}
}
}
}
.sheet(item: $selectedPartOfSpeech) { selectedPOS in
PartsOfSpeechView(selectedPartOfSpeech: selectedPOS, partsOfSpeech: tokiDictViewModel.partsOfSpeech)
}
.onChange(of: tokiInput) { newValue in
tokiDictViewModel.filterDictionary(newValue)
}
}
}
}
struct ContentView_Previews: PreviewProvider {

View File

@ -0,0 +1,317 @@
//
// ContributeView.swift
// Toki Trainer
//
// Created by Madeline Pace on 12/16/23.
//
import SwiftUI
import StoreKit
typealias Transaction = StoreKit.Transaction
public enum StoreError: Error {
case failedVerification
}
// MARK: ContributeView
struct ContributeView: View {
private let supportString = """
Hi 👋
I'm Maddie, the primary developer for Toki Trainer.
This app is free and open source. If you find it \
useful, please consider supporting my development efforts.
I don't collect your data and am committed to providing \
a high-quality, ad-free experience. Learning toki pona \
easily and comfortably is the whole point, and ads would \
ruin that!
Taking a moment to add an App Store Review helps a ton. \
Please also consider donating financially if you can. 💕
"""
private var recurringIAPs = ["TierThree"]
@EnvironmentObject var transactions: TransactionObserver
var body: some View {
VStack {
Spacer()
if transactions.hasDonated {
ThankYouBannerView(donationHearts: $transactions.donationHearts)
}
Text(supportString)
.padding(16)
Spacer()
// Link("Source Code", destination: URL(string: "https://git.corrupt.link/maddiefuzz/TokiTrainer")!)
// .padding(12)
// .padding([.bottom], 12)
HStack {
ReviewButton()
SourceCodeButton()
}
HStack {
SingleDonationButton()
RecurringDonationButton()
}
Spacer()
}
}
}
// MARK: ThankYouBannerView
struct ThankYouBannerView: View {
@Binding var donationHearts: Int
var body: some View {
ZStack {
Rectangle()
.fill(.blue)
.cornerRadius(15)
VStack {
Text("Thank you for donating!")
.multilineTextAlignment(.center)
.font(.title)
Text("\(donationHearts) 💕")
.padding(10)
.font(.title3)
}
}
.frame(width: 250, height: 140)
}
}
struct SourceCodeButton: View {
var body: some View {
Link(destination: URL(string: "https://git.corrupt.link/maddiefuzz/TokiTrainer")!) {
VStack {
Image(systemName: "apple.terminal")
.font(.system(size: 24, weight: .regular))
.padding(2)
Text("Source Code")
}
}
.frame(width: 100)
.padding(8)
}
}
// MARK: ReviewButton
struct ReviewButton: View {
@Environment(\.requestReview) private var requestReview
var body: some View {
Button(action: {
print("Review requested")
presentReviewRequest()
}, label: {
VStack {
Image(systemName: "star.bubble")
.font(.system(size: 24, weight: .regular))
.padding(2)
Text("Write Review")
}
})
.frame(width: 100)
.padding(8)
}
func presentReviewRequest() {
Task {
await requestReview()
}
}
}
// Workaround for .sheet(item:) expecting an Identifiable
struct DonationProducts: Identifiable {
let id = UUID()
var products = [Product]()
}
// MARK: SingleDonationButton
struct SingleDonationButton: View {
@Environment(\.purchase) private var purchase: PurchaseAction
@EnvironmentObject var transactions: TransactionObserver
@State private var IAPs: DonationProducts?
@State private var productsFetched = false
@State private var disabledPurchaseButtons = false
private var singleIAPs = ["SingleTimeTipTierOne",
"SingleTimeTipTierTwo",
"SingleTimeTipTierThree",
"SingleTimeTipTierFour"]
var body: some View {
Button {
Task {
try await loadSingleProducts()
}
} label: {
VStack {
Image(systemName: "dollarsign.circle")
.font(.system(size: 24, weight: .regular))
.padding(2)
Text("Donate Once")
}
}
.frame(width: 100)
.padding(8)
.sheet(item: self.$IAPs) { IAPs in
if(productsFetched) {
VStack {
Spacer()
Text("One-Time Donation")
.font(.largeTitle)
Spacer()
ForEach(IAPs.products) { product in
HStack {
VStack {
Text(product.displayName)
.font(.title)
.frame(maxWidth: .infinity, alignment: .leading)
Text(product.description)
.frame(maxWidth: .infinity, alignment: .leading)
}
.padding(.leading, 12)
Spacer()
Button {
print("Purchase this one: \(product)")
disabledPurchaseButtons = true
Task {
let _ = try? await purchase(product)
disabledPurchaseButtons = false
}
} label: {
Text(product.displayPrice)
.frame(minWidth: 50)
.padding(8)
.fontWeight(/*@START_MENU_TOKEN@*/.bold/*@END_MENU_TOKEN@*/)
}
.padding(.trailing, 12)
.buttonStyle(.bordered)
.disabled(disabledPurchaseButtons)
}
.padding(12)
}
Spacer()
LegalLinksView()
.padding(16)
.padding([.bottom], 20)
}
//.padding([.top], 60)
} else {
ProgressView()
}
}
}
private func purchase(_ product: Product) async throws -> Transaction? {
let result = try await product.purchase()
switch result {
case .success(let verification):
let transaction = try checkVerified(verification)
await transaction.finish()
print("Purchase success")
transactions.processConsumable(transaction.productID)
return transaction
case .userCancelled, .pending:
return nil
default:
return nil
}
}
func checkVerified<T>(_ result: VerificationResult<T>) throws -> T {
//Check whether the JWS passes StoreKit verification.
switch result {
case .unverified:
//StoreKit parses the JWS, but it fails verification.
throw StoreError.failedVerification
case .verified(let safe):
//The result is verified. Return the unwrapped value.
return safe
}
}
private func loadSingleProducts() async throws {
self.IAPs = DonationProducts()
self.IAPs?.products = try await Product.products(for: singleIAPs).sorted(by: { p1, p2 in
p1.price < p2.price
})
self.productsFetched = true
}
}
// MARK: RecurringDonationButton
struct RecurringDonationButton: View {
@State var toggleSheet = false
private let groupID = "21424772"
var body: some View {
Button {
print("Subscription button pressed")
toggleSheet.toggle()
} label: {
VStack {
Image(systemName: "dollarsign.arrow.circlepath")
.font(.system(size: 24, weight: .regular))
.padding(2)
Text("Donate Monthly")
}
}
.frame(width: 100)
.padding(8)
.sheet(isPresented: $toggleSheet, content: {
VStack {
SubscriptionStoreView(groupID: self.groupID)
// HStack {
// Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
// .padding(12)
// Link("Privacy Policy", destination: URL(string: "https://maddie.info/null_privacy_policy")!)
// }
LegalLinksView()
.padding(16)
.padding([.bottom], 20)
}
})
}
}
struct LegalLinksView: View {
var body: some View {
HStack {
Link("Terms of Use", destination: URL(string: "https://www.apple.com/legal/internet-services/itunes/dev/stdeula/")!)
.padding(12)
Link("Privacy Policy", destination: URL(string: "https://maddie.info/null_privacy_policy")!)
}
}
}
#Preview {
ContributeView().environmentObject(TransactionObserver())
}
#Preview {
@State var donationHearts = 5000
return ThankYouBannerView(donationHearts: $donationHearts)
}

View File

@ -1,20 +0,0 @@
//
// FlashCardLessonResultsView.swift
// Toki Trainer
//
// Created by Avery Ada Pace on 11/8/21.
//
import SwiftUI
struct FlashCardLessonResultsView: View {
var body: some View {
Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
}
}
struct FlashCardLessonResultsView_Previews: PreviewProvider {
static var previews: some View {
FlashCardLessonResultsView()
}
}

View File

@ -157,7 +157,7 @@ struct FlashCardStack: View {
var cardInDatabase = false
for answer in flashCardAnswers {
if answer.word == shuffledDictionary[currentFlashCard].word {
print("word in database: \(answer.word)")
print("word in database: \(answer.word ?? "nil")")
print("tries: \(answer.triesCount)")
print("correct`: \(answer.correctCount)")
cardInDatabase = true

View File

@ -0,0 +1,126 @@
//
// DictionaryView.swift
// Toki Trainer
//
// Created by maddiefuzz on 10/4/22.
//
import SwiftUI
enum SearchMode {
case Dictionary
case Definitions
}
struct DictionaryView: View {
@ObservedObject var tokiDictViewModel = TokiDictionaryViewModel()
@State private var tokiInput: String = ""
@State private var selectedPartOfSpeech: String?
@State private var showGenericLegend: Bool = false
@State private var advancedSearchEnabled = false
@State var searchMode: SearchMode = .Dictionary
@FocusState private var searchInputIsForuced: Bool
var body: some View {
VStack {
HStack {
TextField("Search", text: $tokiInput)
//.multilineTextAlignment(.center)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.padding(8)
.onSubmit {
filterByInput()
//tokiDictViewModel.filterDictionaryEnglishMode(tokiInput)
}
Button {
hideKeyboard()
filterByInput()
} label: {
Image(systemName: "magnifyingglass")
}
.buttonStyle(.borderedProminent)
Button(action: {
withAnimation {
advancedSearchEnabled.toggle()
}
}, label: {
Image(systemName: "slider.horizontal.2.square.on.square")
})
.buttonStyle(.bordered)
}
.padding([.top, .leading, .trailing], 16)
if advancedSearchEnabled == true {
VStack {
Text("Search for:")
Picker("Language", selection: $searchMode) {
Text("Words").tag(SearchMode.Dictionary)
Text("Definitions").tag(SearchMode.Definitions)
}
.pickerStyle(SegmentedPickerStyle())
.onTapGesture {
if self.searchMode == SearchMode.Dictionary {
self.searchMode = SearchMode.Definitions
} else {
self.searchMode = SearchMode.Dictionary
}
filterByInput()
}
Button(action: {
print("Legend")
showGenericLegend.toggle()
}, label: {
Text("Legend")
})
.padding(4)
}
.padding([.leading, .trailing], 8)
}
List(tokiDictViewModel.dictionary, id: \.word) { entry in
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: $selectedPartOfSpeech)
}
.sheet(item: $selectedPartOfSpeech) { selectedPOS in
PartsOfSpeechView(selectedPartOfSpeech: selectedPOS)
}
.sheet(isPresented: $showGenericLegend, content: {
PartsOfSpeechView(selectedPartOfSpeech: nil)
})
.onChange(of: tokiInput) {
filterByInput()
//tokiDictViewModel.filterDictionaryEnglishMode(newValue)
}
}
.onTapGesture {
hideKeyboard()
}
}
func filterByInput() {
if self.searchMode == SearchMode.Dictionary {
tokiDictViewModel.filterDictionary(tokiInput)
} else {
tokiDictViewModel.filterDictionaryEnglishMode(tokiInput)
}
}
}
extension View {
func searchOptionsButtonStyle(toggle: Binding<Bool>) -> any PrimitiveButtonStyle {
if toggle.wrappedValue == true {
BorderedButtonStyle()
} else {
BorderlessButtonStyle()
}
}
}
struct DictionaryView_Previews: PreviewProvider {
static var previews: some View {
DictionaryView().previewLayout(.sizeThatFits).environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
}
}

View File

@ -0,0 +1,53 @@
//
// LanguageDirectionView.swift
// Toki Trainer
//
// Created by maddiefuzz on 10/8/22.
//
import SwiftUI
struct LanguageDirectionView: View {
private var fromText: String = ""
private var toText: String = ""
private var fromColor: Color = .black
private var toColor: Color = .black
init(from: String, to: String, fromColor: Color, toColor: Color) {
self.fromText = from
self.toText = to
self.fromColor = fromColor
self.toColor = toColor
}
var body: some View {
HStack {
Text(fromText)
.bold()
.multilineTextAlignment(.center)
.foregroundColor(.white)
.frame(width: 100)
.background(fromColor)
.border(fromColor)
.cornerRadius(5)
Image(systemName: "chevron.right")
Text(toText)
.bold()
.multilineTextAlignment(.center)
.foregroundColor(.white)
.frame(width: 100)
.background(toColor)
.border(toColor)
.cornerRadius(5)
}
.padding(.top, 4)
}
}
struct LanguageDirectionView_Previews: PreviewProvider {
static var previews: some View {
LanguageDirectionView(from: "English", to: "Toki Pona", fromColor: .blue, toColor: .cyan)
.previewLayout(.fixed(width: 260, height: 40))
}
}

View File

@ -12,8 +12,6 @@ struct PartsOfSpeechView: View {
@ObservedObject var tokiDictViewModel = TokiDictionaryViewModel()
var partsOfSpeech: [TokiPartOfSpeech]
var body: some View {
VStack {
Text("Parts of Speech")
@ -42,8 +40,8 @@ struct PartsOfSpeechView: View {
struct PartsOfSpeechView_Previews: PreviewProvider {
static var previews: some View {
PartsOfSpeechView(selectedPartOfSpeech: "sep", partsOfSpeech: [TokiPartOfSpeech(pos: "sep", definition: "test")])
PartsOfSpeechView(selectedPartOfSpeech: "sep")
.preferredColorScheme(.dark)
PartsOfSpeechView(selectedPartOfSpeech: "sep", partsOfSpeech: [TokiPartOfSpeech(pos: "sep", definition: "test")])
PartsOfSpeechView(selectedPartOfSpeech: "sep")
}
}

View File

@ -0,0 +1,47 @@
//
// TokiWordsListEntryView.swift
// Toki Trainer
//
// Created by maddiefuzz on 10/8/22.
//
import SwiftUI
struct TokiWordsListEntryView: View {
@State var entry: TokiDictEntry
@Binding var selectedPartOfSpeech: String?
var body: some View {
VStack(alignment: .leading) {
Text(entry.word)
.font(.title)
ForEach(entry.definitions, id: \.pos) { definition in
HStack(alignment: .top) {
Button(action: {
self.selectedPartOfSpeech = String(definition.pos)
}) {
Text(definition.pos)
.frame(width: 45, height: 22, alignment: .center)
.foregroundColor(.black)
.background(Color(K.posColors[definition.pos]!))
.cornerRadius(5.0)
.padding(4)
}
.buttonStyle(BorderlessButtonStyle())
Text(definition.definition)
.fixedSize(horizontal: false, vertical: true)
.padding(4)
}
}
}
}
}
struct TokiWordsListEntryView_Previews: PreviewProvider {
static var entry = TokiDictionaryViewModel().dictionary[5]
static var previews: some View {
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: .constant("n"))
.previewLayout(.sizeThatFits)
}
}

View File

@ -0,0 +1,73 @@
//
// TranslatorView.swift
// Toki Trainer
//
// Created by maddiefuzz on 10/8/22.
//
import SwiftUI
struct TranslatorView: View {
@ObservedObject var tokiDictViewModel = TokiDictionaryViewModel()
@State private var selectedPartOfSpeech: String?
@State private var tokiInput: String = ""
@State private var translateToTokiPona: Bool = false
var body: some View {
VStack {
HStack {
TextField("Enter Toki Pona Word or Phrase", text: $tokiInput)
.textInputAutocapitalization(.never)
.disableAutocorrection(true)
.padding(8)
.onSubmit {
tokiDictViewModel.translatePhrase(tokiInput)
}
Button {
hideKeyboard()
tokiDictViewModel.translatePhrase(tokiInput)
} label: {
Image(systemName: "magnifyingglass")
}
.buttonStyle(.borderedProminent)
}
.padding([.top, .leading, .trailing], 16)
if tokiInput.count == 0 {
List(tokiDictViewModel.dictionary, id: \.word) { entry in
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: $selectedPartOfSpeech)
}
} else {
List(tokiDictViewModel.translatedDictionary, id: \.header) { section in
Section {
ForEach(section.subDictionary, id: \.word) { entry in
TokiWordsListEntryView(entry: entry, selectedPartOfSpeech: $selectedPartOfSpeech)
}
} header: {
Text(section.header)
}
}
}
}
.sheet(item: $selectedPartOfSpeech) { selectedPOS in
PartsOfSpeechView(selectedPartOfSpeech: selectedPOS)
}
.onChange(of: tokiInput) {
tokiDictViewModel.translatePhrase(tokiInput)
}
.onTapGesture {
hideKeyboard()
}
}
func changeTranslationDirection() {
translateToTokiPona.toggle()
}
}
struct TranslatorView_Previews: PreviewProvider {
static var previews: some View {
TranslatorView().previewLayout(.sizeThatFits).environment(\.managedObjectContext, PersistenceController.preview.container.viewContext)
}
}

8
Toki-Trainer-Info.plist Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>