From 893829d0e53bfcb651496bb95226977b55bcf551 Mon Sep 17 00:00:00 2001 From: Gerrit Linnemann Date: Sat, 8 Aug 2020 08:38:44 +0200 Subject: [PATCH] Init --- YAPS/AppDelegate.swift | 136 --------------- YAPS/ContentView.swift | 23 --- YAPS/YAPS.xcdatamodeld/.xccurrentversion | 8 - .../YAPS.xcdatamodel/contents | 4 - .../YAPS.xcodeproj}/project.pbxproj | 159 +++++++++--------- .../contents.xcworkspacedata | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcschemes/xcschememanagement.plist | 0 YAPS/YAPS/AppDelegate.swift | 39 +++++ .../AppIcon.appiconset/Contents.json | 0 YAPS/{ => YAPS}/Assets.xcassets/Contents.json | 0 .../file_raw.imageset/Contents.json | 21 +++ .../file_raw.imageset/file_raw.png | Bin 0 -> 4286 bytes YAPS/{ => YAPS}/Base.lproj/Main.storyboard | 0 YAPS/YAPS/ContentView.swift | 54 ++++++ YAPS/YAPS/FinderHelper.swift | 57 +++++++ YAPS/{ => YAPS}/Info.plist | 2 + YAPS/YAPS/Model/YapsFile.swift | 16 ++ .../Preview Assets.xcassets/Contents.json | 0 YAPS/{ => YAPS}/YAPS.entitlements | 0 20 files changed, 268 insertions(+), 251 deletions(-) delete mode 100644 YAPS/AppDelegate.swift delete mode 100644 YAPS/ContentView.swift delete mode 100644 YAPS/YAPS.xcdatamodeld/.xccurrentversion delete mode 100644 YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents rename {YAPS.xcodeproj => YAPS/YAPS.xcodeproj}/project.pbxproj (66%) rename {YAPS.xcodeproj => YAPS/YAPS.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {YAPS.xcodeproj => YAPS/YAPS.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {YAPS.xcodeproj => YAPS/YAPS.xcodeproj}/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist (100%) create mode 100644 YAPS/YAPS/AppDelegate.swift rename YAPS/{ => YAPS}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename YAPS/{ => YAPS}/Assets.xcassets/Contents.json (100%) create mode 100644 YAPS/YAPS/Assets.xcassets/file_raw.imageset/Contents.json create mode 100644 YAPS/YAPS/Assets.xcassets/file_raw.imageset/file_raw.png rename YAPS/{ => YAPS}/Base.lproj/Main.storyboard (100%) create mode 100644 YAPS/YAPS/ContentView.swift create mode 100644 YAPS/YAPS/FinderHelper.swift rename YAPS/{ => YAPS}/Info.plist (93%) create mode 100644 YAPS/YAPS/Model/YapsFile.swift rename YAPS/{ => YAPS}/Preview Content/Preview Assets.xcassets/Contents.json (100%) rename YAPS/{ => YAPS}/YAPS.entitlements (100%) 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 0000000000000000000000000000000000000000..8f1ed75c57016f55c4383b0209402c51d34139c0 GIT binary patch literal 4286 zcmb7Ic{r5q+aCMU2wAh_X{3~G7TZk2WEn4IPw|#8D`S}%Gou+x_C!gx6e2tA+LY{D zLP9D^Btog^t%xl18&toy_j|wZIKJmN=6Rm`xv%Ry&-=XY`}$)N9PR&*5LXfhfj|;A z)|Sq^Cv@c}DhvYg0YYukAduh#ii;b|&CV7@patmSh%`J&mlHteMS(zQ42O;*_>ouu zp5#rTnn0$j>L37xXaaFHu!GvsEl55T>ktNMZ-~7MA;gb>BtkHz;%E+v2M|DF;Q&s6 zKb48%m_Sx>QM~t+&w3DGHH7770x?@51l;T#0Sg*~1nBF+bO=y{5uk6V3pa)vA`P_x zI~o-*qcZ>~9DqZiMgYthg)l@J7y>^oh^aV$W)R6JXG^OejJ%Nv#D~SAqxAIHY_={N zp-W?U>%ovnq#hKm2Z!tMB6OI+R2Gh-LuIP3K&)X{l9&Vrh0dbzNLMg%cv=w41OnmB z13#C8qdQZ)eOSz26jbI9<9HV8ad31!m@ZV0u^OZIkIer&=kLKp!mn6*5W|0U0Yrix z$)6NJqOzDg4%iwvk8n*7%9VuQ%fhi%1AZmr{b}Ajc|;0voe$;&i>@GM5^Kw&y?xC;!5f*PV=`dUyJ3JP8I2tX4FC<23oW6>BZp8arb zFDY0t+ z{m!&f6qG-X>TLqy=nzR{T#!EtVme(|2iW0=B!E{&9Pf>=d8<0dZ0G8Y#3A?xF?sR; zGK~T34ZtydC{%A=kT))bLM8p1(4VZULjNgjM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P@dVCH*e57H)pJ1hRU(>_AZ^QdmHKkKfU{cDycWAO0)Rb zJq!~0Cu08DXXO%o@k(`^m0BD5=8Q$zrezPwu4_U3GZcDSX22$@ZUz(8qLRn@8r)cS{@k+dakdD}OGDL&w~x8!gn+%|kv-u=wlE)JFx_q{nrolhzyCKJdp#v2*CSm)kr%Pu?x4-Y0Q8!FWjb z<^9S#u^zR3(VovTyjmTaURqB+0q$FkB~-*e(Yq*kFi6V>6Rx7Ar8Q|eBlh9RZFI5> zP%;n1RTf^W5v$<)&~#Gt$YJRoHQhp>Tr+nO^o{#yv>_`d!f-d|?iAojcaj=Da}M5~ zi`XODTsX2d+%!V`{f%5*EdLDOwa)zSRY^ImrLVkuG&P2|C1{%_?NbXsJhcISP{&wi zsGfb;NU6|C<>bL~b*JsmEg1Z`ecAW5+a#Q$$C`JUr$I-?1<8?zb>$nX!!bdM@Ah6B zemNO*`_j?W6GgGj+eVUUE*XKE_|Y#FK`u$EGH>+(i1CI&Y`ag{T~SvR*l>bkh4`i0 z`-1i>Uf^fqzeldmzuY;cyA<{H`C

mSBh0oxu0Y{29k3KZP#q5wSxQOaiTH=rlb& zMeW$dE6K@I2dFmbFPxc_4(!2$3e=(MnOm6~6k{JcpS|`mD?3#)_ig>tmhJ8fA2*8J zXl|H(!;IHB==D6Xe?Py(e%n0!bV%cTn8#S+E^uBN#lvE#AjC64-FizleJt$EgA)P5 zeZ;*-J-JV6-zz#0I{7n~S UQc0%P%HIw)SbNK>=3deN0msfl&;S4c literal 0 HcmV?d00001 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