Browse Source

Adding Alamofire.playground

Mattt Thompson 11 years ago
parent
commit
559ef09b02

+ 0 - 1
.gitignore

@@ -16,4 +16,3 @@ DerivedData
 *.hmap
 *.ipa
 *.xcuserstate
-*.playground

+ 7 - 0
Alamofire.playground/contents.xcplayground

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<playground version='3.0' sdk='iphonesimulator'>
+    <sections>
+        <code source-file-name='section-1.swift'/>
+    </sections>
+    <timeline fileName='timeline.xctimeline'/>
+</playground>

+ 27 - 0
Alamofire.playground/section-1.swift

@@ -0,0 +1,27 @@
+import XCPlayground
+import Foundation
+import Alamofire
+
+// Allow network requests to complete
+XCPSetExecutionShouldContinueIndefinitely()
+
+Alamofire.request(.GET, "http://httpbin.org/get", parameters: ["foo": "bar"])
+         .responseString { (request, response, string, error) in
+            println(request)
+            println(response)
+            println(string)
+         }
+
+/*
+[BUG] In Xcode 6.0.1, execution fails with the following error:
+
+IDEPlaygroundExecution: Playground execution failed: error: Couldn't lookup symbols:
+__TWPSS9Alamofire20URLStringConvertible
+__TF9Alamofire7requestFTOS_6MethodPS_20URLStringConvertible_10parametersGSqGVSs10DictionarySSPSs9AnyObject___8encodingOS_17ParameterEncoding_CS_7Request
+__TFO9Alamofire6Method3GETFMS0_S0_
+__TIF9Alamofire7requestFTOS_6MethodPS_20URLStringConvertible_10parametersGSqGVSs10DictionarySSPSs9AnyObject___8encodingOS_17ParameterEncoding_CS_7RequestA2_
+__TMaC9Alamofire7Request
+__TFC9Alamofire7Request14responseStringfDS0_FFTCSo12NSURLRequestGSqCSo17NSHTTPURLResponse_GSqSS_GSqCSo7NSError__T_DS0_
+
+If you have a proposed fix, please send a Pull Request: https://github.com/Alamofire/Alamofire/pulls
+*/

+ 6 - 0
Alamofire.playground/timeline.xctimeline

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Timeline
+   version = "3.0">
+   <TimelineItems>
+   </TimelineItems>
+</Timeline>

+ 2 - 2
Alamofire.xcodeproj/project.pbxproj

@@ -355,7 +355,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
-				SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
+				SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
 			};
 			name = Debug;
@@ -373,7 +373,7 @@
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
-				SUPPORTED_PLATFORMS = "iphonesimulator iphoneos macosx";
+				SUPPORTED_PLATFORMS = "iphonesimulator iphoneos";
 			};
 			name = Release;
 		};

+ 3 - 0
Alamofire.xcworkspace/contents.xcworkspacedata

@@ -1,6 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Workspace
    version = "1.0">
+   <FileRef
+      location = "group:Alamofire.playground">
+   </FileRef>
    <FileRef
       location = "group:Alamofire.xcodeproj">
    </FileRef>