First try on uploading apkg files
Not working because defining a custom extension is kicking my ass:/
This commit is contained in:
@@ -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
|
||||
|
||||
<p align="right">(<a href="#readme-top">back to top</a>)</p>
|
||||
|
||||
|
||||
@@ -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 = "<group>"; };
|
||||
6C8185092B8BA5740033CF46 /* FlashCardListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardListView.swift; sourceTree = "<group>"; };
|
||||
6C81850B2B8BA6BC0033CF46 /* FlashCardListRowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FlashCardListRowView.swift; sourceTree = "<group>"; };
|
||||
6CEF7F512BC2DBF800E205F6 /* AddFlashCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFlashCard.swift; sourceTree = "<group>"; };
|
||||
6CD500B52BE15F6D002BF511 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
6CEF7F512BC2DBF800E205F6 /* AddFlashCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFlashCardView.swift; sourceTree = "<group>"; };
|
||||
6CEF7F7C2BC457E600E205F6 /* DataController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataController.swift; sourceTree = "<group>"; };
|
||||
6CEF7F802BC4694900E205F6 /* WordAX.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = WordAX.xcdatamodel; sourceTree = "<group>"; };
|
||||
6CEF7F822BC46B5900E205F6 /* Flashcard+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Flashcard+CoreDataClass.swift"; sourceTree = "<group>"; };
|
||||
@@ -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;
|
||||
|
||||
50
WordAX/Info.plist
Normal file
50
WordAX/Info.plist
Normal file
@@ -0,0 +1,50 @@
|
||||
<?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>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>icon</string>
|
||||
</array>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>APKG File</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>com.wordax.apkg</string>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Default</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>UTExportedTypeDeclarations</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
</array>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>APKG Data</string>
|
||||
<key>UTTypeIconFiles</key>
|
||||
<array/>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>com.wordax.apkg</string>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array>
|
||||
<string>apkg</string>
|
||||
<string>APKG</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -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)
|
||||
}
|
||||
@@ -54,7 +54,7 @@ struct FlashCardListView: View {
|
||||
Text("Select word to get details about")
|
||||
}
|
||||
.sheet(isPresented: $addFlashcard, content: {
|
||||
AddFlashCard(isShowing: $addFlashcard)
|
||||
AddFlashCardView(isShowing: $addFlashcard)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user