Jelajahi Sumber

Initial commit.

Damian Kołakowski 12 tahun lalu
melakukan
76147c0ecb

+ 426 - 0
Swifter.xcodeproj/project.pbxproj

@@ -0,0 +1,426 @@
+// !$*UTF8*$!
+{
+	archiveVersion = 1;
+	classes = {
+	};
+	objectVersion = 46;
+	objects = {
+
+/* Begin PBXBuildFile section */
+		7C839B7419422CFF003A6950 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B7319422CFF003A6950 /* AppDelegate.swift */; };
+		7C839B7619422CFF003A6950 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B7519422CFF003A6950 /* ViewController.swift */; };
+		7C839B7919422CFF003A6950 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7C839B7719422CFF003A6950 /* Main.storyboard */; };
+		7C839B7B19422CFF003A6950 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7C839B7A19422CFF003A6950 /* Images.xcassets */; };
+		7C839B8719422CFF003A6950 /* SwifterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B8619422CFF003A6950 /* SwifterTests.swift */; };
+		7C839B9319422D50003A6950 /* HttpParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B9019422D50003A6950 /* HttpParser.swift */; };
+		7C839B9419422D50003A6950 /* HttpServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B9119422D50003A6950 /* HttpServer.swift */; };
+		7C839B9519422D50003A6950 /* Socket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C839B9219422D50003A6950 /* Socket.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+		7C839B8119422CFF003A6950 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 7C839B6619422CFF003A6950 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 7C839B6D19422CFF003A6950;
+			remoteInfo = Swifter;
+		};
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+		7C839B6E19422CFF003A6950 /* Swifter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Swifter.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		7C839B7219422CFF003A6950 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		7C839B7319422CFF003A6950 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
+		7C839B7519422CFF003A6950 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
+		7C839B7819422CFF003A6950 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
+		7C839B7A19422CFF003A6950 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
+		7C839B8019422CFF003A6950 /* SwifterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwifterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		7C839B8519422CFF003A6950 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		7C839B8619422CFF003A6950 /* SwifterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwifterTests.swift; sourceTree = "<group>"; };
+		7C839B9019422D50003A6950 /* HttpParser.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpParser.swift; sourceTree = "<group>"; };
+		7C839B9119422D50003A6950 /* HttpServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HttpServer.swift; sourceTree = "<group>"; };
+		7C839B9219422D50003A6950 /* Socket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Socket.swift; sourceTree = "<group>"; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+		7C839B6B19422CFF003A6950 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		7C839B7D19422CFF003A6950 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+		7C839B6519422CFF003A6950 = {
+			isa = PBXGroup;
+			children = (
+				7C839B7019422CFF003A6950 /* Swifter */,
+				7C839B8319422CFF003A6950 /* SwifterTests */,
+				7C839B6F19422CFF003A6950 /* Products */,
+			);
+			sourceTree = "<group>";
+		};
+		7C839B6F19422CFF003A6950 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				7C839B6E19422CFF003A6950 /* Swifter.app */,
+				7C839B8019422CFF003A6950 /* SwifterTests.xctest */,
+			);
+			name = Products;
+			sourceTree = "<group>";
+		};
+		7C839B7019422CFF003A6950 /* Swifter */ = {
+			isa = PBXGroup;
+			children = (
+				7C839B9019422D50003A6950 /* HttpParser.swift */,
+				7C839B9119422D50003A6950 /* HttpServer.swift */,
+				7C839B9219422D50003A6950 /* Socket.swift */,
+				7C839B7319422CFF003A6950 /* AppDelegate.swift */,
+				7C839B7519422CFF003A6950 /* ViewController.swift */,
+				7C839B7719422CFF003A6950 /* Main.storyboard */,
+				7C839B7A19422CFF003A6950 /* Images.xcassets */,
+				7C839B7119422CFF003A6950 /* Supporting Files */,
+			);
+			path = Swifter;
+			sourceTree = "<group>";
+		};
+		7C839B7119422CFF003A6950 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				7C839B7219422CFF003A6950 /* Info.plist */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+		7C839B8319422CFF003A6950 /* SwifterTests */ = {
+			isa = PBXGroup;
+			children = (
+				7C839B8619422CFF003A6950 /* SwifterTests.swift */,
+				7C839B8419422CFF003A6950 /* Supporting Files */,
+			);
+			path = SwifterTests;
+			sourceTree = "<group>";
+		};
+		7C839B8419422CFF003A6950 /* Supporting Files */ = {
+			isa = PBXGroup;
+			children = (
+				7C839B8519422CFF003A6950 /* Info.plist */,
+			);
+			name = "Supporting Files";
+			sourceTree = "<group>";
+		};
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+		7C839B6D19422CFF003A6950 /* Swifter */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 7C839B8A19422D00003A6950 /* Build configuration list for PBXNativeTarget "Swifter" */;
+			buildPhases = (
+				7C839B6A19422CFF003A6950 /* Sources */,
+				7C839B6B19422CFF003A6950 /* Frameworks */,
+				7C839B6C19422CFF003A6950 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+			);
+			name = Swifter;
+			productName = Swifter;
+			productReference = 7C839B6E19422CFF003A6950 /* Swifter.app */;
+			productType = "com.apple.product-type.application";
+		};
+		7C839B7F19422CFF003A6950 /* SwifterTests */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = 7C839B8D19422D00003A6950 /* Build configuration list for PBXNativeTarget "SwifterTests" */;
+			buildPhases = (
+				7C839B7C19422CFF003A6950 /* Sources */,
+				7C839B7D19422CFF003A6950 /* Frameworks */,
+				7C839B7E19422CFF003A6950 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				7C839B8219422CFF003A6950 /* PBXTargetDependency */,
+			);
+			name = SwifterTests;
+			productName = SwifterTests;
+			productReference = 7C839B8019422CFF003A6950 /* SwifterTests.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+		7C839B6619422CFF003A6950 /* Project object */ = {
+			isa = PBXProject;
+			attributes = {
+				LastUpgradeCheck = 0600;
+				ORGANIZATIONNAME = "Damian Kołakowski";
+				TargetAttributes = {
+					7C839B6D19422CFF003A6950 = {
+						CreatedOnToolsVersion = 6.0;
+					};
+					7C839B7F19422CFF003A6950 = {
+						CreatedOnToolsVersion = 6.0;
+						TestTargetID = 7C839B6D19422CFF003A6950;
+					};
+				};
+			};
+			buildConfigurationList = 7C839B6919422CFF003A6950 /* Build configuration list for PBXProject "Swifter" */;
+			compatibilityVersion = "Xcode 3.2";
+			developmentRegion = English;
+			hasScannedForEncodings = 0;
+			knownRegions = (
+				en,
+				Base,
+			);
+			mainGroup = 7C839B6519422CFF003A6950;
+			productRefGroup = 7C839B6F19422CFF003A6950 /* Products */;
+			projectDirPath = "";
+			projectRoot = "";
+			targets = (
+				7C839B6D19422CFF003A6950 /* Swifter */,
+				7C839B7F19422CFF003A6950 /* SwifterTests */,
+			);
+		};
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+		7C839B6C19422CFF003A6950 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				7C839B7919422CFF003A6950 /* Main.storyboard in Resources */,
+				7C839B7B19422CFF003A6950 /* Images.xcassets in Resources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		7C839B7E19422CFF003A6950 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+		7C839B6A19422CFF003A6950 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				7C839B7619422CFF003A6950 /* ViewController.swift in Sources */,
+				7C839B9319422D50003A6950 /* HttpParser.swift in Sources */,
+				7C839B9519422D50003A6950 /* Socket.swift in Sources */,
+				7C839B9419422D50003A6950 /* HttpServer.swift in Sources */,
+				7C839B7419422CFF003A6950 /* AppDelegate.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		7C839B7C19422CFF003A6950 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				7C839B8719422CFF003A6950 /* SwifterTests.swift in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+		7C839B8219422CFF003A6950 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 7C839B6D19422CFF003A6950 /* Swifter */;
+			targetProxy = 7C839B8119422CFF003A6950 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+		7C839B7719422CFF003A6950 /* Main.storyboard */ = {
+			isa = PBXVariantGroup;
+			children = (
+				7C839B7819422CFF003A6950 /* Base */,
+			);
+			name = Main.storyboard;
+			sourceTree = "<group>";
+		};
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+		7C839B8819422D00003A6950 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				METAL_ENABLE_DEBUG_INFO = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = iphoneos;
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				TARGETED_DEVICE_FAMILY = "1,2";
+			};
+			name = Debug;
+		};
+		7C839B8919422D00003A6950 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
+				COPY_PHASE_STRIP = YES;
+				ENABLE_NS_ASSERTIONS = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_C_LANGUAGE_STANDARD = gnu99;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				GCC_WARN_UNUSED_FUNCTION = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
+				METAL_ENABLE_DEBUG_INFO = NO;
+				SDKROOT = iphoneos;
+				TARGETED_DEVICE_FAMILY = "1,2";
+				VALIDATE_PRODUCT = YES;
+			};
+			name = Release;
+		};
+		7C839B8B19422D00003A6950 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				INFOPLIST_FILE = Swifter/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Debug;
+		};
+		7C839B8C19422D00003A6950 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
+				INFOPLIST_FILE = Swifter/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+			};
+			name = Release;
+		};
+		7C839B8E19422D00003A6950 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Swifter.app/Swifter";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(SDKROOT)/Developer/Library/Frameworks",
+					"$(inherited)",
+				);
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				INFOPLIST_FILE = SwifterTests/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				METAL_ENABLE_DEBUG_INFO = YES;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				TEST_HOST = "$(BUNDLE_LOADER)";
+			};
+			name = Debug;
+		};
+		7C839B8F19422D00003A6950 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/Swifter.app/Swifter";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(SDKROOT)/Developer/Library/Frameworks",
+					"$(inherited)",
+				);
+				INFOPLIST_FILE = SwifterTests/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
+				METAL_ENABLE_DEBUG_INFO = NO;
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				TEST_HOST = "$(BUNDLE_LOADER)";
+			};
+			name = Release;
+		};
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+		7C839B6919422CFF003A6950 /* Build configuration list for PBXProject "Swifter" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				7C839B8819422D00003A6950 /* Debug */,
+				7C839B8919422D00003A6950 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+			defaultConfigurationName = Release;
+		};
+		7C839B8A19422D00003A6950 /* Build configuration list for PBXNativeTarget "Swifter" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				7C839B8B19422D00003A6950 /* Debug */,
+				7C839B8C19422D00003A6950 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+		7C839B8D19422D00003A6950 /* Build configuration list for PBXNativeTarget "SwifterTests" */ = {
+			isa = XCConfigurationList;
+			buildConfigurations = (
+				7C839B8E19422D00003A6950 /* Debug */,
+				7C839B8F19422D00003A6950 /* Release */,
+			);
+			defaultConfigurationIsVisible = 0;
+		};
+/* End XCConfigurationList section */
+	};
+	rootObject = 7C839B6619422CFF003A6950 /* Project object */;
+}

+ 7 - 0
Swifter.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:Swifter.xcodeproj">
+   </FileRef>
+</Workspace>

TEMPAT SAMPAH
Swifter.xcodeproj/project.xcworkspace/xcuserdata/damiankolakowski.xcuserdatad/UserInterfaceState.xcuserstate


+ 96 - 0
Swifter.xcodeproj/xcuserdata/damiankolakowski.xcuserdatad/xcschemes/Swifter.xcscheme

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0600"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "7C839B6D19422CFF003A6950"
+               BuildableName = "Swifter.app"
+               BlueprintName = "Swifter"
+               ReferencedContainer = "container:Swifter.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <Testables>
+         <TestableReference
+            skipped = "NO">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "7C839B7F19422CFF003A6950"
+               BuildableName = "SwifterTests.xctest"
+               BlueprintName = "SwifterTests"
+               ReferencedContainer = "container:Swifter.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "7C839B6D19422CFF003A6950"
+            BuildableName = "Swifter.app"
+            BlueprintName = "Swifter"
+            ReferencedContainer = "container:Swifter.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Debug"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "7C839B6D19422CFF003A6950"
+            BuildableName = "Swifter.app"
+            BlueprintName = "Swifter"
+            ReferencedContainer = "container:Swifter.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      buildConfiguration = "Release"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "7C839B6D19422CFF003A6950"
+            BuildableName = "Swifter.app"
+            BlueprintName = "Swifter"
+            ReferencedContainer = "container:Swifter.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 27 - 0
Swifter.xcodeproj/xcuserdata/damiankolakowski.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>SchemeUserState</key>
+	<dict>
+		<key>Swifter.xcscheme</key>
+		<dict>
+			<key>orderHint</key>
+			<integer>0</integer>
+		</dict>
+	</dict>
+	<key>SuppressBuildableAutocreation</key>
+	<dict>
+		<key>7C839B6D19422CFF003A6950</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+		<key>7C839B7F19422CFF003A6950</key>
+		<dict>
+			<key>primary</key>
+			<true/>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 39 - 0
Swifter/AppDelegate.swift

@@ -0,0 +1,39 @@
+//
+//  AppDelegate.swift
+//  TestSwift
+//
+//  Created by Damian Kolakowski on 05/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import Foundation
+import UIKit
+
+@UIApplicationMain
+class AppDelegate: UIResponder, UIApplicationDelegate {
+    
+    var window: UIWindow?
+    let server: HttpServer = HttpServer()
+    
+    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool {
+        
+        server["/"] = { () -> (CInt, String) in
+            return (200, "<html><body>Hello Swift</body></html>")
+        }
+        
+        server["/hello"] = { () -> (CInt, String) in
+            return (200, "<html><body>Hello !</body></html>")
+        }
+        
+        server["/demo"] = { () -> (CInt, String) in
+            return (200, "<html><body><center><h2>Hello Swift</h2>" +
+                "<img src=\"https://devimages.apple.com.edgekey.net/swift/images/swift-hero_2x.png\"/><br>" +
+                            "<h4>\(UIDevice().name), \(UIDevice().systemVersion)</h4></center></body></html>")
+        }
+        
+        let (result, error) = server.start(8080)
+        
+        return true
+    }
+}
+

+ 25 - 0
Swifter/Base.lproj/Main.storyboard

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6162" systemVersion="14A238h" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6160"/>
+    </dependencies>
+    <scenes>
+        <!--View Controller-->
+        <scene sceneID="tne-QT-ifu">
+            <objects>
+                <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
+                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
+                        <rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
+                    </view>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
+            </objects>
+        </scene>
+    </scenes>
+</document>

+ 58 - 0
Swifter/HttpParser.swift

@@ -0,0 +1,58 @@
+//
+//  HttpParser.swift
+//
+//  Created by Damian Kolakowski on 05/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import Foundation
+
+/* HTTP stream parser */
+
+class HttpParser {
+    
+    func parseHttpHeader(socket: CInt) -> (String, Dictionary<String, String>)? {
+        if let statusLine = parseLine(socket) {
+            let statusTokens = split(statusLine, { $0 == " " })
+            if ( statusTokens.count >= 3 ) {
+                let path = statusTokens[1]
+                if let headers = parseHeaders(socket) {
+                    return (path, headers)
+                }
+            }
+        }
+        return nil
+    }
+    
+    func parseHeaders(socket: CInt) -> Dictionary<String, String>? {
+        var headers = Dictionary<String, String>()
+        while let headerLine = parseLine(socket) {
+            if ( headerLine.isEmpty ) {
+                return headers
+            }
+            let headerTokens = split(headerLine, { $0 == ":" })
+            if ( headerTokens.count >= 2 ) {
+                headers.updateValue(headerTokens[1], forKey: headerTokens[0])
+            }
+        }
+        return nil
+    }
+    
+    func parseLine(socket: CInt) -> String? {
+        // TODO - read more bytes than one
+        // TODO - check if there is a nicer way to manipulate bytes with Swift ( recv(...) -> String )
+        var characters: String = ""
+        var buff: UInt8[] = UInt8[](count: 1, repeatedValue: 0), n: Int = 1
+        do {
+            n = recv(socket, &buff, 1, 0);
+            if ( n > 0 && buff[0] > 13 /* CR */ ) {
+                characters += Character(UnicodeScalar(UInt32(buff[0])))
+            }
+        } while ( n > 0 && buff[0] != 10 /* NL */ )
+        if ( n == -1 ) {
+            return nil
+        }
+        println("SOCKET LOG [\(socket)] -> \(characters)")
+        return characters
+    }
+}

+ 69 - 0
Swifter/HttpServer.swift

@@ -0,0 +1,69 @@
+//
+//  HttpServer.swift
+//
+//  Created by Damian Kolakowski on 05/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import Foundation
+
+/* HTTP stream parser */
+
+class HttpServer
+{
+    var handlers: Dictionary<String, (Void -> (CInt, String))> = Dictionary()
+    var acceptSocket: CInt = -1
+    
+    subscript (path: String) -> ((Void -> (CInt, String))) {
+        get {
+            return handlers[path]!
+        }
+        set ( newValue ) {
+            self.handlers.updateValue(newValue, forKey: path)
+        }
+    }
+    
+    func start(listenPort: in_port_t) -> (Bool, String?) {
+        releaseAcceptSocket()
+        let (socket, error) = Socket.tcpForListen(listenPort)
+        if ( socket == -1 ) {
+            return (false, error)
+        }
+        acceptSocket = socket
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), { () -> Void in
+            while ( self.acceptSocket != -1 ) {
+                var addr = sockaddr(sa_len: 0, sa_family: 0, sa_data: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)), len: socklen_t = 0
+                let socket = accept(self.acceptSocket, &addr, &len)
+                if ( socket == -1 ) {
+                    self.releaseAcceptSocket();
+                    return
+                }
+                Socket.nosigpipe(socket)
+                dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), { () -> Void in
+                    let parser = HttpParser()
+                    if let (path, headers) = parser.parseHttpHeader(socket) {
+                        if let handler = self.handlers[path] {
+                            let (status, response) = handler()
+                            // no support for keep-alive for now so let's stay with HTTP 1.0
+                            Socket.writeString(socket, response: "HTTP/1.0 \(status) OK\r\n\r\n\(response)")
+                        }
+                    }
+                    Socket.release(socket)
+                });
+            }
+        });
+        return (true, nil)
+    }
+    
+    func stop() {
+        releaseAcceptSocket()
+    }
+    
+    func releaseAcceptSocket() {
+        if ( acceptSocket != -1 ) {
+            Socket.release(acceptSocket)
+            acceptSocket = -1
+        }
+    }
+}
+

+ 53 - 0
Swifter/Images.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,53 @@
+{
+  "images" : [
+    {
+      "idiom" : "iphone",
+      "size" : "29x29",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "40x40",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "iphone",
+      "size" : "60x60",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "29x29",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "40x40",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "ipad",
+      "size" : "76x76",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 51 - 0
Swifter/Images.xcassets/LaunchImage.launchimage/Contents.json

@@ -0,0 +1,51 @@
+{
+  "images" : [
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "iphone",
+      "subtype" : "retina4",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "ipad",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "1x"
+    },
+    {
+      "orientation" : "landscape",
+      "idiom" : "ipad",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "1x"
+    },
+    {
+      "orientation" : "portrait",
+      "idiom" : "ipad",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "2x"
+    },
+    {
+      "orientation" : "landscape",
+      "idiom" : "ipad",
+      "extent" : "full-screen",
+      "minimum-system-version" : "7.0",
+      "scale" : "2x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

+ 32 - 0
Swifter/Info.plist

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>pl.kolakowski..${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+	<key>LSRequiresIPhoneOS</key>
+	<true/>
+	<key>UIMainStoryboardFile</key>
+	<string>Main</string>
+	<key>UIRequiredDeviceCapabilities</key>
+	<array>
+		<string>armv7</string>
+	</array>
+</dict>
+</plist>

+ 71 - 0
Swifter/Socket.swift

@@ -0,0 +1,71 @@
+//
+//  Socket.swift
+//
+//  Created by Damian Kolakowski on 05/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import Foundation
+
+/* Low level routines for POSIX sockets */
+
+struct Socket {
+    
+    static func tcpForListen(port: in_port_t) -> (CInt, String?) {
+        let s = socket(AF_INET, SOCK_STREAM, 0)
+        if ( s == -1 ) {
+            return (-1, "socket() failed \(errno) - \(strerror(errno))")
+        }
+        var value: Int32 = 1;
+        if ( setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &value, 4) == -1 ) {
+            let error = "setsockopt(...) failed \(errno) - \(strerror(errno))"
+            release(s)
+            return (-1, error)
+        }
+        nosigpipe(s)
+        var addr: sockaddr_in = sockaddr_in(sin_len: sizeof(sockaddr_in).bridgeToObjectiveC().unsignedCharValue,
+            sin_family: sa_family_t(AF_INET),
+            sin_port: port,
+            sin_addr: in_addr(s_addr: inet_addr("0.0.0.0")),
+            sin_zero: (0, 0, 0, 0, 0, 0, 0, 0))
+        
+        var sock_addr: sockaddr = sockaddr(sa_len: 0, sa_family: 0, sa_data: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
+        memcpy(&sock_addr, &addr, UInt(sizeof(sockaddr_in)))
+        if ( bind(s, &sock_addr, sizeof(sockaddr_in).bridgeToObjectiveC().unsignedIntValue) == -1 ) {
+            let error = "bind(...) failed \(errno) - \(strerror(errno))"
+            release(s)
+            return (-1, error)
+        }
+        if ( listen(s, 20 /* max pending connection */ ) == -1 ) {
+            let error = "listen(...) failed \(errno) - \(strerror(errno))"
+            release(s)
+            return (-1, error)
+        }
+        return (s, nil)
+    }
+    
+    static func writeString(socket: CInt, response: String) {
+        var sent = 0;
+        let nsdata = response.bridgeToObjectiveC().dataUsingEncoding(NSUTF8StringEncoding)
+        let pointer = nsdata.bytes
+        while ( sent < nsdata.length ) {
+            // TODO pointer + sent
+            let s = write(socket, pointer, UInt(nsdata.length - sent))
+            if ( s <= 0 ) {
+                return
+            }
+            sent += s
+        }
+    }
+    
+    static func nosigpipe(socket: CInt) {
+        // prevents crashes when blocking calls are pending and the app is paused ( via Home button )
+        var no_sig_pipe: Int32 = 1;
+        setsockopt(socket, SOL_SOCKET, SO_NOSIGPIPE, &no_sig_pipe, 4);
+    }
+    
+    static func release(socket: CInt) {
+        shutdown(socket, 2)
+        close(socket)
+    }
+}

+ 25 - 0
Swifter/ViewController.swift

@@ -0,0 +1,25 @@
+//
+//  ViewController.swift
+//  Swifter
+//
+//  Created by Damian Kolakowski on 06/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import UIKit
+
+class ViewController: UIViewController {
+                            
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do any additional setup after loading the view, typically from a nib.
+    }
+
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+        // Dispose of any resources that can be recreated.
+    }
+
+
+}
+

+ 24 - 0
SwifterTests/Info.plist

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>${EXECUTABLE_NAME}</string>
+	<key>CFBundleIdentifier</key>
+	<string>pl.kolakowski..${PRODUCT_NAME:rfc1034identifier}</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>${PRODUCT_NAME}</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+</dict>
+</plist>

+ 35 - 0
SwifterTests/SwifterTests.swift

@@ -0,0 +1,35 @@
+//
+//  SwifterTests.swift
+//  SwifterTests
+//
+//  Created by Damian Kolakowski on 06/06/14.
+//  Copyright (c) 2014 Damian Kołakowski. All rights reserved.
+//
+
+import XCTest
+
+class SwifterTests: XCTestCase {
+    
+    override func setUp() {
+        super.setUp()
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+    }
+    
+    override func tearDown() {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+        super.tearDown()
+    }
+    
+    func testExample() {
+        // This is an example of a functional test case.
+        XCTAssert(true, "Pass")
+    }
+    
+    func testPerformanceExample() {
+        // This is an example of a performance test case.
+        self.measureBlock() {
+            // Put the code you want to measure the time of here.
+        }
+    }
+    
+}