diff --git a/README.md b/README.md index 737eec5..63af6ea 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ Why settle for pricey apps when you can have WordAX? We're here to prove that ef - [x] Implement logic - [ ] Make an apple watch version of the app - [ ] Option to add a hint +- [ ] Delete doesn't work +- [ ] Add haptic touch

(back to top)

diff --git a/WordAX.xcodeproj/project.pbxproj b/WordAX.xcodeproj/project.pbxproj index d33c866..f866c2e 100644 --- a/WordAX.xcodeproj/project.pbxproj +++ b/WordAX.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 6C8185082B8B523E0033CF46 /* NextRepetitionButtonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8185072B8B523D0033CF46 /* NextRepetitionButtonView.swift */; }; 6C81850A2B8BA5740033CF46 /* FlashCardListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C8185092B8BA5740033CF46 /* FlashCardListView.swift */; }; 6C81850C2B8BA6BC0033CF46 /* FlashCardListRowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C81850B2B8BA6BC0033CF46 /* FlashCardListRowView.swift */; }; - 6CEF7F522BC2DBF800E205F6 /* AddFlashCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEF7F512BC2DBF800E205F6 /* AddFlashCard.swift */; }; + 6CEF7F522BC2DBF800E205F6 /* AddFlashCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEF7F512BC2DBF800E205F6 /* AddFlashCardView.swift */; }; 6CEF7F7D2BC457E600E205F6 /* DataController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEF7F7C2BC457E600E205F6 /* DataController.swift */; }; 6CEF7F812BC4694900E205F6 /* WordAXCD.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 6CEF7F7F2BC4694900E205F6 /* WordAXCD.xcdatamodeld */; }; 6CEF7F842BC46B5900E205F6 /* Flashcard+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CEF7F822BC46B5900E205F6 /* Flashcard+CoreDataClass.swift */; }; @@ -36,7 +36,8 @@ 6C8185072B8B523D0033CF46 /* NextRepetitionButtonView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NextRepetitionButtonView.swift; sourceTree = ""; }; 6C8185092B8BA5740033CF46 /* FlashCardListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardListView.swift; sourceTree = ""; }; 6C81850B2B8BA6BC0033CF46 /* FlashCardListRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardListRowView.swift; sourceTree = ""; }; - 6CEF7F512BC2DBF800E205F6 /* AddFlashCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFlashCard.swift; sourceTree = ""; }; + 6CD500B52BE15F6D002BF511 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + 6CEF7F512BC2DBF800E205F6 /* AddFlashCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFlashCardView.swift; sourceTree = ""; }; 6CEF7F7C2BC457E600E205F6 /* DataController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataController.swift; sourceTree = ""; }; 6CEF7F802BC4694900E205F6 /* WordAX.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WordAX.xcdatamodel; sourceTree = ""; }; 6CEF7F822BC46B5900E205F6 /* Flashcard+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Flashcard+CoreDataClass.swift"; sourceTree = ""; }; @@ -68,7 +69,7 @@ isa = PBXGroup; children = ( 6C8185072B8B523D0033CF46 /* NextRepetitionButtonView.swift */, - 6CEF7F512BC2DBF800E205F6 /* AddFlashCard.swift */, + 6CEF7F512BC2DBF800E205F6 /* AddFlashCardView.swift */, 6CF439532B83541D004C3543 /* MainView.swift */, 6C8185092B8BA5740033CF46 /* FlashCardListView.swift */, 6C81850B2B8BA6BC0033CF46 /* FlashCardListRowView.swift */, @@ -110,6 +111,7 @@ 6CF439502B83541D004C3543 /* WordAX */ = { isa = PBXGroup; children = ( + 6CD500B52BE15F6D002BF511 /* Info.plist */, 6CEF7F7B2BC456A100E205F6 /* Model */, 6CF439512B83541D004C3543 /* WordAXApp.swift */, 6C4632342BC2D99E003ED0E9 /* Views */, @@ -210,7 +212,7 @@ 6C8185042B88CA210033CF46 /* AnkiView.swift in Sources */, 6CEF7F7D2BC457E600E205F6 /* DataController.swift in Sources */, 6CF439522B83541D004C3543 /* WordAXApp.swift in Sources */, - 6CEF7F522BC2DBF800E205F6 /* AddFlashCard.swift in Sources */, + 6CEF7F522BC2DBF800E205F6 /* AddFlashCardView.swift in Sources */, 6C8184FE2B88C9580033CF46 /* WordAX.swift in Sources */, 6CEF7F812BC4694900E205F6 /* WordAXCD.xcdatamodeld in Sources */, 6C81850C2B8BA6BC0033CF46 /* FlashCardListRowView.swift in Sources */, @@ -351,6 +353,7 @@ DEVELOPMENT_TEAM = SSJBLTMP95; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WordAX/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -380,6 +383,7 @@ DEVELOPMENT_TEAM = SSJBLTMP95; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = WordAX/Info.plist; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; diff --git a/WordAX/Info.plist b/WordAX/Info.plist new file mode 100644 index 0000000..eb834af --- /dev/null +++ b/WordAX/Info.plist @@ -0,0 +1,50 @@ + + + + + CFBundleDocumentTypes + + + CFBundleIconFiles + + icon + + CFBundleTypeName + APKG File + LSHandlerRank + Default + LSItemContentTypes + + com.wordax.apkg + + + + LSHandlerRank + Default + + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeDescription + APKG Data + UTTypeIconFiles + + UTTypeIdentifier + com.wordax.apkg + UTTypeTagSpecification + + public.filename-extension + + apkg + APKG + + + + + + diff --git a/WordAX/Views/AddFlashCard.swift b/WordAX/Views/AddFlashCardView.swift similarity index 96% rename from WordAX/Views/AddFlashCard.swift rename to WordAX/Views/AddFlashCardView.swift index db5d3e0..1550fad 100644 --- a/WordAX/Views/AddFlashCard.swift +++ b/WordAX/Views/AddFlashCardView.swift @@ -7,7 +7,7 @@ import SwiftUI -struct AddFlashCard: View { +struct AddFlashCardView: View { @State var text: String = "" @State var description: String = "" @Binding var isShowing: Bool @@ -64,6 +64,6 @@ struct AddFlashCard: View { #Preview { @State var isShowing = true - return AddFlashCard(isShowing: $isShowing) + return AddFlashCardView(isShowing: $isShowing) .environment(\.managedObjectContext, DataController.preview.container.viewContext) } diff --git a/WordAX/Views/FlashCardListView.swift b/WordAX/Views/FlashCardListView.swift index 08473a4..76d3f3b 100644 --- a/WordAX/Views/FlashCardListView.swift +++ b/WordAX/Views/FlashCardListView.swift @@ -54,7 +54,7 @@ struct FlashCardListView: View { Text("Select word to get details about") } .sheet(isPresented: $addFlashcard, content: { - AddFlashCard(isShowing: $addFlashcard) + AddFlashCardView(isShowing: $addFlashcard) }) } } diff --git a/WordAX/Views/SettingsView.swift b/WordAX/Views/SettingsView.swift index 96a7160..c7d7084 100644 --- a/WordAX/Views/SettingsView.swift +++ b/WordAX/Views/SettingsView.swift @@ -6,13 +6,41 @@ // import SwiftUI +import UniformTypeIdentifiers struct SettingsView: View { + @State var isImporting: Bool = false var body: some View { - Text("This is settings") + Group { + // List { + Button(action: { + // open file explorer + isImporting.toggle() + }, label: { + Text("CLICK ME PLSSS") + .frame(maxWidth: .infinity) + .padding() + .background(.yellow) + .clipShape(.buttonBorder) + }) + } + .fileImporter(isPresented: $isImporting, allowedContentTypes: [.apkg]) { result in + switch result { + case .success(let text): + print(text) + case .failure(let error): + print(error) + } + + } +// } } } +extension UTType { + public static let apkg: UTType = UTType(exportedAs: "com.wordax.apkg") +} + #Preview { SettingsView() .environmentObject(WordAXModelView())