commit 2aa40e074260a3fa5cf2c9bcf8473f455ecf3903 Author: Gerrit Linnemann Date: Tue Jul 21 20:22:43 2020 +0200 Initial Commit diff --git a/YAPS.xcodeproj/project.pbxproj b/YAPS.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e80b6c1 --- /dev/null +++ b/YAPS.xcodeproj/project.pbxproj @@ -0,0 +1,363 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + 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 */; }; +/* 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 = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EC2C21CE24C769EB009E7ED1 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + EC2C21C824C769EB009E7ED1 = { + isa = PBXGroup; + children = ( + EC2C21D324C769EB009E7ED1 /* YAPS */, + EC2C21D224C769EB009E7ED1 /* Products */, + ); + sourceTree = ""; + }; + EC2C21D224C769EB009E7ED1 /* Products */ = { + isa = PBXGroup; + children = ( + EC2C21D124C769EB009E7ED1 /* YAPS.app */, + ); + name = Products; + sourceTree = ""; + }; + EC2C21D324C769EB009E7ED1 /* 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 */, + ); + path = YAPS; + sourceTree = ""; + }; + EC2C21DD24C769EF009E7ED1 /* Preview Content */ = { + isa = PBXGroup; + children = ( + EC2C21DE24C769EF009E7ED1 /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EC2C21D024C769EB009E7ED1 /* YAPS */ = { + isa = PBXNativeTarget; + buildConfigurationList = EC2C21E724C769EF009E7ED1 /* Build configuration list for PBXNativeTarget "YAPS" */; + buildPhases = ( + EC2C21CD24C769EB009E7ED1 /* Sources */, + EC2C21CE24C769EB009E7ED1 /* Frameworks */, + EC2C21CF24C769EB009E7ED1 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = YAPS; + productName = YAPS; + productReference = EC2C21D124C769EB009E7ED1 /* YAPS.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EC2C21C924C769EB009E7ED1 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1140; + LastUpgradeCheck = 1140; + ORGANIZATIONNAME = "Adawim UG (haftungsbeschränkt)"; + TargetAttributes = { + EC2C21D024C769EB009E7ED1 = { + CreatedOnToolsVersion = 11.4.1; + }; + }; + }; + buildConfigurationList = EC2C21CC24C769EB009E7ED1 /* Build configuration list for PBXProject "YAPS" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EC2C21C824C769EB009E7ED1; + productRefGroup = EC2C21D224C769EB009E7ED1 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EC2C21D024C769EB009E7ED1 /* YAPS */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EC2C21CF24C769EB009E7ED1 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC2C21E224C769EF009E7ED1 /* Main.storyboard in Resources */, + EC2C21DF24C769EF009E7ED1 /* Preview Assets.xcassets in Resources */, + EC2C21DC24C769EF009E7ED1 /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EC2C21CD24C769EB009E7ED1 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EC2C21D724C769EB009E7ED1 /* ContentView.swift in Sources */, + EC2C21D524C769EB009E7ED1 /* AppDelegate.swift in Sources */, + EC2C21DA24C769EB009E7ED1 /* YAPS.xcdatamodeld in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + EC2C21E024C769EF009E7ED1 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EC2C21E124C769EF009E7ED1 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EC2C21E524C769EF009E7ED1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EC2C21E624C769EF009E7ED1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.15; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + }; + name = Release; + }; + EC2C21E824C769EF009E7ED1 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = YAPS/YAPS.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_ASSET_PATHS = "\"YAPS/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = YAPS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = com.adawim.yaps.YAPS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + EC2C21E924C769EF009E7ED1 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = YAPS/YAPS.entitlements; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_ASSET_PATHS = "\"YAPS/Preview Content\""; + ENABLE_PREVIEWS = YES; + INFOPLIST_FILE = YAPS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.15; + PRODUCT_BUNDLE_IDENTIFIER = com.adawim.yaps.YAPS; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EC2C21CC24C769EB009E7ED1 /* Build configuration list for PBXProject "YAPS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC2C21E524C769EF009E7ED1 /* Debug */, + EC2C21E624C769EF009E7ED1 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EC2C21E724C769EF009E7ED1 /* Build configuration list for PBXNativeTarget "YAPS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EC2C21E824C769EF009E7ED1 /* Debug */, + EC2C21E924C769EF009E7ED1 /* 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 */; +} diff --git a/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6d0f575 --- /dev/null +++ b/YAPS.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/YAPS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist b/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..d46856a --- /dev/null +++ b/YAPS.xcodeproj/xcuserdata/gerrit.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + YAPS.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/YAPS/AppDelegate.swift b/YAPS/AppDelegate.swift new file mode 100644 index 0000000..1f8fe52 --- /dev/null +++ b/YAPS/AppDelegate.swift @@ -0,0 +1,136 @@ +// +// 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/Assets.xcassets/AppIcon.appiconset/Contents.json b/YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..3f00db4 --- /dev/null +++ b/YAPS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YAPS/Assets.xcassets/Contents.json b/YAPS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/YAPS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YAPS/Base.lproj/Main.storyboard b/YAPS/Base.lproj/Main.storyboard new file mode 100644 index 0000000..ddab67a --- /dev/null +++ b/YAPS/Base.lproj/Main.storyboard @@ -0,0 +1,683 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/YAPS/ContentView.swift b/YAPS/ContentView.swift new file mode 100644 index 0000000..f66f77a --- /dev/null +++ b/YAPS/ContentView.swift @@ -0,0 +1,23 @@ +// +// 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/Info.plist b/YAPS/Info.plist new file mode 100644 index 0000000..f3832a7 --- /dev/null +++ b/YAPS/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2020 Adawim UG (haftungsbeschränkt). All rights reserved. + NSMainStoryboardFile + Main + NSPrincipalClass + NSApplication + NSSupportsAutomaticTermination + + NSSupportsSuddenTermination + + + diff --git a/YAPS/Preview Content/Preview Assets.xcassets/Contents.json b/YAPS/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/YAPS/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YAPS/YAPS.entitlements b/YAPS/YAPS.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/YAPS/YAPS.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + + diff --git a/YAPS/YAPS.xcdatamodeld/.xccurrentversion b/YAPS/YAPS.xcdatamodeld/.xccurrentversion new file mode 100644 index 0000000..d756c4c --- /dev/null +++ b/YAPS/YAPS.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + YAPS.xcdatamodel + + diff --git a/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents b/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents new file mode 100644 index 0000000..50d2514 --- /dev/null +++ b/YAPS/YAPS.xcdatamodeld/YAPS.xcdatamodel/contents @@ -0,0 +1,4 @@ + + + + \ No newline at end of file