├── .gitignore ├── MacTech Demo Objective-C ├── MacTech Demo.xcodeproj │ └── project.pbxproj └── MacTech Demo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Swede 1024.png │ │ ├── Swede 256.png │ │ └── Swede 512.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Info.plist │ ├── MainWindowController.h │ ├── MainWindowController.m │ ├── MainWindowController.xib │ ├── Script.sh │ └── main.m ├── MacTech Demo Python ├── MacTech Demo.xcodeproj │ └── project.pbxproj └── MacTech Demo │ ├── AppDelegate.py │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Swede 1024.png │ │ ├── Swede 256.png │ │ └── Swede 512.png │ ├── Info.plist │ ├── MainWindowController.py │ ├── MainWindowController.xib │ ├── Script.sh │ ├── en.lproj │ ├── Credits.rtf │ └── MainMenu.xib │ ├── main.m │ └── main.py ├── MacTech Demo Swift kopia ├── MacTech Demo.xcodeproj │ └── project.pbxproj └── MacTech Demo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Swede 1024.png │ │ ├── Swede 256.png │ │ └── Swede 512.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Info.plist │ ├── MainWindowController.swift │ ├── MainWindowController.xib │ └── Script.sh ├── MacTech Demo Swift ├── MacTech Demo.xcodeproj │ └── project.pbxproj └── MacTech Demo │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── Swede 1024.png │ │ ├── Swede 256.png │ │ └── Swede 512.png │ ├── Base.lproj │ └── MainMenu.xib │ ├── Info.plist │ ├── MainWindowController.swift │ ├── MainWindowController.xib │ └── Script.sh ├── Presentation ├── MacTech 2016.key ├── MacTech 2016.pdf └── Xcode notes.markdown └── README.markdown /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.pyc 3 | *.pbxuser 4 | *.mode1v3 5 | *.mode2v3 6 | *.perspectivev3 7 | *.xcuserstate 8 | project.xcworkspace/ 9 | xcuserdata/ 10 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 660305CF1DDA180500916663 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 660305CE1DDA180500916663 /* AppDelegate.m */; }; 11 | 660305D21DDA180500916663 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 660305D11DDA180500916663 /* main.m */; }; 12 | 660305D41DDA180500916663 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 660305D31DDA180500916663 /* Assets.xcassets */; }; 13 | 660305D71DDA180500916663 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 660305D51DDA180500916663 /* MainMenu.xib */; }; 14 | 660305E11DDA182F00916663 /* MainWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 660305DF1DDA182F00916663 /* MainWindowController.m */; }; 15 | 660305E21DDA182F00916663 /* MainWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 660305E01DDA182F00916663 /* MainWindowController.xib */; }; 16 | 660305E51DDA1AB100916663 /* Script.sh in Resources */ = {isa = PBXBuildFile; fileRef = 660305E41DDA1AB100916663 /* Script.sh */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXFileReference section */ 20 | 660305CA1DDA180500916663 /* MacTech Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MacTech Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 21 | 660305CD1DDA180500916663 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 22 | 660305CE1DDA180500916663 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 23 | 660305D11DDA180500916663 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 24 | 660305D31DDA180500916663 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 25 | 660305D61DDA180500916663 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 26 | 660305D81DDA180500916663 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 27 | 660305DE1DDA182F00916663 /* MainWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainWindowController.h; sourceTree = ""; }; 28 | 660305DF1DDA182F00916663 /* MainWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainWindowController.m; sourceTree = ""; }; 29 | 660305E01DDA182F00916663 /* MainWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindowController.xib; sourceTree = ""; }; 30 | 660305E41DDA1AB100916663 /* Script.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Script.sh; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 660305C71DDA180500916663 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | 660305C11DDA180500916663 = { 45 | isa = PBXGroup; 46 | children = ( 47 | 660305CC1DDA180500916663 /* MacTech Demo */, 48 | 660305CB1DDA180500916663 /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | 660305CB1DDA180500916663 /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | 660305CA1DDA180500916663 /* MacTech Demo.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | 660305CC1DDA180500916663 /* MacTech Demo */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | 660305CD1DDA180500916663 /* AppDelegate.h */, 64 | 660305CE1DDA180500916663 /* AppDelegate.m */, 65 | 660305DE1DDA182F00916663 /* MainWindowController.h */, 66 | 660305DF1DDA182F00916663 /* MainWindowController.m */, 67 | 660305E01DDA182F00916663 /* MainWindowController.xib */, 68 | 660305D31DDA180500916663 /* Assets.xcassets */, 69 | 660305D51DDA180500916663 /* MainMenu.xib */, 70 | 660305D81DDA180500916663 /* Info.plist */, 71 | 660305D01DDA180500916663 /* Supporting Files */, 72 | 660305E41DDA1AB100916663 /* Script.sh */, 73 | ); 74 | path = "MacTech Demo"; 75 | sourceTree = ""; 76 | }; 77 | 660305D01DDA180500916663 /* Supporting Files */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | 660305D11DDA180500916663 /* main.m */, 81 | ); 82 | name = "Supporting Files"; 83 | sourceTree = ""; 84 | }; 85 | /* End PBXGroup section */ 86 | 87 | /* Begin PBXNativeTarget section */ 88 | 660305C91DDA180500916663 /* MacTech Demo */ = { 89 | isa = PBXNativeTarget; 90 | buildConfigurationList = 660305DB1DDA180500916663 /* Build configuration list for PBXNativeTarget "MacTech Demo" */; 91 | buildPhases = ( 92 | 660305C61DDA180500916663 /* Sources */, 93 | 660305C71DDA180500916663 /* Frameworks */, 94 | 660305C81DDA180500916663 /* Resources */, 95 | 660305E31DDA1A8200916663 /* ShellScript */, 96 | ); 97 | buildRules = ( 98 | ); 99 | dependencies = ( 100 | ); 101 | name = "MacTech Demo"; 102 | productName = "MacTech Demo"; 103 | productReference = 660305CA1DDA180500916663 /* MacTech Demo.app */; 104 | productType = "com.apple.product-type.application"; 105 | }; 106 | /* End PBXNativeTarget section */ 107 | 108 | /* Begin PBXProject section */ 109 | 660305C21DDA180500916663 /* Project object */ = { 110 | isa = PBXProject; 111 | attributes = { 112 | LastUpgradeCheck = 0810; 113 | ORGANIZATIONNAME = MacTech; 114 | TargetAttributes = { 115 | 660305C91DDA180500916663 = { 116 | CreatedOnToolsVersion = 8.1; 117 | ProvisioningStyle = Automatic; 118 | }; 119 | }; 120 | }; 121 | buildConfigurationList = 660305C51DDA180500916663 /* Build configuration list for PBXProject "MacTech Demo" */; 122 | compatibilityVersion = "Xcode 3.2"; 123 | developmentRegion = English; 124 | hasScannedForEncodings = 0; 125 | knownRegions = ( 126 | en, 127 | Base, 128 | ); 129 | mainGroup = 660305C11DDA180500916663; 130 | productRefGroup = 660305CB1DDA180500916663 /* Products */; 131 | projectDirPath = ""; 132 | projectRoot = ""; 133 | targets = ( 134 | 660305C91DDA180500916663 /* MacTech Demo */, 135 | ); 136 | }; 137 | /* End PBXProject section */ 138 | 139 | /* Begin PBXResourcesBuildPhase section */ 140 | 660305C81DDA180500916663 /* Resources */ = { 141 | isa = PBXResourcesBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | 660305D41DDA180500916663 /* Assets.xcassets in Resources */, 145 | 660305E21DDA182F00916663 /* MainWindowController.xib in Resources */, 146 | 660305D71DDA180500916663 /* MainMenu.xib in Resources */, 147 | 660305E51DDA1AB100916663 /* Script.sh in Resources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXResourcesBuildPhase section */ 152 | 153 | /* Begin PBXShellScriptBuildPhase section */ 154 | 660305E31DDA1A8200916663 /* ShellScript */ = { 155 | isa = PBXShellScriptBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | ); 159 | inputPaths = ( 160 | ); 161 | outputPaths = ( 162 | ); 163 | runOnlyForDeploymentPostprocessing = 0; 164 | shellPath = /bin/sh; 165 | shellScript = "chmod +x \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh\"\n"; 166 | }; 167 | /* End PBXShellScriptBuildPhase section */ 168 | 169 | /* Begin PBXSourcesBuildPhase section */ 170 | 660305C61DDA180500916663 /* Sources */ = { 171 | isa = PBXSourcesBuildPhase; 172 | buildActionMask = 2147483647; 173 | files = ( 174 | 660305E11DDA182F00916663 /* MainWindowController.m in Sources */, 175 | 660305D21DDA180500916663 /* main.m in Sources */, 176 | 660305CF1DDA180500916663 /* AppDelegate.m in Sources */, 177 | ); 178 | runOnlyForDeploymentPostprocessing = 0; 179 | }; 180 | /* End PBXSourcesBuildPhase section */ 181 | 182 | /* Begin PBXVariantGroup section */ 183 | 660305D51DDA180500916663 /* MainMenu.xib */ = { 184 | isa = PBXVariantGroup; 185 | children = ( 186 | 660305D61DDA180500916663 /* Base */, 187 | ); 188 | name = MainMenu.xib; 189 | sourceTree = ""; 190 | }; 191 | /* End PBXVariantGroup section */ 192 | 193 | /* Begin XCBuildConfiguration section */ 194 | 660305D91DDA180500916663 /* Debug */ = { 195 | isa = XCBuildConfiguration; 196 | buildSettings = { 197 | ALWAYS_SEARCH_USER_PATHS = NO; 198 | CLANG_ANALYZER_NONNULL = YES; 199 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 200 | CLANG_CXX_LIBRARY = "libc++"; 201 | CLANG_ENABLE_MODULES = YES; 202 | CLANG_ENABLE_OBJC_ARC = YES; 203 | CLANG_WARN_BOOL_CONVERSION = YES; 204 | CLANG_WARN_CONSTANT_CONVERSION = YES; 205 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 206 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 207 | CLANG_WARN_EMPTY_BODY = YES; 208 | CLANG_WARN_ENUM_CONVERSION = YES; 209 | CLANG_WARN_INFINITE_RECURSION = YES; 210 | CLANG_WARN_INT_CONVERSION = YES; 211 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 212 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 213 | CLANG_WARN_UNREACHABLE_CODE = YES; 214 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 215 | CODE_SIGN_IDENTITY = "-"; 216 | COPY_PHASE_STRIP = NO; 217 | DEBUG_INFORMATION_FORMAT = dwarf; 218 | ENABLE_STRICT_OBJC_MSGSEND = YES; 219 | ENABLE_TESTABILITY = YES; 220 | GCC_C_LANGUAGE_STANDARD = gnu99; 221 | GCC_DYNAMIC_NO_PIC = NO; 222 | GCC_NO_COMMON_BLOCKS = YES; 223 | GCC_OPTIMIZATION_LEVEL = 0; 224 | GCC_PREPROCESSOR_DEFINITIONS = ( 225 | "DEBUG=1", 226 | "$(inherited)", 227 | ); 228 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 229 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 230 | GCC_WARN_UNDECLARED_SELECTOR = YES; 231 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 232 | GCC_WARN_UNUSED_FUNCTION = YES; 233 | GCC_WARN_UNUSED_VARIABLE = YES; 234 | MACOSX_DEPLOYMENT_TARGET = 10.12; 235 | MTL_ENABLE_DEBUG_INFO = YES; 236 | ONLY_ACTIVE_ARCH = YES; 237 | SDKROOT = macosx; 238 | }; 239 | name = Debug; 240 | }; 241 | 660305DA1DDA180500916663 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_ANALYZER_NONNULL = YES; 246 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 247 | CLANG_CXX_LIBRARY = "libc++"; 248 | CLANG_ENABLE_MODULES = YES; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_BOOL_CONVERSION = YES; 251 | CLANG_WARN_CONSTANT_CONVERSION = YES; 252 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 253 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 254 | CLANG_WARN_EMPTY_BODY = YES; 255 | CLANG_WARN_ENUM_CONVERSION = YES; 256 | CLANG_WARN_INFINITE_RECURSION = YES; 257 | CLANG_WARN_INT_CONVERSION = YES; 258 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 259 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | CODE_SIGN_IDENTITY = "-"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | MACOSX_DEPLOYMENT_TARGET = 10.12; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = macosx; 278 | }; 279 | name = Release; 280 | }; 281 | 660305DC1DDA180500916663 /* Debug */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 285 | COMBINE_HIDPI_IMAGES = YES; 286 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 287 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 288 | MACOSX_DEPLOYMENT_TARGET = 10.10; 289 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 290 | PRODUCT_NAME = "$(TARGET_NAME)"; 291 | }; 292 | name = Debug; 293 | }; 294 | 660305DD1DDA180500916663 /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | COMBINE_HIDPI_IMAGES = YES; 299 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 300 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 301 | MACOSX_DEPLOYMENT_TARGET = 10.10; 302 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | }; 305 | name = Release; 306 | }; 307 | /* End XCBuildConfiguration section */ 308 | 309 | /* Begin XCConfigurationList section */ 310 | 660305C51DDA180500916663 /* Build configuration list for PBXProject "MacTech Demo" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | 660305D91DDA180500916663 /* Debug */, 314 | 660305DA1DDA180500916663 /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | defaultConfigurationName = Release; 318 | }; 319 | 660305DB1DDA180500916663 /* Build configuration list for PBXNativeTarget "MacTech Demo" */ = { 320 | isa = XCConfigurationList; 321 | buildConfigurations = ( 322 | 660305DC1DDA180500916663 /* Debug */, 323 | 660305DD1DDA180500916663 /* Release */, 324 | ); 325 | defaultConfigurationIsVisible = 0; 326 | }; 327 | /* End XCConfigurationList section */ 328 | }; 329 | rootObject = 660305C21DDA180500916663 /* Project object */; 330 | } 331 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // MacTech Demo 4 | // 5 | // Created by Pelle on 2016-11-14. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : NSObject 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // MacTech Demo 4 | // 5 | // Created by Pelle on 2016-11-14. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "MainWindowController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @property MainWindowController *mainWindowController; 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 21 | // Insert code here to initialize your application 22 | self.mainWindowController = [[MainWindowController alloc] initWithWindowNibName:@"MainWindowController"]; 23 | [self.mainWindowController showWindow:self]; 24 | } 25 | 26 | 27 | - (void)applicationWillTerminate:(NSNotification *)aNotification { 28 | // Insert code here to tear down your application 29 | } 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "size" : "128x128", 30 | "idiom" : "mac", 31 | "filename" : "Swede 256.png", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "size" : "256x256", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Swede 512.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "size" : "512x512", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "size" : "512x512", 52 | "idiom" : "mac", 53 | "filename" : "Swede 1024.png", 54 | "scale" : "2x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Objective-C/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Base.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | Default 534 | 535 | 536 | 537 | 538 | 539 | 540 | Left to Right 541 | 542 | 543 | 544 | 545 | 546 | 547 | Right to Left 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | Default 559 | 560 | 561 | 562 | 563 | 564 | 565 | Left to Right 566 | 567 | 568 | 569 | 570 | 571 | 572 | Right to Left 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2016 MacTech. All rights reserved. 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/MainWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.h 3 | // MacTech Demo 4 | // 5 | // Created by Pelle on 2016-11-14. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainWindowController : NSWindowController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/MainWindowController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.m 3 | // MacTech Demo 4 | // 5 | // Created by Pelle on 2016-11-14. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | #import "MainWindowController.h" 10 | 11 | @interface MainWindowController () 12 | 13 | @property (weak) IBOutlet NSTextField *spokenTextField; 14 | 15 | @end 16 | 17 | @implementation MainWindowController 18 | 19 | - (void)windowDidLoad { 20 | [super windowDidLoad]; 21 | 22 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 23 | } 24 | 25 | 26 | - (IBAction)speakButtonClicked:(NSButton *)sender { 27 | NSLog(@"Speak button clicked"); 28 | NSLog(@"%@", self.spokenTextField.stringValue); 29 | 30 | NSString *scriptPath = [[NSBundle mainBundle] pathForResource:@"Script" ofType:@"sh"]; 31 | if (scriptPath) { 32 | NSTask *scriptProcess = [NSTask launchedTaskWithLaunchPath:scriptPath arguments:@[self.spokenTextField.stringValue]]; 33 | [scriptProcess waitUntilExit]; 34 | } else { 35 | NSLog(@"Couldn't find Script.sh"); 36 | } 37 | 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/MainWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script.sh 4 | # MacTech Demo 5 | # 6 | # Created by Pelle on 2016-11-14. 7 | # Copyright © 2016 MacTech. All rights reserved. 8 | 9 | echo "Script running with args '$@'" 10 | say -v Alva "$@" 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /MacTech Demo Objective-C/MacTech Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // MacTech Demo 4 | // 5 | // Created by Pelle on 2016-11-14. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) { 12 | return NSApplicationMain(argc, argv); 13 | } 14 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6641451B1DDA1C76004AA66E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6641451A1DDA1C76004AA66E /* Cocoa.framework */; }; 11 | 664145231DDA1C76004AA66E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 664145221DDA1C76004AA66E /* main.m */; }; 12 | 664145261DDA1C76004AA66E /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 664145241DDA1C76004AA66E /* Credits.rtf */; }; 13 | 664145291DDA1C76004AA66E /* libpython2.7.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 664145281DDA1C76004AA66E /* libpython2.7.dylib */; }; 14 | 6641452B1DDA1C76004AA66E /* main.py in Resources */ = {isa = PBXBuildFile; fileRef = 6641452A1DDA1C76004AA66E /* main.py */; }; 15 | 6641452D1DDA1C76004AA66E /* AppDelegate.py in Resources */ = {isa = PBXBuildFile; fileRef = 6641452C1DDA1C76004AA66E /* AppDelegate.py */; }; 16 | 664145301DDA1C76004AA66E /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6641452E1DDA1C76004AA66E /* MainMenu.xib */; }; 17 | 664145321DDA1C76004AA66E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 664145311DDA1C76004AA66E /* Assets.xcassets */; }; 18 | 6641453A1DDA1CD9004AA66E /* MainWindowController.py in Resources */ = {isa = PBXBuildFile; fileRef = 664145391DDA1CD9004AA66E /* MainWindowController.py */; }; 19 | 6641453C1DDA1CF1004AA66E /* MainWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6641453B1DDA1CF1004AA66E /* MainWindowController.xib */; }; 20 | 669761811DDA204600EEA7AC /* Script.sh in Resources */ = {isa = PBXBuildFile; fileRef = 669761801DDA204600EEA7AC /* Script.sh */; }; 21 | /* End PBXBuildFile section */ 22 | 23 | /* Begin PBXFileReference section */ 24 | 664145171DDA1C76004AA66E /* MacTech Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MacTech Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 6641451A1DDA1C76004AA66E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 26 | 6641451D1DDA1C76004AA66E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 27 | 6641451E1DDA1C76004AA66E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 28 | 6641451F1DDA1C76004AA66E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 29 | 664145221DDA1C76004AA66E /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 30 | 664145251DDA1C76004AA66E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; 31 | 664145281DDA1C76004AA66E /* libpython2.7.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpython2.7.dylib; path = /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib; sourceTree = ""; }; 32 | 6641452A1DDA1C76004AA66E /* main.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = main.py; sourceTree = ""; }; 33 | 6641452C1DDA1C76004AA66E /* AppDelegate.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = AppDelegate.py; sourceTree = ""; }; 34 | 6641452F1DDA1C76004AA66E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; 35 | 664145311DDA1C76004AA66E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 36 | 664145331DDA1C76004AA66E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 37 | 664145391DDA1CD9004AA66E /* MainWindowController.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = MainWindowController.py; sourceTree = ""; }; 38 | 6641453B1DDA1CF1004AA66E /* MainWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindowController.xib; sourceTree = ""; }; 39 | 669761801DDA204600EEA7AC /* Script.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Script.sh; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXFrameworksBuildPhase section */ 43 | 664145141DDA1C76004AA66E /* Frameworks */ = { 44 | isa = PBXFrameworksBuildPhase; 45 | buildActionMask = 2147483647; 46 | files = ( 47 | 664145291DDA1C76004AA66E /* libpython2.7.dylib in Frameworks */, 48 | 6641451B1DDA1C76004AA66E /* Cocoa.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 6641450E1DDA1C76004AA66E = { 56 | isa = PBXGroup; 57 | children = ( 58 | 664145201DDA1C76004AA66E /* MacTech Demo */, 59 | 664145191DDA1C76004AA66E /* Frameworks */, 60 | 664145181DDA1C76004AA66E /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 664145181DDA1C76004AA66E /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 664145171DDA1C76004AA66E /* MacTech Demo.app */, 68 | ); 69 | name = Products; 70 | sourceTree = ""; 71 | }; 72 | 664145191DDA1C76004AA66E /* Frameworks */ = { 73 | isa = PBXGroup; 74 | children = ( 75 | 6641451A1DDA1C76004AA66E /* Cocoa.framework */, 76 | 6641451C1DDA1C76004AA66E /* Other Frameworks */, 77 | ); 78 | name = Frameworks; 79 | sourceTree = ""; 80 | }; 81 | 6641451C1DDA1C76004AA66E /* Other Frameworks */ = { 82 | isa = PBXGroup; 83 | children = ( 84 | 6641451D1DDA1C76004AA66E /* AppKit.framework */, 85 | 6641451E1DDA1C76004AA66E /* CoreData.framework */, 86 | 6641451F1DDA1C76004AA66E /* Foundation.framework */, 87 | ); 88 | name = "Other Frameworks"; 89 | sourceTree = ""; 90 | }; 91 | 664145201DDA1C76004AA66E /* MacTech Demo */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 6641452A1DDA1C76004AA66E /* main.py */, 95 | 6641452C1DDA1C76004AA66E /* AppDelegate.py */, 96 | 669761801DDA204600EEA7AC /* Script.sh */, 97 | 664145391DDA1CD9004AA66E /* MainWindowController.py */, 98 | 6641453B1DDA1CF1004AA66E /* MainWindowController.xib */, 99 | 6641452E1DDA1C76004AA66E /* MainMenu.xib */, 100 | 664145311DDA1C76004AA66E /* Assets.xcassets */, 101 | 664145331DDA1C76004AA66E /* Info.plist */, 102 | 664145271DDA1C76004AA66E /* SharedLibraries */, 103 | 664145211DDA1C76004AA66E /* Supporting Files */, 104 | ); 105 | path = "MacTech Demo"; 106 | sourceTree = ""; 107 | }; 108 | 664145211DDA1C76004AA66E /* Supporting Files */ = { 109 | isa = PBXGroup; 110 | children = ( 111 | 664145221DDA1C76004AA66E /* main.m */, 112 | 664145241DDA1C76004AA66E /* Credits.rtf */, 113 | ); 114 | name = "Supporting Files"; 115 | sourceTree = ""; 116 | }; 117 | 664145271DDA1C76004AA66E /* SharedLibraries */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 664145281DDA1C76004AA66E /* libpython2.7.dylib */, 121 | ); 122 | name = SharedLibraries; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 664145161DDA1C76004AA66E /* MacTech Demo */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 664145361DDA1C76004AA66E /* Build configuration list for PBXNativeTarget "MacTech Demo" */; 131 | buildPhases = ( 132 | 664145131DDA1C76004AA66E /* Sources */, 133 | 664145141DDA1C76004AA66E /* Frameworks */, 134 | 664145151DDA1C76004AA66E /* Resources */, 135 | 669761821DDA206600EEA7AC /* ShellScript */, 136 | ); 137 | buildRules = ( 138 | ); 139 | dependencies = ( 140 | ); 141 | name = "MacTech Demo"; 142 | productName = "MacTech Demo"; 143 | productReference = 664145171DDA1C76004AA66E /* MacTech Demo.app */; 144 | productType = "com.apple.product-type.application"; 145 | }; 146 | /* End PBXNativeTarget section */ 147 | 148 | /* Begin PBXProject section */ 149 | 6641450F1DDA1C76004AA66E /* Project object */ = { 150 | isa = PBXProject; 151 | attributes = { 152 | LastUpgradeCheck = 0810; 153 | ORGANIZATIONNAME = MacTech; 154 | TargetAttributes = { 155 | 664145161DDA1C76004AA66E = { 156 | CreatedOnToolsVersion = 8.1; 157 | ProvisioningStyle = Automatic; 158 | }; 159 | }; 160 | }; 161 | buildConfigurationList = 664145121DDA1C76004AA66E /* Build configuration list for PBXProject "MacTech Demo" */; 162 | compatibilityVersion = "Xcode 3.2"; 163 | developmentRegion = English; 164 | hasScannedForEncodings = 0; 165 | knownRegions = ( 166 | en, 167 | ); 168 | mainGroup = 6641450E1DDA1C76004AA66E; 169 | productRefGroup = 664145181DDA1C76004AA66E /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 664145161DDA1C76004AA66E /* MacTech Demo */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 664145151DDA1C76004AA66E /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 6641453C1DDA1CF1004AA66E /* MainWindowController.xib in Resources */, 184 | 664145261DDA1C76004AA66E /* Credits.rtf in Resources */, 185 | 6641452D1DDA1C76004AA66E /* AppDelegate.py in Resources */, 186 | 6641452B1DDA1C76004AA66E /* main.py in Resources */, 187 | 664145301DDA1C76004AA66E /* MainMenu.xib in Resources */, 188 | 664145321DDA1C76004AA66E /* Assets.xcassets in Resources */, 189 | 6641453A1DDA1CD9004AA66E /* MainWindowController.py in Resources */, 190 | 669761811DDA204600EEA7AC /* Script.sh in Resources */, 191 | ); 192 | runOnlyForDeploymentPostprocessing = 0; 193 | }; 194 | /* End PBXResourcesBuildPhase section */ 195 | 196 | /* Begin PBXShellScriptBuildPhase section */ 197 | 669761821DDA206600EEA7AC /* ShellScript */ = { 198 | isa = PBXShellScriptBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | ); 202 | inputPaths = ( 203 | ); 204 | outputPaths = ( 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | shellPath = /bin/sh; 208 | shellScript = "chmod +x \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh\"\n"; 209 | }; 210 | /* End PBXShellScriptBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | 664145131DDA1C76004AA66E /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 664145231DDA1C76004AA66E /* main.m in Sources */, 218 | ); 219 | runOnlyForDeploymentPostprocessing = 0; 220 | }; 221 | /* End PBXSourcesBuildPhase section */ 222 | 223 | /* Begin PBXVariantGroup section */ 224 | 664145241DDA1C76004AA66E /* Credits.rtf */ = { 225 | isa = PBXVariantGroup; 226 | children = ( 227 | 664145251DDA1C76004AA66E /* en */, 228 | ); 229 | name = Credits.rtf; 230 | sourceTree = ""; 231 | }; 232 | 6641452E1DDA1C76004AA66E /* MainMenu.xib */ = { 233 | isa = PBXVariantGroup; 234 | children = ( 235 | 6641452F1DDA1C76004AA66E /* en */, 236 | ); 237 | name = MainMenu.xib; 238 | sourceTree = ""; 239 | }; 240 | /* End PBXVariantGroup section */ 241 | 242 | /* Begin XCBuildConfiguration section */ 243 | 664145341DDA1C76004AA66E /* Debug */ = { 244 | isa = XCBuildConfiguration; 245 | buildSettings = { 246 | ALWAYS_SEARCH_USER_PATHS = NO; 247 | CLANG_ANALYZER_NONNULL = YES; 248 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 249 | CLANG_CXX_LIBRARY = "libc++"; 250 | CLANG_ENABLE_MODULES = YES; 251 | CLANG_ENABLE_OBJC_ARC = YES; 252 | CLANG_WARN_BOOL_CONVERSION = YES; 253 | CLANG_WARN_CONSTANT_CONVERSION = YES; 254 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 255 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 256 | CLANG_WARN_EMPTY_BODY = YES; 257 | CLANG_WARN_ENUM_CONVERSION = YES; 258 | CLANG_WARN_INFINITE_RECURSION = YES; 259 | CLANG_WARN_INT_CONVERSION = YES; 260 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 261 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 262 | CLANG_WARN_UNREACHABLE_CODE = YES; 263 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 264 | CODE_SIGN_IDENTITY = "-"; 265 | COPY_PHASE_STRIP = NO; 266 | DEBUG_INFORMATION_FORMAT = dwarf; 267 | ENABLE_STRICT_OBJC_MSGSEND = YES; 268 | ENABLE_TESTABILITY = YES; 269 | GCC_C_LANGUAGE_STANDARD = gnu99; 270 | GCC_DYNAMIC_NO_PIC = NO; 271 | GCC_NO_COMMON_BLOCKS = YES; 272 | GCC_OPTIMIZATION_LEVEL = 0; 273 | GCC_PREPROCESSOR_DEFINITIONS = ( 274 | "DEBUG=1", 275 | "$(inherited)", 276 | ); 277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 279 | GCC_WARN_UNDECLARED_SELECTOR = YES; 280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 281 | GCC_WARN_UNUSED_FUNCTION = YES; 282 | GCC_WARN_UNUSED_VARIABLE = YES; 283 | HEADER_SEARCH_PATHS = ( 284 | "$(inherited)", 285 | /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7, 286 | ); 287 | LIBRARY_SEARCH_PATHS = ( 288 | "$(inherited)", 289 | "$(SYSTEM_LIBRARY_DIR)/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config", 290 | ); 291 | MACOSX_DEPLOYMENT_TARGET = 10.12; 292 | MTL_ENABLE_DEBUG_INFO = YES; 293 | ONLY_ACTIVE_ARCH = YES; 294 | SDKROOT = macosx; 295 | }; 296 | name = Debug; 297 | }; 298 | 664145351DDA1C76004AA66E /* Release */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_ANALYZER_NONNULL = YES; 303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 304 | CLANG_CXX_LIBRARY = "libc++"; 305 | CLANG_ENABLE_MODULES = YES; 306 | CLANG_ENABLE_OBJC_ARC = YES; 307 | CLANG_WARN_BOOL_CONVERSION = YES; 308 | CLANG_WARN_CONSTANT_CONVERSION = YES; 309 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 310 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 311 | CLANG_WARN_EMPTY_BODY = YES; 312 | CLANG_WARN_ENUM_CONVERSION = YES; 313 | CLANG_WARN_INFINITE_RECURSION = YES; 314 | CLANG_WARN_INT_CONVERSION = YES; 315 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 316 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 317 | CLANG_WARN_UNREACHABLE_CODE = YES; 318 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 319 | CODE_SIGN_IDENTITY = "-"; 320 | COPY_PHASE_STRIP = NO; 321 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 322 | ENABLE_NS_ASSERTIONS = NO; 323 | ENABLE_STRICT_OBJC_MSGSEND = YES; 324 | GCC_C_LANGUAGE_STANDARD = gnu99; 325 | GCC_NO_COMMON_BLOCKS = YES; 326 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 327 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 328 | GCC_WARN_UNDECLARED_SELECTOR = YES; 329 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 330 | GCC_WARN_UNUSED_FUNCTION = YES; 331 | GCC_WARN_UNUSED_VARIABLE = YES; 332 | HEADER_SEARCH_PATHS = ( 333 | "$(inherited)", 334 | /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7, 335 | ); 336 | LIBRARY_SEARCH_PATHS = ( 337 | "$(inherited)", 338 | "$(SYSTEM_LIBRARY_DIR)/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config", 339 | ); 340 | MACOSX_DEPLOYMENT_TARGET = 10.12; 341 | MTL_ENABLE_DEBUG_INFO = NO; 342 | SDKROOT = macosx; 343 | }; 344 | name = Release; 345 | }; 346 | 664145371DDA1C76004AA66E /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 350 | COMBINE_HIDPI_IMAGES = YES; 351 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 352 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 353 | MACOSX_DEPLOYMENT_TARGET = 10.10; 354 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 355 | PRODUCT_NAME = "$(TARGET_NAME)"; 356 | }; 357 | name = Debug; 358 | }; 359 | 664145381DDA1C76004AA66E /* Release */ = { 360 | isa = XCBuildConfiguration; 361 | buildSettings = { 362 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 363 | COMBINE_HIDPI_IMAGES = YES; 364 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 365 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 366 | MACOSX_DEPLOYMENT_TARGET = 10.10; 367 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 368 | PRODUCT_NAME = "$(TARGET_NAME)"; 369 | }; 370 | name = Release; 371 | }; 372 | /* End XCBuildConfiguration section */ 373 | 374 | /* Begin XCConfigurationList section */ 375 | 664145121DDA1C76004AA66E /* Build configuration list for PBXProject "MacTech Demo" */ = { 376 | isa = XCConfigurationList; 377 | buildConfigurations = ( 378 | 664145341DDA1C76004AA66E /* Debug */, 379 | 664145351DDA1C76004AA66E /* Release */, 380 | ); 381 | defaultConfigurationIsVisible = 0; 382 | defaultConfigurationName = Release; 383 | }; 384 | 664145361DDA1C76004AA66E /* Build configuration list for PBXNativeTarget "MacTech Demo" */ = { 385 | isa = XCConfigurationList; 386 | buildConfigurations = ( 387 | 664145371DDA1C76004AA66E /* Debug */, 388 | 664145381DDA1C76004AA66E /* Release */, 389 | ); 390 | defaultConfigurationIsVisible = 0; 391 | defaultConfigurationName = Release; 392 | }; 393 | /* End XCConfigurationList section */ 394 | }; 395 | rootObject = 6641450F1DDA1C76004AA66E /* Project object */; 396 | } 397 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/AppDelegate.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # AppDelegate.py 4 | # MacTech Demo 5 | # 6 | # Created by Pelle on 2016-11-14. 7 | # Copyright (c) 2016 MacTech. All rights reserved. 8 | # 9 | 10 | from Foundation import * 11 | from AppKit import * 12 | from MainWindowController import * 13 | 14 | class AppDelegate(NSObject): 15 | 16 | mainWindowController = None 17 | 18 | def applicationDidFinishLaunching_(self, sender): 19 | self.mainWindowController = MainWindowController.alloc().initWithWindowNibName_(u"MainWindowController") 20 | self.mainWindowController.showWindow_(self) 21 | 22 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "size" : "128x128", 30 | "idiom" : "mac", 31 | "filename" : "Swede 256.png", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "size" : "256x256", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Swede 512.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "size" : "512x512", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "size" : "512x512", 52 | "idiom" : "mac", 53 | "filename" : "Swede 1024.png", 54 | "scale" : "2x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Python/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2016 MacTech. All rights reserved. 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/MainWindowController.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # MainWindowController.py 4 | # MacTech Demo 5 | # 6 | # Created by Pelle on 2016-11-14. 7 | # Copyright (c) 2016 MacTech. All rights reserved. 8 | # 9 | 10 | from objc import YES, NO, IBAction, IBOutlet 11 | from Foundation import * 12 | from AppKit import * 13 | 14 | class MainWindowController(NSWindowController): 15 | 16 | spokenTextField = IBOutlet() 17 | 18 | @IBAction 19 | def speakButtonClicked_(self, sender): 20 | NSLog(u"Speak button clicked") 21 | NSLog(self.spokenTextField.stringValue()) 22 | scriptPath = NSBundle.mainBundle().pathForResource_ofType_(u"Script", u"sh") 23 | if scriptPath: 24 | scriptProcess = NSTask.launchedTaskWithLaunchPath_arguments_(scriptPath, [self.spokenTextField.stringValue()]) 25 | scriptProcess.waitUntilExit() 26 | else: 27 | NSLog(u"Couldn't find Script.sh") 28 | 29 | 30 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/MainWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script.sh 4 | # MacTech Demo 5 | # 6 | # Created by Pelle on 2016-11-14. 7 | # Copyright © 2016 MacTech. All rights reserved. 8 | 9 | echo "Script running with args '$@'" 10 | say -v Alva "$@" 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/en.lproj/Credits.rtf: -------------------------------------------------------------------------------- 1 | {\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;} 2 | {\colortbl;\red255\green255\blue255;} 3 | \paperw9840\paperh8400 4 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural 5 | 6 | \f0\b\fs24 \cf0 Engineering: 7 | \b0 \ 8 | Some people\ 9 | \ 10 | 11 | \b Human Interface Design: 12 | \b0 \ 13 | Some other people\ 14 | \ 15 | 16 | \b Testing: 17 | \b0 \ 18 | Hopefully not nobody\ 19 | \ 20 | 21 | \b Documentation: 22 | \b0 \ 23 | Whoever\ 24 | \ 25 | 26 | \b With special thanks to: 27 | \b0 \ 28 | Mom\ 29 | } 30 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/en.lproj/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | int main(int argc, const char * argv[]) { 5 | 6 | @autoreleasepool { 7 | 8 | NSBundle *mainBundle = [NSBundle mainBundle]; 9 | NSString *resourcePath = [mainBundle resourcePath]; 10 | NSArray *pythonPathArray = [NSArray arrayWithObjects: resourcePath, [resourcePath stringByAppendingPathComponent:@"PyObjC"], nil]; 11 | 12 | setenv("PYTHONPATH", [[pythonPathArray componentsJoinedByString:@":"] UTF8String], 1); 13 | 14 | NSArray *possibleMainExtensions = [NSArray arrayWithObjects: @"py", @"pyc", @"pyo", nil]; 15 | NSString *mainFilePath = nil; 16 | 17 | for (NSString *possibleMainExtension in possibleMainExtensions) { 18 | mainFilePath = [mainBundle pathForResource: @"main" ofType: possibleMainExtension]; 19 | if ( mainFilePath != nil ) break; 20 | } 21 | 22 | if ( !mainFilePath ) { 23 | [NSException raise: NSInternalInconsistencyException format: @"%s:%d main() Failed to find the Main.{py,pyc,pyo} file in the application wrapper's Resources directory.", __FILE__, __LINE__]; 24 | } 25 | 26 | Py_SetProgramName("/usr/bin/python"); 27 | Py_Initialize(); 28 | PySys_SetArgv(argc, (char **)argv); 29 | 30 | const char *mainFilePathPtr = [mainFilePath UTF8String]; 31 | FILE *mainFile = fopen(mainFilePathPtr, "r"); 32 | int result = PyRun_SimpleFile(mainFile, (char *)[[mainFilePath lastPathComponent] UTF8String]); 33 | 34 | if ( result != 0 ) { 35 | [NSException raise: NSInternalInconsistencyException 36 | format: @"%s:%d main() PyRun_SimpleFile failed with file '%@'. See console for errors.", __FILE__, __LINE__, mainFilePath]; 37 | } 38 | return result; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /MacTech Demo Python/MacTech Demo/main.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # main.py 4 | # MacTech Demo 5 | # 6 | # Created by Pelle on 2016-11-14. 7 | # Copyright (c) 2016 MacTech. All rights reserved. 8 | # 9 | 10 | # import modules required by application 11 | import objc 12 | import Foundation 13 | import AppKit 14 | 15 | from PyObjCTools import AppHelper 16 | 17 | # import modules containing classes required to start application and load MainMenu.nib 18 | import AppDelegate 19 | 20 | # pass control to AppKit 21 | AppHelper.runEventLoop() 22 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0850256A1DDCF984001B88DF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 085025691DDCF984001B88DF /* AppDelegate.swift */; }; 11 | 0850256C1DDCF984001B88DF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0850256B1DDCF984001B88DF /* Assets.xcassets */; }; 12 | 0850256F1DDCF984001B88DF /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0850256D1DDCF984001B88DF /* MainMenu.xib */; }; 13 | 085025781DDCFB05001B88DF /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 085025761DDCFB05001B88DF /* MainWindowController.swift */; }; 14 | 085025791DDCFB05001B88DF /* MainWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 085025771DDCFB05001B88DF /* MainWindowController.xib */; }; 15 | 0850257B1DDD11B9001B88DF /* Script.sh in Resources */ = {isa = PBXBuildFile; fileRef = 0850257A1DDD11B9001B88DF /* Script.sh */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 085025661DDCF984001B88DF /* MacTech Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MacTech Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 085025691DDCF984001B88DF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 0850256B1DDCF984001B88DF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 22 | 0850256E1DDCF984001B88DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 23 | 085025701DDCF984001B88DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 24 | 085025761DDCFB05001B88DF /* MainWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = ""; }; 25 | 085025771DDCFB05001B88DF /* MainWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindowController.xib; sourceTree = ""; }; 26 | 0850257A1DDD11B9001B88DF /* Script.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Script.sh; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 085025631DDCF984001B88DF /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 0850255D1DDCF984001B88DF = { 41 | isa = PBXGroup; 42 | children = ( 43 | 085025681DDCF984001B88DF /* MacTech Demo */, 44 | 085025671DDCF984001B88DF /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 085025671DDCF984001B88DF /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 085025661DDCF984001B88DF /* MacTech Demo.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 085025681DDCF984001B88DF /* MacTech Demo */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 085025691DDCF984001B88DF /* AppDelegate.swift */, 60 | 0850256B1DDCF984001B88DF /* Assets.xcassets */, 61 | 0850256D1DDCF984001B88DF /* MainMenu.xib */, 62 | 085025701DDCF984001B88DF /* Info.plist */, 63 | 085025761DDCFB05001B88DF /* MainWindowController.swift */, 64 | 085025771DDCFB05001B88DF /* MainWindowController.xib */, 65 | 0850257A1DDD11B9001B88DF /* Script.sh */, 66 | ); 67 | path = "MacTech Demo"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 085025651DDCF984001B88DF /* MacTech Demo */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 085025731DDCF984001B88DF /* Build configuration list for PBXNativeTarget "MacTech Demo" */; 76 | buildPhases = ( 77 | 085025621DDCF984001B88DF /* Sources */, 78 | 085025631DDCF984001B88DF /* Frameworks */, 79 | 085025641DDCF984001B88DF /* Resources */, 80 | 0850257C1DDD189A001B88DF /* ShellScript */, 81 | ); 82 | buildRules = ( 83 | ); 84 | dependencies = ( 85 | ); 86 | name = "MacTech Demo"; 87 | productName = "MacTech Demo"; 88 | productReference = 085025661DDCF984001B88DF /* MacTech Demo.app */; 89 | productType = "com.apple.product-type.application"; 90 | }; 91 | /* End PBXNativeTarget section */ 92 | 93 | /* Begin PBXProject section */ 94 | 0850255E1DDCF984001B88DF /* Project object */ = { 95 | isa = PBXProject; 96 | attributes = { 97 | LastSwiftUpdateCheck = 0810; 98 | LastUpgradeCheck = 0810; 99 | ORGANIZATIONNAME = MacTech; 100 | TargetAttributes = { 101 | 085025651DDCF984001B88DF = { 102 | CreatedOnToolsVersion = 8.1; 103 | ProvisioningStyle = Automatic; 104 | }; 105 | }; 106 | }; 107 | buildConfigurationList = 085025611DDCF984001B88DF /* Build configuration list for PBXProject "MacTech Demo" */; 108 | compatibilityVersion = "Xcode 3.2"; 109 | developmentRegion = English; 110 | hasScannedForEncodings = 0; 111 | knownRegions = ( 112 | en, 113 | Base, 114 | ); 115 | mainGroup = 0850255D1DDCF984001B88DF; 116 | productRefGroup = 085025671DDCF984001B88DF /* Products */; 117 | projectDirPath = ""; 118 | projectRoot = ""; 119 | targets = ( 120 | 085025651DDCF984001B88DF /* MacTech Demo */, 121 | ); 122 | }; 123 | /* End PBXProject section */ 124 | 125 | /* Begin PBXResourcesBuildPhase section */ 126 | 085025641DDCF984001B88DF /* Resources */ = { 127 | isa = PBXResourcesBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | 0850256C1DDCF984001B88DF /* Assets.xcassets in Resources */, 131 | 085025791DDCFB05001B88DF /* MainWindowController.xib in Resources */, 132 | 0850256F1DDCF984001B88DF /* MainMenu.xib in Resources */, 133 | 0850257B1DDD11B9001B88DF /* Script.sh in Resources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXResourcesBuildPhase section */ 138 | 139 | /* Begin PBXShellScriptBuildPhase section */ 140 | 0850257C1DDD189A001B88DF /* ShellScript */ = { 141 | isa = PBXShellScriptBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | ); 145 | inputPaths = ( 146 | ); 147 | outputPaths = ( 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | shellPath = /bin/sh; 151 | shellScript = "chmod +x \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh\"\n"; 152 | showEnvVarsInLog = 0; 153 | }; 154 | /* End PBXShellScriptBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | 085025621DDCF984001B88DF /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 085025781DDCFB05001B88DF /* MainWindowController.swift in Sources */, 162 | 0850256A1DDCF984001B88DF /* AppDelegate.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin PBXVariantGroup section */ 169 | 0850256D1DDCF984001B88DF /* MainMenu.xib */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 0850256E1DDCF984001B88DF /* Base */, 173 | ); 174 | name = MainMenu.xib; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXVariantGroup section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | 085025711DDCF984001B88DF /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_ANALYZER_NONNULL = YES; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_CONSTANT_CONVERSION = YES; 191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 192 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 193 | CLANG_WARN_EMPTY_BODY = YES; 194 | CLANG_WARN_ENUM_CONVERSION = YES; 195 | CLANG_WARN_INFINITE_RECURSION = YES; 196 | CLANG_WARN_INT_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 199 | CLANG_WARN_UNREACHABLE_CODE = YES; 200 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 201 | CODE_SIGN_IDENTITY = "-"; 202 | COPY_PHASE_STRIP = NO; 203 | DEBUG_INFORMATION_FORMAT = dwarf; 204 | ENABLE_STRICT_OBJC_MSGSEND = YES; 205 | ENABLE_TESTABILITY = YES; 206 | GCC_C_LANGUAGE_STANDARD = gnu99; 207 | GCC_DYNAMIC_NO_PIC = NO; 208 | GCC_NO_COMMON_BLOCKS = YES; 209 | GCC_OPTIMIZATION_LEVEL = 0; 210 | GCC_PREPROCESSOR_DEFINITIONS = ( 211 | "DEBUG=1", 212 | "$(inherited)", 213 | ); 214 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 215 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 216 | GCC_WARN_UNDECLARED_SELECTOR = YES; 217 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 218 | GCC_WARN_UNUSED_FUNCTION = YES; 219 | GCC_WARN_UNUSED_VARIABLE = YES; 220 | MACOSX_DEPLOYMENT_TARGET = 10.12; 221 | MTL_ENABLE_DEBUG_INFO = YES; 222 | ONLY_ACTIVE_ARCH = YES; 223 | SDKROOT = macosx; 224 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 225 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 226 | }; 227 | name = Debug; 228 | }; 229 | 085025721DDCF984001B88DF /* Release */ = { 230 | isa = XCBuildConfiguration; 231 | buildSettings = { 232 | ALWAYS_SEARCH_USER_PATHS = NO; 233 | CLANG_ANALYZER_NONNULL = YES; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_CONSTANT_CONVERSION = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 242 | CLANG_WARN_EMPTY_BODY = YES; 243 | CLANG_WARN_ENUM_CONVERSION = YES; 244 | CLANG_WARN_INFINITE_RECURSION = YES; 245 | CLANG_WARN_INT_CONVERSION = YES; 246 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 247 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 248 | CLANG_WARN_UNREACHABLE_CODE = YES; 249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 250 | CODE_SIGN_IDENTITY = "-"; 251 | COPY_PHASE_STRIP = NO; 252 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 253 | ENABLE_NS_ASSERTIONS = NO; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | GCC_C_LANGUAGE_STANDARD = gnu99; 256 | GCC_NO_COMMON_BLOCKS = YES; 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | MACOSX_DEPLOYMENT_TARGET = 10.12; 264 | MTL_ENABLE_DEBUG_INFO = NO; 265 | SDKROOT = macosx; 266 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 267 | }; 268 | name = Release; 269 | }; 270 | 085025741DDCF984001B88DF /* Debug */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | COMBINE_HIDPI_IMAGES = YES; 275 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 276 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 277 | MACOSX_DEPLOYMENT_TARGET = 10.10; 278 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 279 | PRODUCT_NAME = "$(TARGET_NAME)"; 280 | SWIFT_VERSION = 3.0; 281 | }; 282 | name = Debug; 283 | }; 284 | 085025751DDCF984001B88DF /* Release */ = { 285 | isa = XCBuildConfiguration; 286 | buildSettings = { 287 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 288 | COMBINE_HIDPI_IMAGES = YES; 289 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 290 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 291 | MACOSX_DEPLOYMENT_TARGET = 10.10; 292 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_VERSION = 3.0; 295 | }; 296 | name = Release; 297 | }; 298 | /* End XCBuildConfiguration section */ 299 | 300 | /* Begin XCConfigurationList section */ 301 | 085025611DDCF984001B88DF /* Build configuration list for PBXProject "MacTech Demo" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | 085025711DDCF984001B88DF /* Debug */, 305 | 085025721DDCF984001B88DF /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | 085025731DDCF984001B88DF /* Build configuration list for PBXNativeTarget "MacTech Demo" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | 085025741DDCF984001B88DF /* Debug */, 314 | 085025751DDCF984001B88DF /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = 0850255E1DDCF984001B88DF /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MacTech Demo 4 | // 5 | // Created by MacTech on 2016-11-16. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | var mainWindowController: MainWindowController? 15 | 16 | func applicationDidFinishLaunching(_ aNotification: Notification) { 17 | // Insert code here to initialize your application 18 | self.mainWindowController = MainWindowController(windowNibName: "MainWindowController") 19 | self.mainWindowController?.showWindow(self) 20 | } 21 | 22 | func applicationWillTerminate(_ aNotification: Notification) { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "size" : "128x128", 30 | "idiom" : "mac", 31 | "filename" : "Swede 256.png", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "size" : "256x256", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Swede 512.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "size" : "512x512", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "size" : "512x512", 52 | "idiom" : "mac", 53 | "filename" : "Swede 1024.png", 54 | "scale" : "2x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift kopia/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2016 MacTech. All rights reserved. 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/MainWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.swift 3 | // MacTech Demo 4 | // 5 | // Created by MacTech on 2016-11-16. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MainWindowController: NSWindowController { 12 | 13 | @IBOutlet weak var spokenTextField: NSTextField! 14 | 15 | override func windowDidLoad() { 16 | super.windowDidLoad() 17 | 18 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 19 | } 20 | 21 | @IBAction func pressedReturn(_ sender: Any) { 22 | speakButtonClicked(sender) 23 | } 24 | 25 | @IBAction func speakButtonClicked(_ sender: Any) { 26 | print("Speak button clicked") 27 | print("\(spokenTextField.stringValue)") 28 | if let scriptPath = Bundle.main.path(forResource: "Script", ofType: "sh") { 29 | 30 | let scriptProcess = Process() 31 | scriptProcess.launchPath = scriptPath 32 | scriptProcess.arguments = [spokenTextField.stringValue] 33 | 34 | let stdoutPipe = Pipe() 35 | scriptProcess.standardOutput = stdoutPipe 36 | 37 | scriptProcess.launch() 38 | scriptProcess.waitUntilExit() 39 | 40 | print("Script exited with status \(scriptProcess.terminationStatus)") 41 | 42 | let stdoutData = stdoutPipe.fileHandleForReading.readDataToEndOfFile() 43 | if let stdout = NSString(data: stdoutData, encoding: String.Encoding.utf8.rawValue) { 44 | print("Received stdout: \(stdout)") 45 | } 46 | 47 | } else { 48 | print("Couldn't find Script.sh") 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/MainWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /MacTech Demo Swift kopia/MacTech Demo/Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script.sh 4 | # MacTech Demo 5 | # 6 | # Created by MacTech on 2016-11-16. 7 | # Copyright © 2016 MacTech. All rights reserved. 8 | 9 | echo "Script running with args '$@'" 10 | say -v Alva "$@" 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0850256A1DDCF984001B88DF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 085025691DDCF984001B88DF /* AppDelegate.swift */; }; 11 | 0850256C1DDCF984001B88DF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0850256B1DDCF984001B88DF /* Assets.xcassets */; }; 12 | 0850256F1DDCF984001B88DF /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0850256D1DDCF984001B88DF /* MainMenu.xib */; }; 13 | 085025781DDCFB05001B88DF /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 085025761DDCFB05001B88DF /* MainWindowController.swift */; }; 14 | 085025791DDCFB05001B88DF /* MainWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 085025771DDCFB05001B88DF /* MainWindowController.xib */; }; 15 | 0850257B1DDD11B9001B88DF /* Script.sh in Resources */ = {isa = PBXBuildFile; fileRef = 0850257A1DDD11B9001B88DF /* Script.sh */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXFileReference section */ 19 | 085025661DDCF984001B88DF /* MacTech Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MacTech Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 085025691DDCF984001B88DF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | 0850256B1DDCF984001B88DF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 22 | 0850256E1DDCF984001B88DF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 23 | 085025701DDCF984001B88DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 24 | 085025761DDCFB05001B88DF /* MainWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = ""; }; 25 | 085025771DDCFB05001B88DF /* MainWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainWindowController.xib; sourceTree = ""; }; 26 | 0850257A1DDD11B9001B88DF /* Script.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = Script.sh; sourceTree = ""; }; 27 | /* End PBXFileReference section */ 28 | 29 | /* Begin PBXFrameworksBuildPhase section */ 30 | 085025631DDCF984001B88DF /* Frameworks */ = { 31 | isa = PBXFrameworksBuildPhase; 32 | buildActionMask = 2147483647; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXFrameworksBuildPhase section */ 38 | 39 | /* Begin PBXGroup section */ 40 | 0850255D1DDCF984001B88DF = { 41 | isa = PBXGroup; 42 | children = ( 43 | 085025681DDCF984001B88DF /* MacTech Demo */, 44 | 085025671DDCF984001B88DF /* Products */, 45 | ); 46 | sourceTree = ""; 47 | }; 48 | 085025671DDCF984001B88DF /* Products */ = { 49 | isa = PBXGroup; 50 | children = ( 51 | 085025661DDCF984001B88DF /* MacTech Demo.app */, 52 | ); 53 | name = Products; 54 | sourceTree = ""; 55 | }; 56 | 085025681DDCF984001B88DF /* MacTech Demo */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 085025691DDCF984001B88DF /* AppDelegate.swift */, 60 | 0850256B1DDCF984001B88DF /* Assets.xcassets */, 61 | 0850256D1DDCF984001B88DF /* MainMenu.xib */, 62 | 085025701DDCF984001B88DF /* Info.plist */, 63 | 085025761DDCFB05001B88DF /* MainWindowController.swift */, 64 | 085025771DDCFB05001B88DF /* MainWindowController.xib */, 65 | 0850257A1DDD11B9001B88DF /* Script.sh */, 66 | ); 67 | path = "MacTech Demo"; 68 | sourceTree = ""; 69 | }; 70 | /* End PBXGroup section */ 71 | 72 | /* Begin PBXNativeTarget section */ 73 | 085025651DDCF984001B88DF /* MacTech Demo */ = { 74 | isa = PBXNativeTarget; 75 | buildConfigurationList = 085025731DDCF984001B88DF /* Build configuration list for PBXNativeTarget "MacTech Demo" */; 76 | buildPhases = ( 77 | 085025621DDCF984001B88DF /* Sources */, 78 | 085025631DDCF984001B88DF /* Frameworks */, 79 | 085025641DDCF984001B88DF /* Resources */, 80 | 0850257C1DDD189A001B88DF /* ShellScript */, 81 | ); 82 | buildRules = ( 83 | ); 84 | dependencies = ( 85 | ); 86 | name = "MacTech Demo"; 87 | productName = "MacTech Demo"; 88 | productReference = 085025661DDCF984001B88DF /* MacTech Demo.app */; 89 | productType = "com.apple.product-type.application"; 90 | }; 91 | /* End PBXNativeTarget section */ 92 | 93 | /* Begin PBXProject section */ 94 | 0850255E1DDCF984001B88DF /* Project object */ = { 95 | isa = PBXProject; 96 | attributes = { 97 | LastSwiftUpdateCheck = 0810; 98 | LastUpgradeCheck = 0810; 99 | ORGANIZATIONNAME = MacTech; 100 | TargetAttributes = { 101 | 085025651DDCF984001B88DF = { 102 | CreatedOnToolsVersion = 8.1; 103 | ProvisioningStyle = Automatic; 104 | }; 105 | }; 106 | }; 107 | buildConfigurationList = 085025611DDCF984001B88DF /* Build configuration list for PBXProject "MacTech Demo" */; 108 | compatibilityVersion = "Xcode 3.2"; 109 | developmentRegion = English; 110 | hasScannedForEncodings = 0; 111 | knownRegions = ( 112 | en, 113 | Base, 114 | ); 115 | mainGroup = 0850255D1DDCF984001B88DF; 116 | productRefGroup = 085025671DDCF984001B88DF /* Products */; 117 | projectDirPath = ""; 118 | projectRoot = ""; 119 | targets = ( 120 | 085025651DDCF984001B88DF /* MacTech Demo */, 121 | ); 122 | }; 123 | /* End PBXProject section */ 124 | 125 | /* Begin PBXResourcesBuildPhase section */ 126 | 085025641DDCF984001B88DF /* Resources */ = { 127 | isa = PBXResourcesBuildPhase; 128 | buildActionMask = 2147483647; 129 | files = ( 130 | 0850256C1DDCF984001B88DF /* Assets.xcassets in Resources */, 131 | 085025791DDCFB05001B88DF /* MainWindowController.xib in Resources */, 132 | 0850256F1DDCF984001B88DF /* MainMenu.xib in Resources */, 133 | 0850257B1DDD11B9001B88DF /* Script.sh in Resources */, 134 | ); 135 | runOnlyForDeploymentPostprocessing = 0; 136 | }; 137 | /* End PBXResourcesBuildPhase section */ 138 | 139 | /* Begin PBXShellScriptBuildPhase section */ 140 | 0850257C1DDD189A001B88DF /* ShellScript */ = { 141 | isa = PBXShellScriptBuildPhase; 142 | buildActionMask = 2147483647; 143 | files = ( 144 | ); 145 | inputPaths = ( 146 | ); 147 | outputPaths = ( 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | shellPath = /bin/sh; 151 | shellScript = "chmod +x \"$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh\"\n"; 152 | showEnvVarsInLog = 0; 153 | }; 154 | /* End PBXShellScriptBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | 085025621DDCF984001B88DF /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | 085025781DDCFB05001B88DF /* MainWindowController.swift in Sources */, 162 | 0850256A1DDCF984001B88DF /* AppDelegate.swift in Sources */, 163 | ); 164 | runOnlyForDeploymentPostprocessing = 0; 165 | }; 166 | /* End PBXSourcesBuildPhase section */ 167 | 168 | /* Begin PBXVariantGroup section */ 169 | 0850256D1DDCF984001B88DF /* MainMenu.xib */ = { 170 | isa = PBXVariantGroup; 171 | children = ( 172 | 0850256E1DDCF984001B88DF /* Base */, 173 | ); 174 | name = MainMenu.xib; 175 | sourceTree = ""; 176 | }; 177 | /* End PBXVariantGroup section */ 178 | 179 | /* Begin XCBuildConfiguration section */ 180 | 085025711DDCF984001B88DF /* Debug */ = { 181 | isa = XCBuildConfiguration; 182 | buildSettings = { 183 | ALWAYS_SEARCH_USER_PATHS = NO; 184 | CLANG_ANALYZER_NONNULL = YES; 185 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 186 | CLANG_CXX_LIBRARY = "libc++"; 187 | CLANG_ENABLE_MODULES = YES; 188 | CLANG_ENABLE_OBJC_ARC = YES; 189 | CLANG_WARN_BOOL_CONVERSION = YES; 190 | CLANG_WARN_CONSTANT_CONVERSION = YES; 191 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 192 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 193 | CLANG_WARN_EMPTY_BODY = YES; 194 | CLANG_WARN_ENUM_CONVERSION = YES; 195 | CLANG_WARN_INFINITE_RECURSION = YES; 196 | CLANG_WARN_INT_CONVERSION = YES; 197 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 198 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 199 | CLANG_WARN_UNREACHABLE_CODE = YES; 200 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 201 | CODE_SIGN_IDENTITY = "-"; 202 | COPY_PHASE_STRIP = NO; 203 | DEBUG_INFORMATION_FORMAT = dwarf; 204 | ENABLE_STRICT_OBJC_MSGSEND = YES; 205 | ENABLE_TESTABILITY = YES; 206 | GCC_C_LANGUAGE_STANDARD = gnu99; 207 | GCC_DYNAMIC_NO_PIC = NO; 208 | GCC_NO_COMMON_BLOCKS = YES; 209 | GCC_OPTIMIZATION_LEVEL = 0; 210 | GCC_PREPROCESSOR_DEFINITIONS = ( 211 | "DEBUG=1", 212 | "$(inherited)", 213 | ); 214 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 215 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 216 | GCC_WARN_UNDECLARED_SELECTOR = YES; 217 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 218 | GCC_WARN_UNUSED_FUNCTION = YES; 219 | GCC_WARN_UNUSED_VARIABLE = YES; 220 | MACOSX_DEPLOYMENT_TARGET = 10.12; 221 | MTL_ENABLE_DEBUG_INFO = YES; 222 | ONLY_ACTIVE_ARCH = YES; 223 | SDKROOT = macosx; 224 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 225 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 226 | }; 227 | name = Debug; 228 | }; 229 | 085025721DDCF984001B88DF /* Release */ = { 230 | isa = XCBuildConfiguration; 231 | buildSettings = { 232 | ALWAYS_SEARCH_USER_PATHS = NO; 233 | CLANG_ANALYZER_NONNULL = YES; 234 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 235 | CLANG_CXX_LIBRARY = "libc++"; 236 | CLANG_ENABLE_MODULES = YES; 237 | CLANG_ENABLE_OBJC_ARC = YES; 238 | CLANG_WARN_BOOL_CONVERSION = YES; 239 | CLANG_WARN_CONSTANT_CONVERSION = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 242 | CLANG_WARN_EMPTY_BODY = YES; 243 | CLANG_WARN_ENUM_CONVERSION = YES; 244 | CLANG_WARN_INFINITE_RECURSION = YES; 245 | CLANG_WARN_INT_CONVERSION = YES; 246 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 247 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 248 | CLANG_WARN_UNREACHABLE_CODE = YES; 249 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 250 | CODE_SIGN_IDENTITY = "-"; 251 | COPY_PHASE_STRIP = NO; 252 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 253 | ENABLE_NS_ASSERTIONS = NO; 254 | ENABLE_STRICT_OBJC_MSGSEND = YES; 255 | GCC_C_LANGUAGE_STANDARD = gnu99; 256 | GCC_NO_COMMON_BLOCKS = YES; 257 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 258 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 259 | GCC_WARN_UNDECLARED_SELECTOR = YES; 260 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 261 | GCC_WARN_UNUSED_FUNCTION = YES; 262 | GCC_WARN_UNUSED_VARIABLE = YES; 263 | MACOSX_DEPLOYMENT_TARGET = 10.12; 264 | MTL_ENABLE_DEBUG_INFO = NO; 265 | SDKROOT = macosx; 266 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 267 | }; 268 | name = Release; 269 | }; 270 | 085025741DDCF984001B88DF /* Debug */ = { 271 | isa = XCBuildConfiguration; 272 | buildSettings = { 273 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 274 | COMBINE_HIDPI_IMAGES = YES; 275 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 276 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 277 | MACOSX_DEPLOYMENT_TARGET = 10.10; 278 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 279 | PRODUCT_NAME = "$(TARGET_NAME)"; 280 | SWIFT_VERSION = 3.0; 281 | }; 282 | name = Debug; 283 | }; 284 | 085025751DDCF984001B88DF /* Release */ = { 285 | isa = XCBuildConfiguration; 286 | buildSettings = { 287 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 288 | COMBINE_HIDPI_IMAGES = YES; 289 | INFOPLIST_FILE = "MacTech Demo/Info.plist"; 290 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 291 | MACOSX_DEPLOYMENT_TARGET = 10.10; 292 | PRODUCT_BUNDLE_IDENTIFIER = "com.mactech.MacTech-Demo"; 293 | PRODUCT_NAME = "$(TARGET_NAME)"; 294 | SWIFT_VERSION = 3.0; 295 | }; 296 | name = Release; 297 | }; 298 | /* End XCBuildConfiguration section */ 299 | 300 | /* Begin XCConfigurationList section */ 301 | 085025611DDCF984001B88DF /* Build configuration list for PBXProject "MacTech Demo" */ = { 302 | isa = XCConfigurationList; 303 | buildConfigurations = ( 304 | 085025711DDCF984001B88DF /* Debug */, 305 | 085025721DDCF984001B88DF /* Release */, 306 | ); 307 | defaultConfigurationIsVisible = 0; 308 | defaultConfigurationName = Release; 309 | }; 310 | 085025731DDCF984001B88DF /* Build configuration list for PBXNativeTarget "MacTech Demo" */ = { 311 | isa = XCConfigurationList; 312 | buildConfigurations = ( 313 | 085025741DDCF984001B88DF /* Debug */, 314 | 085025751DDCF984001B88DF /* Release */, 315 | ); 316 | defaultConfigurationIsVisible = 0; 317 | }; 318 | /* End XCConfigurationList section */ 319 | }; 320 | rootObject = 0850255E1DDCF984001B88DF /* Project object */; 321 | } 322 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // MacTech Demo 4 | // 5 | // Created by MacTech on 2016-11-16. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | var mainWindowController: MainWindowController? 15 | 16 | func applicationDidFinishLaunching(_ aNotification: Notification) { 17 | // Insert code here to initialize your application 18 | self.mainWindowController = MainWindowController(windowNibName: "MainWindowController") 19 | self.mainWindowController?.showWindow(self) 20 | } 21 | 22 | func applicationWillTerminate(_ aNotification: Notification) { 23 | // Insert code here to tear down your application 24 | } 25 | 26 | 27 | } 28 | 29 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "size" : "128x128", 30 | "idiom" : "mac", 31 | "filename" : "Swede 256.png", 32 | "scale" : "2x" 33 | }, 34 | { 35 | "idiom" : "mac", 36 | "size" : "256x256", 37 | "scale" : "1x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "Swede 512.png", 43 | "scale" : "2x" 44 | }, 45 | { 46 | "idiom" : "mac", 47 | "size" : "512x512", 48 | "scale" : "1x" 49 | }, 50 | { 51 | "size" : "512x512", 52 | "idiom" : "mac", 53 | "filename" : "Swede 1024.png", 54 | "scale" : "2x" 55 | } 56 | ], 57 | "info" : { 58 | "version" : 1, 59 | "author" : "xcode" 60 | } 61 | } -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 1024.png -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 256.png -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/MacTech Demo Swift/MacTech Demo/Assets.xcassets/AppIcon.appiconset/Swede 512.png -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2016 MacTech. All rights reserved. 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/MainWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainWindowController.swift 3 | // MacTech Demo 4 | // 5 | // Created by MacTech on 2016-11-16. 6 | // Copyright © 2016 MacTech. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class MainWindowController: NSWindowController { 12 | 13 | @IBOutlet weak var spokenTextField: NSTextField! 14 | 15 | override func windowDidLoad() { 16 | super.windowDidLoad() 17 | 18 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 19 | } 20 | 21 | @IBAction func speakButtonClicked(_ sender: Any) { 22 | print("Speak button clicked") 23 | print("\(spokenTextField.stringValue)") 24 | if let scriptPath = Bundle.main.path(forResource: "Script", ofType: "sh") { 25 | let scriptProcess = Process.launchedProcess(launchPath: scriptPath, arguments: [spokenTextField.stringValue]) 26 | scriptProcess.waitUntilExit() 27 | } else { 28 | print("Couldn't find Script.sh") 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/MainWindowController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /MacTech Demo Swift/MacTech Demo/Script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script.sh 4 | # MacTech Demo 5 | # 6 | # Created by MacTech on 2016-11-16. 7 | # Copyright © 2016 MacTech. All rights reserved. 8 | 9 | echo "Script running with args '$@'" 10 | say -v Alva "$@" 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /Presentation/MacTech 2016.key: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/Presentation/MacTech 2016.key -------------------------------------------------------------------------------- /Presentation/MacTech 2016.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MagerValp/MacTech-2016/ead5eeb777a8313137b819e976893095ea788dc4/Presentation/MacTech 2016.pdf -------------------------------------------------------------------------------- /Presentation/Xcode notes.markdown: -------------------------------------------------------------------------------- 1 | # MacTech Demo app 2 | 3 | * Create a new project 4 | * Cocoa Application 5 | * `MacTech Demo` 6 | * `MacTech` 7 | * `com.mactech` 8 | * Swift 9 | * No Storyboards or tests 10 | * No git 11 | * Project structure 12 | * MacTech Demo.app 13 | * `Info.plist` 14 | * `MainMenu.xib` 15 | * An interface builder document that contains the main menu 16 | * `Assets.xcassets` 17 | * Add icons 18 | * `AppDelegate.swift` 19 | * Target Settings 20 | * Identity 21 | * Signing 22 | * If we have time at the end and wifi works 23 | * It used to be a pain in the butt, but with Xcode8 it's a lot nicer 24 | * Deployment Info 25 | * Deployment Target 26 | 27 | ## Add UI & Controller 28 | 29 | You can start with either the model or the view. I'm going to start with the view since it's satisfying to see something up on the screen. 30 | 31 | * File -> New -> File… 32 | * Cocoa class 33 | * MainWindowController 34 | * Also create XIB file for UI 35 | * Group: MacTech Demo 36 | * Targets: MacTech Demo 37 | * `MainWindowController.xib` 38 | * Window 39 | * Attributes inspector 40 | * Title: Swede-o-tron 41 | * Uncheck resize 42 | * Object Library 43 | * NSButton 44 | * NSTextField 45 | * Connect to controller 46 | * We want to connect our view objects here, to the controller code here 47 | * Easiest way is the Assistant editor that will show us two related files 48 | * Select xib 49 | * Assistant Editor 50 | * Got crowded, hide navigator and utilities 51 | * Control click from `NSTextField` to `MainWindowController` 52 | * Outlet 53 | * `spokenTextField` 54 | * Control click from `NSButton` to `MainWindowController` 55 | * Action 56 | * `speakButtonClicked` 57 | * Go back to standard editor 58 | * `MainWindowController.swift` 59 | * `print("Speak button clicked")` 60 | * `print("\(spokenTextField)")` 61 | 62 | 63 | ## Build and run 64 | 65 | * Not what we want 66 | * Our window is missing 67 | 68 | 69 | ## Connect MainWindowController to AppDelegate 70 | 71 | * `MainMenu.xib` 72 | * Remove Window 73 | * `AppDelegate.swift` 74 | * Remove window outlet 75 | * `var mainWindowController: MainWindowController?` 76 | * `applicationDidFinishLaunching` 77 | * `self.mainWindowController = MainWindowController(windowNibName: "MainWindowController")` 78 | * `self.mainWindowController?.showWindow(self)` 79 | * xib -> nib 80 | 81 | 82 | ## Build and run 83 | 84 | * NSTextField object address, not what we want 85 | 86 | 87 | ## spokenTextField.stringValue 88 | 89 | * `MainWindowController.swift` 90 | * `spokenTextField` 91 | * Help 92 | * The parent class, NSControl, provides the methods for setting the values of the text field, for example: stringValue, doubleValue, etc.. There are corresponding methods to retrieve values. 93 | * `spokenTextField.stringValue` 94 | 95 | 96 | ## Build and run 97 | 98 | * View done 99 | * controller acts as expected 100 | * ready to add model 101 | 102 | 103 | ## Add model 104 | 105 | * File -> New -> File… 106 | * If we were creating the model in Swift, we could just add a Swift file, write a function, and call that from the controller 107 | * Shell Script 108 | * Script.sh 109 | * Group: MacTech Demo 110 | * Targets: MacTech Demo 111 | * Script.sh 112 | * `echo "Script running with args '$@'"` 113 | * `say -v Alva "$@"` 114 | * `exit 0` 115 | * How do we run that from the controller? 116 | * Google "cocoa run shell script" 117 | * NSTask 118 | * Swift 119 | * Process instead of NSTask 120 | * Apple has started cleaning up and renaming APIs 121 | * Most just strip the NS prefix 122 | * NextStep 123 | * `speakButtonClicked` 124 | * `// let scriptProcess = Process.launchedProcess(launchPath: <#T##String#>, arguments: [spokenTextField.stringValue])` 125 | * How do we find the path to Script.sh? 126 | * NSBundle -> Bundle 127 | * `let scriptPath = Bundle.main.path(forResource: "Script", ofType: "sh")` 128 | * `let scriptProcess = Process.launchedProcess(launchPath: scriptPath, arguments: [spokenTextField.stringValue])` 129 | * optional 130 | * `Bundle.main.path(forResource` help 131 | * String with a question mark 132 | * Means that either it returns a string, or it returns nothing 133 | * Most languages like Objective-C and Python don't tell you, you're just supposed to know that it's nil or None 134 | * Swift forces you to handle optionals 135 | * Easiest way is to add an if clause 136 | * `if let scriptPath = Bundle.main.path(forResource: "Script", ofType: "sh") {` 137 | * `scriptProcess.waitUntilExit()` 138 | 139 | 140 | ## Build and run 141 | 142 | * Crash on click 143 | * launch path not accessible 144 | * `MacTech Demo.app` 145 | * Show in Finder 146 | * Show package contents 147 | * `Script.sh` is in Resources, but not executable 148 | * A couple of ways to fix that, none of them easy or intuitive 149 | 150 | 151 | ## Add Build Phase with chmod 152 | 153 | * MacTech Demo target settings 154 | * Build Phases 155 | * Compile Sources 156 | * Copy Bundle Resources 157 | * No options for copy 158 | * New Run Script Phase 159 | * `env | sort` 160 | * `exit 1` 161 | * Build and fail 162 | * Click on error to jump to build log 163 | * Filter on /Resources 164 | * `UNLOCALIZED_RESOURCES_FOLDER_PATH` 165 | * Filter on target 166 | * `TARGET_BUILD_DIR` 167 | * Run Script 168 | * `chmod +x "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh"` 169 | 170 | 171 | ## Build and run 172 | 173 | * Success! 174 | 175 | 176 | ## Export app 177 | 178 | * Product -> Archive 179 | * Organizer Window 180 | * Export… 181 | * Export as a macOS App 182 | 183 | 184 | 185 | 186 | @NSApplicationMain 187 | class AppDelegate: NSObject, NSApplicationDelegate { 188 | 189 | var mainWindowController: MainWindowController? 190 | 191 | func applicationDidFinishLaunching(_ aNotification: Notification) { 192 | // Insert code here to initialize your application 193 | self.mainWindowController = MainWindowController(windowNibName: "MainWindowController") 194 | self.mainWindowController?.showWindow(self) 195 | } 196 | 197 | func applicationWillTerminate(_ aNotification: Notification) { 198 | // Insert code here to tear down your application 199 | } 200 | 201 | 202 | } 203 | 204 | 205 | class MainWindowController: NSWindowController { 206 | 207 | @IBOutlet weak var spokenTextField: NSTextField! 208 | 209 | override func windowDidLoad() { 210 | super.windowDidLoad() 211 | 212 | // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file. 213 | } 214 | 215 | @IBAction func speakButtonClicked(_ sender: Any) { 216 | print("Speak button clicked") 217 | print("\(spokenTextField.stringValue)") 218 | 219 | if let scriptPath = Bundle.main.path(forResource: "Script", ofType: "sh") { 220 | let scriptProcess = Process.launchedProcess(launchPath: scriptPath, arguments: [spokenTextField.stringValue]) 221 | scriptProcess.waitUntilExit() 222 | } else { 223 | print("Couldn't find Script.sh") 224 | } 225 | 226 | } 227 | 228 | } 229 | 230 | 231 | echo "Script running with args '$@'" 232 | say -v Alva "$@" 233 | 234 | exit 0 235 | 236 | 237 | chmod +x "$TARGET_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH/Script.sh" 238 | 239 | 240 | ## Bonus: Code signing 241 | 242 | 243 | 244 | ## Bonus: Create pkg when archiving 245 | 246 | * Product -> Scheme -> Edit Scheme… 247 | * Archive -> Post-actions 248 | * `archive_pkg.sh` 249 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | Build your first Mac app with Xcode 2 | =================================== 3 | 4 | Here are the slides (with speaker notes) and the demo app I built during my MacTech 2016 presentation, Build your first Mac app with Xcode. I built the app in Swift during the talk, but I've also added Objective-C and Python versions in this repo. 5 | 6 | 7 | Things I Didn't Have Time To Cover 8 | ---------------------------------- 9 | 10 | 11 | ### Capturing stdout and exit status 12 | 13 | To capture the output from your shell script, create an `NSPipe`, assign that to the `NSTask`'s `standardInput`, and then read it using the pipe's `fileHandleForReading`. Exit status is available in `terminationStatus`. 14 | 15 | ```swift 16 | let scriptProcess = Process() 17 | scriptProcess.launchPath = scriptPath 18 | scriptProcess.arguments = [spokenTextField.stringValue] 19 | 20 | let stdoutPipe = Pipe() 21 | scriptProcess.standardOutput = stdoutPipe 22 | 23 | scriptProcess.launch() 24 | scriptProcess.waitUntilExit() 25 | 26 | print("Script exited with status \(scriptProcess.terminationStatus)") 27 | 28 | let stdoutData = stdoutPipe.fileHandleForReading.readDataToEndOfFile() 29 | if let stdout = NSString(data: stdoutData, encoding: String.Encoding.utf8.rawValue) { 30 | print("Received stdout: \(stdout)") 31 | } 32 | ``` 33 | 34 | NB: If the script outputs more data than will fit in the pipe's buffer (which is on the order of 8 kB or so), it'll hang waiting for it to be emptied. For reading large amounts of data, loop over `task.isRunning` and read to an `NSMutableData` buffer. 35 | 36 | 37 | ### Multithreading (beachballs) 38 | 39 | If your script takes more than a couple of seconds to run it's going to block with a beachball. I would recommend adding an NSProgressIndicator (spinner) that you start when the script runs, and well as disabling the button (you'll need an outlet to the button). Then instead of `waitUntilExit()` add a `terminationHandler` with a block of code that stops the spinner and re-enables the button. As your `terminationHandler` code will be executed in a background thread, you have to update your view objects from code wrapped in `DispatchQueue.main.async`, as only the main program thread can manipulate them. 40 | 41 | 42 | ### Speak when pressing return 43 | 44 | Add an action for spokenTextField and call speakButtonClicked: 45 | 46 | ```swift 47 | @IBAction func textFieldPressedReturn(_ sender: Any) { 48 | speakButtonClicked(sender) 49 | } 50 | ``` 51 | 52 | 53 | Python Notes 54 | ------------ 55 | 56 | If you try to follow the [Xcode notes](Presentation/Xcode%20notes.markdown) it'll work in Swift and Objective-C, but in Python you can't use control clicking in the assistant editor to connect outlets and actions. Instead you have to define the `IBOutlet()` and `@IBAction` first, add a custom object with the class set to `MainWindowController` to your xib, and then right click on that to make the connections. 57 | 58 | You're also going to want to install the [Xcode 6 Cocoa-Python Templates](https://github.com/gregneagle/Xcode6CocoaPythonTemplates). 59 | 60 | 61 | Links 62 | ----- 63 | 64 | * I can't recommend [Cocoa Programming: For Mac OS X](https://www.bignerdranch.com/we-write/cocoa-programming/) ([iBooks](https://itunes.apple.com/us/book/cocoa-programming-for-os-x/id986384909?mt=11)) highly enough. 65 | * Apple's [Mac App Programming Guide](https://developer.apple.com/library/content/documentation/General/Conceptual/MOSXAppProgrammingGuide/Introduction/Introduction.html). 66 | * [Xcode docs](http://help.apple.com/xcode/mac/8.0/). 67 | --------------------------------------------------------------------------------