diff --git a/YAPS/AppDelegate.swift b/YAPS/AppDelegate.swift
deleted file mode 100644
index 1f8fe52..0000000
--- a/YAPS/AppDelegate.swift
+++ /dev/null
@@ -1,136 +0,0 @@
-//
-// AppDelegate.swift
-// YAPS
-//
-// Created by Gerrit Linnemann on 21.07.20.
-// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
-//
-
-import Cocoa
-import SwiftUI
-
-@NSApplicationMain
-class AppDelegate: NSObject, NSApplicationDelegate {
-
- var window: NSWindow!
-
-
- func applicationDidFinishLaunching(_ aNotification: Notification) {
- // Create the SwiftUI view and set the context as the value for the managedObjectContext environment keyPath.
- // Add `@Environment(\.managedObjectContext)` in the views that will need the context.
- let contentView = ContentView().environment(\.managedObjectContext, persistentContainer.viewContext)
-
- // Create the window and set the content view.
- window = NSWindow(
- contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
- styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
- backing: .buffered, defer: false)
- window.center()
- window.setFrameAutosaveName("Main Window")
- window.contentView = NSHostingView(rootView: contentView)
- window.makeKeyAndOrderFront(nil)
- }
-
- func applicationWillTerminate(_ aNotification: Notification) {
- // Insert code here to tear down your application
- }
-
- // MARK: - Core Data stack
-
- lazy var persistentContainer: NSPersistentContainer = {
- /*
- The persistent container for the application. This implementation
- creates and returns a container, having loaded the store for the
- application to it. This property is optional since there are legitimate
- error conditions that could cause the creation of the store to fail.
- */
- let container = NSPersistentContainer(name: "YAPS")
- container.loadPersistentStores(completionHandler: { (storeDescription, error) in
- if let error = error {
- // Replace this implementation with code to handle the error appropriately.
- // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
-
- /*
- Typical reasons for an error here include:
- * The parent directory does not exist, cannot be created, or disallows writing.
- * The persistent store is not accessible, due to permissions or data protection when the device is locked.
- * The device is out of space.
- * The store could not be migrated to the current model version.
- Check the error message to determine what the actual problem was.
- */
- fatalError("Unresolved error \(error)")
- }
- })
- return container
- }()
-
- // MARK: - Core Data Saving and Undo support
-
- @IBAction func saveAction(_ sender: AnyObject?) {
- // Performs the save action for the application, which is to send the save: message to the application's managed object context. Any encountered errors are presented to the user.
- let context = persistentContainer.viewContext
-
- if !context.commitEditing() {
- NSLog("\(NSStringFromClass(type(of: self))) unable to commit editing before saving")
- }
- if context.hasChanges {
- do {
- try context.save()
- } catch {
- // Customize this code block to include application-specific recovery steps.
- let nserror = error as NSError
- NSApplication.shared.presentError(nserror)
- }
- }
- }
-
- func windowWillReturnUndoManager(window: NSWindow) -> UndoManager? {
- // Returns the NSUndoManager for the application. In this case, the manager returned is that of the managed object context for the application.
- return persistentContainer.viewContext.undoManager
- }
-
- func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
- // Save changes in the application's managed object context before the application terminates.
- let context = persistentContainer.viewContext
-
- if !context.commitEditing() {
- NSLog("\(NSStringFromClass(type(of: self))) unable to commit editing to terminate")
- return .terminateCancel
- }
-
- if !context.hasChanges {
- return .terminateNow
- }
-
- do {
- try context.save()
- } catch {
- let nserror = error as NSError
-
- // Customize this code block to include application-specific recovery steps.
- let result = sender.presentError(nserror)
- if (result) {
- return .terminateCancel
- }
-
- let question = NSLocalizedString("Could not save changes while quitting. Quit anyway?", comment: "Quit without saves error question message")
- let info = NSLocalizedString("Quitting now will lose any changes you have made since the last successful save", comment: "Quit without saves error question info");
- let quitButton = NSLocalizedString("Quit anyway", comment: "Quit anyway button title")
- let cancelButton = NSLocalizedString("Cancel", comment: "Cancel button title")
- let alert = NSAlert()
- alert.messageText = question
- alert.informativeText = info
- alert.addButton(withTitle: quitButton)
- alert.addButton(withTitle: cancelButton)
-
- let answer = alert.runModal()
- if answer == .alertSecondButtonReturn {
- return .terminateCancel
- }
- }
- // If we got here, it is time to quit.
- return .terminateNow
- }
-
-}
-
diff --git a/YAPS/ContentView.swift b/YAPS/ContentView.swift
deleted file mode 100644
index f66f77a..0000000
--- a/YAPS/ContentView.swift
+++ /dev/null
@@ -1,23 +0,0 @@
-//
-// ContentView.swift
-// YAPS
-//
-// Created by Gerrit Linnemann on 21.07.20.
-// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
-//
-
-import SwiftUI
-
-struct ContentView: View {
- var body: some View {
- Text("Hello, World!")
- .frame(maxWidth: .infinity, maxHeight: .infinity)
- }
-}
-
-
-struct ContentView_Previews: PreviewProvider {
- static var previews: some View {
- ContentView()
- }
-}
diff --git a/YAPS/YAPS.xcdatamodeld/.xccurrentversion b/YAPS/YAPS.xcdatamodeld/.xccurrentversion
deleted file mode 100644
index d756c4c..0000000
--- a/YAPS/YAPS.xcdatamodeld/.xccurrentversion
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
- _XCCurrentVersionName
- YAPS.xcdatamodel
-
-
diff --git a/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents b/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents
deleted file mode 100644
index 50d2514..0000000
--- a/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/YAPS.xcodeproj/project.pbxproj b/YAPS/YAPS.xcodeproj/project.pbxproj
similarity index 66%
rename from YAPS.xcodeproj/project.pbxproj
rename to YAPS/YAPS.xcodeproj/project.pbxproj
index e80b6c1..5f47c56 100644
--- a/YAPS.xcodeproj/project.pbxproj
+++ b/YAPS/YAPS.xcodeproj/project.pbxproj
@@ -7,28 +7,30 @@
objects = {
/* Begin PBXBuildFile section */
- EC2C21D524C769EB009E7ED1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C21D424C769EB009E7ED1 /* AppDelegate.swift */; };
- EC2C21D724C769EB009E7ED1 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC2C21D624C769EB009E7ED1 /* ContentView.swift */; };
- EC2C21DA24C769EB009E7ED1 /* YAPS.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = EC2C21D824C769EB009E7ED1 /* YAPS.xcdatamodeld */; };
- EC2C21DC24C769EF009E7ED1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC2C21DB24C769EF009E7ED1 /* Assets.xcassets */; };
- EC2C21DF24C769EF009E7ED1 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC2C21DE24C769EF009E7ED1 /* Preview Assets.xcassets */; };
- EC2C21E224C769EF009E7ED1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EC2C21E024C769EF009E7ED1 /* Main.storyboard */; };
+ EC13305B24DAE92D008063CF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC13305A24DAE92D008063CF /* AppDelegate.swift */; };
+ EC13305D24DAE92D008063CF /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC13305C24DAE92D008063CF /* ContentView.swift */; };
+ EC13305F24DAE92E008063CF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC13305E24DAE92E008063CF /* Assets.xcassets */; };
+ EC13306224DAE92E008063CF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC13306124DAE92E008063CF /* Preview Assets.xcassets */; };
+ EC13306524DAE92E008063CF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EC13306324DAE92E008063CF /* Main.storyboard */; };
+ EC13306F24DD687F008063CF /* YapsFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC13306E24DD687F008063CF /* YapsFile.swift */; };
+ EC13307124DDB3F4008063CF /* FinderHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC13307024DDB3F4008063CF /* FinderHelper.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- EC2C21D124C769EB009E7ED1 /* YAPS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YAPS.app; sourceTree = BUILT_PRODUCTS_DIR; };
- EC2C21D424C769EB009E7ED1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
- EC2C21D624C769EB009E7ED1 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
- EC2C21D924C769EB009E7ED1 /* YAPS.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = YAPS.xcdatamodel; sourceTree = ""; };
- EC2C21DB24C769EF009E7ED1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
- EC2C21DE24C769EF009E7ED1 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
- EC2C21E124C769EF009E7ED1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
- EC2C21E324C769EF009E7ED1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- EC2C21E424C769EF009E7ED1 /* YAPS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YAPS.entitlements; sourceTree = ""; };
+ EC13305724DAE92D008063CF /* YAPS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = YAPS.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ EC13305A24DAE92D008063CF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ EC13305C24DAE92D008063CF /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; };
+ EC13305E24DAE92E008063CF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ EC13306124DAE92E008063CF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; };
+ EC13306424DAE92E008063CF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ EC13306624DAE92E008063CF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ EC13306724DAE92E008063CF /* YAPS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = YAPS.entitlements; sourceTree = ""; };
+ EC13306E24DD687F008063CF /* YapsFile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YapsFile.swift; sourceTree = ""; };
+ EC13307024DDB3F4008063CF /* FinderHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FinderHelper.swift; sourceTree = ""; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
- EC2C21CE24C769EB009E7ED1 /* Frameworks */ = {
+ EC13305424DAE92D008063CF /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -38,55 +40,64 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
- EC2C21C824C769EB009E7ED1 = {
+ EC13304E24DAE92D008063CF = {
isa = PBXGroup;
children = (
- EC2C21D324C769EB009E7ED1 /* YAPS */,
- EC2C21D224C769EB009E7ED1 /* Products */,
+ EC13305924DAE92D008063CF /* YAPS */,
+ EC13305824DAE92D008063CF /* Products */,
);
sourceTree = "";
};
- EC2C21D224C769EB009E7ED1 /* Products */ = {
+ EC13305824DAE92D008063CF /* Products */ = {
isa = PBXGroup;
children = (
- EC2C21D124C769EB009E7ED1 /* YAPS.app */,
+ EC13305724DAE92D008063CF /* YAPS.app */,
);
name = Products;
sourceTree = "";
};
- EC2C21D324C769EB009E7ED1 /* YAPS */ = {
+ EC13305924DAE92D008063CF /* YAPS */ = {
isa = PBXGroup;
children = (
- EC2C21D424C769EB009E7ED1 /* AppDelegate.swift */,
- EC2C21D624C769EB009E7ED1 /* ContentView.swift */,
- EC2C21DB24C769EF009E7ED1 /* Assets.xcassets */,
- EC2C21E024C769EF009E7ED1 /* Main.storyboard */,
- EC2C21E324C769EF009E7ED1 /* Info.plist */,
- EC2C21E424C769EF009E7ED1 /* YAPS.entitlements */,
- EC2C21D824C769EB009E7ED1 /* YAPS.xcdatamodeld */,
- EC2C21DD24C769EF009E7ED1 /* Preview Content */,
+ EC13306D24DD685F008063CF /* Model */,
+ EC13305A24DAE92D008063CF /* AppDelegate.swift */,
+ EC13305C24DAE92D008063CF /* ContentView.swift */,
+ EC13305E24DAE92E008063CF /* Assets.xcassets */,
+ EC13306324DAE92E008063CF /* Main.storyboard */,
+ EC13306624DAE92E008063CF /* Info.plist */,
+ EC13306724DAE92E008063CF /* YAPS.entitlements */,
+ EC13306024DAE92E008063CF /* Preview Content */,
+ EC13307024DDB3F4008063CF /* FinderHelper.swift */,
);
path = YAPS;
sourceTree = "";
};
- EC2C21DD24C769EF009E7ED1 /* Preview Content */ = {
+ EC13306024DAE92E008063CF /* Preview Content */ = {
isa = PBXGroup;
children = (
- EC2C21DE24C769EF009E7ED1 /* Preview Assets.xcassets */,
+ EC13306124DAE92E008063CF /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "";
};
+ EC13306D24DD685F008063CF /* Model */ = {
+ isa = PBXGroup;
+ children = (
+ EC13306E24DD687F008063CF /* YapsFile.swift */,
+ );
+ path = Model;
+ sourceTree = "";
+ };
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- EC2C21D024C769EB009E7ED1 /* YAPS */ = {
+ EC13305624DAE92D008063CF /* YAPS */ = {
isa = PBXNativeTarget;
- buildConfigurationList = EC2C21E724C769EF009E7ED1 /* Build configuration list for PBXNativeTarget "YAPS" */;
+ buildConfigurationList = EC13306A24DAE92E008063CF /* Build configuration list for PBXNativeTarget "YAPS" */;
buildPhases = (
- EC2C21CD24C769EB009E7ED1 /* Sources */,
- EC2C21CE24C769EB009E7ED1 /* Frameworks */,
- EC2C21CF24C769EB009E7ED1 /* Resources */,
+ EC13305324DAE92D008063CF /* Sources */,
+ EC13305424DAE92D008063CF /* Frameworks */,
+ EC13305524DAE92D008063CF /* Resources */,
);
buildRules = (
);
@@ -94,25 +105,25 @@
);
name = YAPS;
productName = YAPS;
- productReference = EC2C21D124C769EB009E7ED1 /* YAPS.app */;
+ productReference = EC13305724DAE92D008063CF /* YAPS.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
- EC2C21C924C769EB009E7ED1 /* Project object */ = {
+ EC13304F24DAE92D008063CF /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1140;
LastUpgradeCheck = 1140;
ORGANIZATIONNAME = "Adawim UG (haftungsbeschränkt)";
TargetAttributes = {
- EC2C21D024C769EB009E7ED1 = {
+ EC13305624DAE92D008063CF = {
CreatedOnToolsVersion = 11.4.1;
};
};
};
- buildConfigurationList = EC2C21CC24C769EB009E7ED1 /* Build configuration list for PBXProject "YAPS" */;
+ buildConfigurationList = EC13305224DAE92D008063CF /* Build configuration list for PBXProject "YAPS" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
@@ -120,47 +131,48 @@
en,
Base,
);
- mainGroup = EC2C21C824C769EB009E7ED1;
- productRefGroup = EC2C21D224C769EB009E7ED1 /* Products */;
+ mainGroup = EC13304E24DAE92D008063CF;
+ productRefGroup = EC13305824DAE92D008063CF /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
- EC2C21D024C769EB009E7ED1 /* YAPS */,
+ EC13305624DAE92D008063CF /* YAPS */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
- EC2C21CF24C769EB009E7ED1 /* Resources */ = {
+ EC13305524DAE92D008063CF /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- EC2C21E224C769EF009E7ED1 /* Main.storyboard in Resources */,
- EC2C21DF24C769EF009E7ED1 /* Preview Assets.xcassets in Resources */,
- EC2C21DC24C769EF009E7ED1 /* Assets.xcassets in Resources */,
+ EC13306524DAE92E008063CF /* Main.storyboard in Resources */,
+ EC13306224DAE92E008063CF /* Preview Assets.xcassets in Resources */,
+ EC13305F24DAE92E008063CF /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
- EC2C21CD24C769EB009E7ED1 /* Sources */ = {
+ EC13305324DAE92D008063CF /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- EC2C21D724C769EB009E7ED1 /* ContentView.swift in Sources */,
- EC2C21D524C769EB009E7ED1 /* AppDelegate.swift in Sources */,
- EC2C21DA24C769EB009E7ED1 /* YAPS.xcdatamodeld in Sources */,
+ EC13305D24DAE92D008063CF /* ContentView.swift in Sources */,
+ EC13307124DDB3F4008063CF /* FinderHelper.swift in Sources */,
+ EC13306F24DD687F008063CF /* YapsFile.swift in Sources */,
+ EC13305B24DAE92D008063CF /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
- EC2C21E024C769EF009E7ED1 /* Main.storyboard */ = {
+ EC13306324DAE92E008063CF /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
- EC2C21E124C769EF009E7ED1 /* Base */,
+ EC13306424DAE92E008063CF /* Base */,
);
name = Main.storyboard;
sourceTree = "";
@@ -168,7 +180,7 @@
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
- EC2C21E524C769EF009E7ED1 /* Debug */ = {
+ EC13306824DAE92E008063CF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
@@ -228,7 +240,7 @@
};
name = Debug;
};
- EC2C21E624C769EF009E7ED1 /* Release */ = {
+ EC13306924DAE92E008063CF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
@@ -281,7 +293,7 @@
};
name = Release;
};
- EC2C21E824C769EF009E7ED1 /* Debug */ = {
+ EC13306B24DAE92E008063CF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -296,13 +308,13 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = com.adawim.yaps.YAPS;
+ PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
- EC2C21E924C769EF009E7ED1 /* Release */ = {
+ EC13306C24DAE92E008063CF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
@@ -317,7 +329,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
- PRODUCT_BUNDLE_IDENTIFIER = com.adawim.yaps.YAPS;
+ PRODUCT_BUNDLE_IDENTIFIER = com.adawim.macos.YAPS;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
@@ -326,38 +338,25 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- EC2C21CC24C769EB009E7ED1 /* Build configuration list for PBXProject "YAPS" */ = {
+ EC13305224DAE92D008063CF /* Build configuration list for PBXProject "YAPS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- EC2C21E524C769EF009E7ED1 /* Debug */,
- EC2C21E624C769EF009E7ED1 /* Release */,
+ EC13306824DAE92E008063CF /* Debug */,
+ EC13306924DAE92E008063CF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
- EC2C21E724C769EF009E7ED1 /* Build configuration list for PBXNativeTarget "YAPS" */ = {
+ EC13306A24DAE92E008063CF /* Build configuration list for PBXNativeTarget "YAPS" */ = {
isa = XCConfigurationList;
buildConfigurations = (
- EC2C21E824C769EF009E7ED1 /* Debug */,
- EC2C21E924C769EF009E7ED1 /* Release */,
+ EC13306B24DAE92E008063CF /* Debug */,
+ EC13306C24DAE92E008063CF /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
-
-/* Begin XCVersionGroup section */
- EC2C21D824C769EB009E7ED1 /* YAPS.xcdatamodeld */ = {
- isa = XCVersionGroup;
- children = (
- EC2C21D924C769EB009E7ED1 /* YAPS.xcdatamodel */,
- );
- currentVersion = EC2C21D924C769EB009E7ED1 /* YAPS.xcdatamodel */;
- path = YAPS.xcdatamodeld;
- sourceTree = "";
- versionGroupType = wrapper.xcdatamodel;
- };
-/* End XCVersionGroup section */
};
- rootObject = EC2C21C924C769EB009E7ED1 /* Project object */;
+ rootObject = EC13304F24DAE92D008063CF /* Project object */;
}
diff --git a/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/YAPS/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
similarity index 100%
rename from YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
rename to YAPS/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata
diff --git a/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/YAPS/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
similarity index 100%
rename from YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
rename to YAPS/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
diff --git a/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist b/YAPS/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist
similarity index 100%
rename from YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist
rename to YAPS/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist
diff --git a/YAPS/YAPS/AppDelegate.swift b/YAPS/YAPS/AppDelegate.swift
new file mode 100644
index 0000000..14aa509
--- /dev/null
+++ b/YAPS/YAPS/AppDelegate.swift
@@ -0,0 +1,39 @@
+//
+// AppDelegate.swift
+// YAPS
+//
+// Created by Gerrit Linnemann on 05.08.20.
+// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
+//
+
+import Cocoa
+import SwiftUI
+
+@NSApplicationMain
+class AppDelegate: NSObject, NSApplicationDelegate {
+
+ var window: NSWindow!
+
+
+ func applicationDidFinishLaunching(_ aNotification: Notification) {
+ // Create the SwiftUI view that provides the window contents.
+ let contentView = ContentView(finderHelper: FinderHelper())
+
+ // Create the window and set the content view.
+ window = NSWindow(
+ contentRect: NSRect(x: 0, y: 0, width: 480, height: 300),
+ styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],
+ backing: .buffered, defer: false)
+ window.center()
+ window.setFrameAutosaveName("Main Window")
+ window.contentView = NSHostingView(rootView: contentView)
+ window.makeKeyAndOrderFront(nil)
+ }
+
+ func applicationWillTerminate(_ aNotification: Notification) {
+ // Insert code here to tear down your application
+ }
+
+
+}
+
diff --git a/YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json b/YAPS/YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json
similarity index 100%
rename from YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json
rename to YAPS/YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json
diff --git a/YAPS/Assets.xcassets/Contents.json b/YAPS/YAPS/Assets.xcassets/Contents.json
similarity index 100%
rename from YAPS/Assets.xcassets/Contents.json
rename to YAPS/YAPS/Assets.xcassets/Contents.json
diff --git a/YAPS/YAPS/Assets.xcassets/file_raw.imageset/Contents.json b/YAPS/YAPS/Assets.xcassets/file_raw.imageset/Contents.json
new file mode 100644
index 0000000..ae0670e
--- /dev/null
+++ b/YAPS/YAPS/Assets.xcassets/file_raw.imageset/Contents.json
@@ -0,0 +1,21 @@
+{
+ "images" : [
+ {
+ "filename" : "file_raw.png",
+ "idiom" : "universal",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "2x"
+ },
+ {
+ "idiom" : "universal",
+ "scale" : "3x"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/YAPS/YAPS/Assets.xcassets/file_raw.imageset/file_raw.png b/YAPS/YAPS/Assets.xcassets/file_raw.imageset/file_raw.png
new file mode 100644
index 0000000..8f1ed75
Binary files /dev/null and b/YAPS/YAPS/Assets.xcassets/file_raw.imageset/file_raw.png differ
diff --git a/YAPS/Base.lproj/Main.storyboard b/YAPS/YAPS/Base.lproj/Main.storyboard
similarity index 100%
rename from YAPS/Base.lproj/Main.storyboard
rename to YAPS/YAPS/Base.lproj/Main.storyboard
diff --git a/YAPS/YAPS/ContentView.swift b/YAPS/YAPS/ContentView.swift
new file mode 100644
index 0000000..92c2708
--- /dev/null
+++ b/YAPS/YAPS/ContentView.swift
@@ -0,0 +1,54 @@
+//
+// ContentView.swift
+// YAPS
+//
+// Created by Gerrit Linnemann on 05.08.20.
+// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
+//
+
+import SwiftUI
+
+struct ContentView: View {
+
+ @State var fileList = [YapsFile]()
+
+ var finderHelper: FinderHelper
+
+ var body: some View {
+ HStack {
+ VStack {
+ HStack {
+ Button(action: {
+ self.fileList.append(contentsOf: self.finderHelper.selectFolder())
+ }) {
+ Text("Select Folder")
+ }
+ }
+
+ List {
+ ForEach(self.fileList, id: \.self) { yapsFile in
+ HStack {
+ Image("file_raw").resizable().frame(width: 20, height: 20)
+ Text(yapsFile.name)
+ }
+ .onTapGesture(perform: {
+ print("pressed \(yapsFile.name)")
+ })
+ }
+
+ }
+
+ Text("THUMBNAIL")
+ }
+
+ Text("Hello, World!")
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ }
+ }
+}
+
+struct ContentView_Previews: PreviewProvider {
+ static var previews: some View {
+ ContentView(finderHelper: FinderHelper())
+ }
+}
diff --git a/YAPS/YAPS/FinderHelper.swift b/YAPS/YAPS/FinderHelper.swift
new file mode 100644
index 0000000..790ed40
--- /dev/null
+++ b/YAPS/YAPS/FinderHelper.swift
@@ -0,0 +1,57 @@
+//
+// FinderHelper.swift
+// YAPS
+//
+// Created by Gerrit Linnemann on 07.08.20.
+// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
+//
+
+import Foundation
+import SwiftUI
+
+class FinderHelper {
+
+ func selectFolder() -> [YapsFile] {
+ let dialog = NSOpenPanel();
+ var fileList = [YapsFile]()
+
+ dialog.title = "Select folder of images"
+ dialog.showsResizeIndicator = true
+ dialog.showsHiddenFiles = false
+ dialog.allowsMultipleSelection = false
+ dialog.canChooseFiles = false
+ dialog.canChooseDirectories = true
+
+ if(dialog.runModal() == NSApplication.ModalResponse.OK) {
+ let result = dialog.url
+
+ if(result != nil) {
+ let path: String = result!.path
+ print("Use \(path)")
+ fileList.append(contentsOf: getFilesList(path: result!))
+ }
+ } else {
+ // User clicked on "Cancel"
+ }
+
+ return fileList
+ }
+
+ func getFilesList(path: URL) -> [YapsFile] {
+ let fm = FileManager.default
+ var fileList = [YapsFile]()
+
+ do {
+ let items = try fm.contentsOfDirectory(at: path, includingPropertiesForKeys: nil, options: .skipsHiddenFiles)
+
+ for item in items {
+ let yapsFile: YapsFile = YapsFile(name: item.lastPathComponent, file: item)
+ fileList.append(yapsFile)
+ }
+ } catch {
+ // failed to read directory – bad permissions, perhaps?
+ }
+
+ return fileList
+ }
+}
diff --git a/YAPS/Info.plist b/YAPS/YAPS/Info.plist
similarity index 93%
rename from YAPS/Info.plist
rename to YAPS/YAPS/Info.plist
index f3832a7..0fc6573 100644
--- a/YAPS/Info.plist
+++ b/YAPS/YAPS/Info.plist
@@ -20,6 +20,8 @@
1.0
CFBundleVersion
1
+ LSApplicationCategoryType
+ public.app-category.photography
LSMinimumSystemVersion
$(MACOSX_DEPLOYMENT_TARGET)
NSHumanReadableCopyright
diff --git a/YAPS/YAPS/Model/YapsFile.swift b/YAPS/YAPS/Model/YapsFile.swift
new file mode 100644
index 0000000..1f4dbd7
--- /dev/null
+++ b/YAPS/YAPS/Model/YapsFile.swift
@@ -0,0 +1,16 @@
+//
+// File.swift
+// YAPS
+//
+// Created by Gerrit Linnemann on 07.08.20.
+// Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved.
+//
+
+import Foundation
+
+struct YapsFile: Identifiable, Hashable {
+ let id = UUID()
+
+ var name: String
+ var file: URL
+}
diff --git a/YAPS/Preview Content/Preview Assets.xcassets/Contents.json b/YAPS/YAPS/Preview Content/Preview Assets.xcassets/Contents.json
similarity index 100%
rename from YAPS/Preview Content/Preview Assets.xcassets/Contents.json
rename to YAPS/YAPS/Preview Content/Preview Assets.xcassets/Contents.json
diff --git a/YAPS/YAPS.entitlements b/YAPS/YAPS/YAPS.entitlements
similarity index 100%
rename from YAPS/YAPS.entitlements
rename to YAPS/YAPS/YAPS.entitlements