From 913a4dea67e914b25b74d5a7ec53fd9c0fdd1230 Mon Sep 17 00:00:00 2001 From: Tom Baranes Date: Fri, 19 Feb 2016 09:31:32 +0100 Subject: [PATCH] Update sample project --- .../project.pbxproj | 304 -------- .../xcschemes/AdaptiveSpaceItem Demo.xcscheme | 91 --- Demo/AdaptiveSpaceItem Demo/AppDelegate.swift | 27 - .../AppIcon.appiconset/Contents.json | 58 -- .../Base.lproj/MainMenu.xib | 738 ------------------ Demo/AdaptiveSpaceItem Demo/Info.plist | 34 - Demo/AdaptiveSpaceItem Demo/Main.xib | 661 ---------------- .../AdaptiveSpaceItem/AppDelegate.swift | 0 .../AppIcon.appiconset/Contents.json | 0 .../AdaptiveSpaceItem/Base.lproj/MainMenu.xib | 0 .../AdaptiveSpaceItem/Info.plist | 0 .../project.pbxproj | 0 .../xcschemes/AdaptiveSpaceItem Demo.xcscheme | 0 Demo/Source/AdaptiveSpaceItem.swift | 101 --- 14 files changed, 2014 deletions(-) delete mode 100644 Demo/AdaptiveSpaceItem Demo.xcodeproj/project.pbxproj delete mode 100644 Demo/AdaptiveSpaceItem Demo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme delete mode 100644 Demo/AdaptiveSpaceItem Demo/AppDelegate.swift delete mode 100644 Demo/AdaptiveSpaceItem Demo/Assets.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 Demo/AdaptiveSpaceItem Demo/Base.lproj/MainMenu.xib delete mode 100644 Demo/AdaptiveSpaceItem Demo/Info.plist delete mode 100644 Demo/AdaptiveSpaceItem Demo/Main.xib rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItem/AppDelegate.swift (100%) rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItem/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItem/Base.lproj/MainMenu.xib (100%) rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItem/Info.plist (100%) rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItemDemo.xcodeproj/project.pbxproj (100%) rename {AdaptiveSpaceItem => Demo}/AdaptiveSpaceItemDemo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme (100%) delete mode 100644 Demo/Source/AdaptiveSpaceItem.swift diff --git a/Demo/AdaptiveSpaceItem Demo.xcodeproj/project.pbxproj b/Demo/AdaptiveSpaceItem Demo.xcodeproj/project.pbxproj deleted file mode 100644 index ea91de0..0000000 --- a/Demo/AdaptiveSpaceItem Demo.xcodeproj/project.pbxproj +++ /dev/null @@ -1,304 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - E24C8F851C761258000EEF6B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E24C8F841C761258000EEF6B /* AppDelegate.swift */; }; - E24C8F871C761258000EEF6B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E24C8F861C761258000EEF6B /* Assets.xcassets */; }; - E24C8F8A1C761258000EEF6B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E24C8F881C761258000EEF6B /* MainMenu.xib */; }; - E24C8F951C7617E9000EEF6B /* AdaptiveSpaceItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E24C8F941C7617E9000EEF6B /* AdaptiveSpaceItem.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - E24C8F811C761258000EEF6B /* AdaptiveSpaceItem Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "AdaptiveSpaceItem Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - E24C8F841C761258000EEF6B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - E24C8F861C761258000EEF6B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - E24C8F891C761258000EEF6B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - E24C8F8B1C761258000EEF6B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - E24C8F941C7617E9000EEF6B /* AdaptiveSpaceItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AdaptiveSpaceItem.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - E24C8F7E1C761258000EEF6B /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - E24C8F781C761258000EEF6B = { - isa = PBXGroup; - children = ( - E24C8F931C7617E9000EEF6B /* AdaptiveSpaceItem */, - E24C8F831C761258000EEF6B /* AdaptiveSpaceItem Demo */, - E24C8F821C761258000EEF6B /* Products */, - ); - sourceTree = ""; - }; - E24C8F821C761258000EEF6B /* Products */ = { - isa = PBXGroup; - children = ( - E24C8F811C761258000EEF6B /* AdaptiveSpaceItem Demo.app */, - ); - name = Products; - sourceTree = ""; - }; - E24C8F831C761258000EEF6B /* AdaptiveSpaceItem Demo */ = { - isa = PBXGroup; - children = ( - E24C8F9B1C761898000EEF6B /* Classes */, - E24C8F9A1C76188C000EEF6B /* Supporting files */, - ); - path = "AdaptiveSpaceItem Demo"; - sourceTree = ""; - }; - E24C8F931C7617E9000EEF6B /* AdaptiveSpaceItem */ = { - isa = PBXGroup; - children = ( - E24C8F941C7617E9000EEF6B /* AdaptiveSpaceItem.swift */, - ); - name = AdaptiveSpaceItem; - path = Source; - sourceTree = ""; - }; - E24C8F9A1C76188C000EEF6B /* Supporting files */ = { - isa = PBXGroup; - children = ( - E24C8F861C761258000EEF6B /* Assets.xcassets */, - E24C8F8B1C761258000EEF6B /* Info.plist */, - ); - name = "Supporting files"; - sourceTree = ""; - }; - E24C8F9B1C761898000EEF6B /* Classes */ = { - isa = PBXGroup; - children = ( - E24C8F841C761258000EEF6B /* AppDelegate.swift */, - E24C8F881C761258000EEF6B /* MainMenu.xib */, - ); - name = Classes; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - E24C8F801C761258000EEF6B /* AdaptiveSpaceItem Demo */ = { - isa = PBXNativeTarget; - buildConfigurationList = E24C8F8E1C761258000EEF6B /* Build configuration list for PBXNativeTarget "AdaptiveSpaceItem Demo" */; - buildPhases = ( - E24C8F7D1C761258000EEF6B /* Sources */, - E24C8F7E1C761258000EEF6B /* Frameworks */, - E24C8F7F1C761258000EEF6B /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "AdaptiveSpaceItem Demo"; - productName = AdaptiveSpaceItem; - productReference = E24C8F811C761258000EEF6B /* AdaptiveSpaceItem Demo.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - E24C8F791C761258000EEF6B /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0720; - LastUpgradeCheck = 0720; - ORGANIZATIONNAME = Recisio; - TargetAttributes = { - E24C8F801C761258000EEF6B = { - CreatedOnToolsVersion = 7.2.1; - }; - }; - }; - buildConfigurationList = E24C8F7C1C761258000EEF6B /* Build configuration list for PBXProject "AdaptiveSpaceItem Demo" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = E24C8F781C761258000EEF6B; - productRefGroup = E24C8F821C761258000EEF6B /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - E24C8F801C761258000EEF6B /* AdaptiveSpaceItem Demo */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - E24C8F7F1C761258000EEF6B /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E24C8F871C761258000EEF6B /* Assets.xcassets in Resources */, - E24C8F8A1C761258000EEF6B /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - E24C8F7D1C761258000EEF6B /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - E24C8F851C761258000EEF6B /* AppDelegate.swift in Sources */, - E24C8F951C7617E9000EEF6B /* AdaptiveSpaceItem.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - E24C8F881C761258000EEF6B /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - E24C8F891C761258000EEF6B /* Base */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - E24C8F8C1C761258000EEF6B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - E24C8F8D1C761258000EEF6B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - }; - name = Release; - }; - E24C8F8F1C761258000EEF6B /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = "$(SRCROOT)/AdaptiveSpaceItem Demo/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.recisio.AdaptiveSpaceItem; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - E24C8F901C761258000EEF6B /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = "$(SRCROOT)/AdaptiveSpaceItem Demo/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.recisio.AdaptiveSpaceItem; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - E24C8F7C1C761258000EEF6B /* Build configuration list for PBXProject "AdaptiveSpaceItem Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E24C8F8C1C761258000EEF6B /* Debug */, - E24C8F8D1C761258000EEF6B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - E24C8F8E1C761258000EEF6B /* Build configuration list for PBXNativeTarget "AdaptiveSpaceItem Demo" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - E24C8F8F1C761258000EEF6B /* Debug */, - E24C8F901C761258000EEF6B /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = E24C8F791C761258000EEF6B /* Project object */; -} diff --git a/Demo/AdaptiveSpaceItem Demo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme b/Demo/AdaptiveSpaceItem Demo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme deleted file mode 100644 index 4f4ac63..0000000 --- a/Demo/AdaptiveSpaceItem Demo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/AdaptiveSpaceItem Demo/AppDelegate.swift b/Demo/AdaptiveSpaceItem Demo/AppDelegate.swift deleted file mode 100644 index db23111..0000000 --- a/Demo/AdaptiveSpaceItem Demo/AppDelegate.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// AppDelegate.swift -// AdaptiveSpaceItem -// -// Created by Tom Baranes on 18/02/16. -// Copyright © 2016 Recisio. All rights reserved. -// - -import Cocoa - -@NSApplicationMain -class AppDelegate: NSObject, NSApplicationDelegate { - - @IBOutlet weak var window: NSWindow! - - - func applicationDidFinishLaunching(aNotification: NSNotification) { - // Insert code here to initialize your application - } - - func applicationWillTerminate(aNotification: NSNotification) { - // Insert code here to tear down your application - } - - -} - diff --git a/Demo/AdaptiveSpaceItem Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Demo/AdaptiveSpaceItem Demo/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index 2db2b1c..0000000 --- a/Demo/AdaptiveSpaceItem Demo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "images" : [ - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "16x16", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "32x32", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "128x128", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "256x256", - "scale" : "2x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "1x" - }, - { - "idiom" : "mac", - "size" : "512x512", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/Demo/AdaptiveSpaceItem Demo/Base.lproj/MainMenu.xib b/Demo/AdaptiveSpaceItem Demo/Base.lproj/MainMenu.xib deleted file mode 100644 index 83e3f08..0000000 --- a/Demo/AdaptiveSpaceItem Demo/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,738 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Demo/AdaptiveSpaceItem Demo/Info.plist b/Demo/AdaptiveSpaceItem Demo/Info.plist deleted file mode 100644 index 98f8577..0000000 --- a/Demo/AdaptiveSpaceItem Demo/Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - Copyright © 2016 Recisio. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/Demo/AdaptiveSpaceItem Demo/Main.xib b/Demo/AdaptiveSpaceItem Demo/Main.xib deleted file mode 100644 index 76a0e7f..0000000 --- a/Demo/AdaptiveSpaceItem Demo/Main.xib +++ /dev/null @@ -1,661 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - Default - - - - - - - Left to Right - - - - - - - Right to Left - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItem/AppDelegate.swift b/Demo/AdaptiveSpaceItem/AppDelegate.swift similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItem/AppDelegate.swift rename to Demo/AdaptiveSpaceItem/AppDelegate.swift diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItem/Assets.xcassets/AppIcon.appiconset/Contents.json b/Demo/AdaptiveSpaceItem/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItem/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Demo/AdaptiveSpaceItem/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItem/Base.lproj/MainMenu.xib b/Demo/AdaptiveSpaceItem/Base.lproj/MainMenu.xib similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItem/Base.lproj/MainMenu.xib rename to Demo/AdaptiveSpaceItem/Base.lproj/MainMenu.xib diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItem/Info.plist b/Demo/AdaptiveSpaceItem/Info.plist similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItem/Info.plist rename to Demo/AdaptiveSpaceItem/Info.plist diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItemDemo.xcodeproj/project.pbxproj b/Demo/AdaptiveSpaceItemDemo.xcodeproj/project.pbxproj similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItemDemo.xcodeproj/project.pbxproj rename to Demo/AdaptiveSpaceItemDemo.xcodeproj/project.pbxproj diff --git a/AdaptiveSpaceItem/AdaptiveSpaceItemDemo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme b/Demo/AdaptiveSpaceItemDemo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme similarity index 100% rename from AdaptiveSpaceItem/AdaptiveSpaceItemDemo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme rename to Demo/AdaptiveSpaceItemDemo.xcodeproj/xcshareddata/xcschemes/AdaptiveSpaceItem Demo.xcscheme diff --git a/Demo/Source/AdaptiveSpaceItem.swift b/Demo/Source/AdaptiveSpaceItem.swift deleted file mode 100644 index 398f355..0000000 --- a/Demo/Source/AdaptiveSpaceItem.swift +++ /dev/null @@ -1,101 +0,0 @@ -// AdaptiveSpaceItem.swift -// -// Copyright (c) 2016 Recisio (http://www.recisio.com) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -import Foundation -import Cocoa - -public class AdaptiveSpaceItem: NSToolbarItem { - - // MARK: - Life cycle - - public override func awakeFromNib() { - super.awakeFromNib() - let adaptiveSpaceItemView = AdaptiveSpaceItemView(frame: NSRect(origin: CGPoint.zero, size: CGSize(width: 1, height: 1))) - adaptiveSpaceItemView.adaptiveSpaceItem = self - view = adaptiveSpaceItemView - - label = "" - } - - // MARK: - Public methods - - public func updateWidth() { - minSize = minSize() - maxSize = maxSize() - } - - // MARK: - Private methods - - private func minSize() -> NSSize { - let items = toolbar?.items - let index = items?.indexOf(self) - guard let unwrappedIndex = index, - unwrappedItems = items, - superviewFrame = view?.superview?.frame where superviewFrame.origin.x > 0 else { - return minSize - } - - guard unwrappedItems.count > unwrappedIndex + 1 else { - return minSize - } - - let nextItem = unwrappedItems[unwrappedIndex + 1] - guard let nextItemView = nextItem.view, - nextItemSuperview = nextItemView.superview, - toolbarFrame = nextItemSuperview.superview?.frame else { - return minSize - } - - let nextFrame = nextItemSuperview.frame - var space = (toolbarFrame.width - nextFrame.width) / CGFloat(2.0) - superviewFrame.origin.x - space = space >= 0.0 ? space : 0 - return NSSize(width: space, height: minSize.height) - } - - private func maxSize() -> NSSize { - return NSSize(width: minSize().width, height: maxSize.height) - } -} - -class AdaptiveSpaceItemView: NSView { - - // MARK: - Properties - - var adaptiveSpaceItem: AdaptiveSpaceItem? - - // MARK: - Life cycle - - override func viewDidMoveToWindow() { - NSNotificationCenter.defaultCenter().addObserver(self, selector: "windowDidResize", name: NSWindowDidResizeNotification, object: self.window) - } - - deinit { - NSNotificationCenter.defaultCenter().removeObserver(self) - } - - // MARK: - Notifications - - func windowDidResize() { - adaptiveSpaceItem?.updateWidth() - } - -}