Compare commits

...
14 Commits
Author SHA1 Message Date
Erik 1648a51b6f bump version 2015-10-15 14:06:28 -04:00
Erik ad7043c918 try and fix carthage builds 2015-10-15 14:01:52 -04:00
Erik 48672d8df3 bump version: 2015-10-15 13:50:05 -04:00
Erik c101a04845 change code signing 2015-10-13 12:51:46 -04:00
Erik f57786ad5b remove debug print 2015-10-13 12:28:52 -04:00
Erik 7ff1d327de Fix socketio/socket.io-client-swift#203 2015-10-13 12:28:02 -04:00
Erik Little 18a227e591 Merge pull request #201 from tbaranes/master
Add CocoaSeeds installation
2015-10-07 10:48:50 -04:00
Tom Baranes 6d49c37fb8 Fix syntax highlighting 2015-10-07 15:27:40 +02:00
Tom Baranes a0c213364d Add CocoaSeeds installation 2015-10-07 08:49:49 +02:00
Erik Little 3c79bd0a75 Merge pull request #198 from NachoSoto/bitcode
Enabled Bitcode
2015-10-05 09:48:41 -04:00
NachoSoto a11533b61f Enabled Bitcode 2015-10-05 05:03:55 +00:00
Erik 8acd32324e tweak to connect timeout 2015-10-01 15:25:41 -04:00
Erik de20099c07 style 2015-10-01 12:59:27 -04:00
Erik 877db516c2 fix socketio/socket.io-client-swift#197 2015-10-01 09:53:20 -04:00
6 changed files with 43 additions and 23 deletions

No files matched your search

+23 -10
View File
@@ -60,20 +60,20 @@ If you need Swift 1.2/Xcode 6.3/4 use v2.4.5 (Pre-Swift 2 support is no longer m
If you need Swift 1.1/Xcode 6.2 use v1.5.2. (Pre-Swift 1.2 support is no longer maintained)
Carthage
-----------------
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 3.1.4 # Or latest version
```
Run `carthage update --platform ios,macosx`.
Manually (iOS 7+)
-----------------
1. Copy the SocketIOClientSwift folder into your Xcode project. (Make sure you add the files to your target(s))
2. If you plan on using this from Objective-C, read [this](https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html) on exposing Swift code to Objective-C.
Carthage
-----------------
Add this line to your `Cartfile`:
```
github "socketio/socket.io-client-swift" ~> 3.1.6 # Or latest version
```
Run `carthage update --platform ios,macosx`.
CocoaPods 0.36.0 or later (iOS 8+)
------------------
Create `Podfile` and add `pod 'Socket.IO-Client-Swift'`:
@@ -83,7 +83,7 @@ source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Socket.IO-Client-Swift', '~> 3.1.4' # Or latest version
pod 'Socket.IO-Client-Swift', '~> 3.1.6' # Or latest version
```
Install pods:
@@ -100,10 +100,23 @@ import Socket_IO_Client_Swift
```
Objective-C:
```Objective-C
#import <Socket_IO_Client_Swift/Socket_IO_Client_Swift-Swift.h>
```
CocoaSeeds
-----------------
Add this line to your `Seedfile`:
```
github "socketio/socket.io-client-swift", "v3.1.6", :files => "SocketIOClientSwift/*.swift" # Or latest version
```
Run `seed install`.
##API
Constructors
-----------
+2 -2
View File
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Socket.IO-Client-Swift"
s.version = "3.1.4"
s.version = "3.1.6"
s.summary = "Socket.IO-client for iOS and OS X"
s.description = <<-DESC
Socket.IO-client for iOS and OS X.
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
s.author = { "Erik" => "nuclear.ace@gmail.com" }
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.1.4' }
s.source = { :git => "https://github.com/socketio/socket.io-client-swift.git", :tag => 'v3.1.6' }
s.source_files = "SocketIOClientSwift/**/*.swift"
s.requires_arc = true
# s.dependency 'Starscream', '~> 0.9' # currently this repo includes Starscream swift files
@@ -561,7 +561,9 @@
572EF2121B51F12F00EEBB58 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CODE_SIGN_IDENTITY = "Developer ID Application";
ENABLE_BITCODE = YES;
GCC_OPTIMIZATION_LEVEL = 0;
PRODUCT_NAME = SocketIO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -571,7 +573,9 @@
572EF2131B51F12F00EEBB58 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BITCODE_GENERATION_MODE = bitcode;
CODE_SIGN_IDENTITY = "Developer ID Application";
ENABLE_BITCODE = YES;
PRODUCT_NAME = SocketIO;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
};
@@ -594,6 +598,7 @@
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
@@ -648,7 +653,8 @@
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";
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+6 -5
View File
@@ -261,7 +261,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate {
Logger.log("Doing polling request", type: logType)
req.cachePolicy = NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData
req.cachePolicy = .ReloadIgnoringLocalAndRemoteCacheData
session.dataTaskWithRequest(req, completionHandler: callback).resume()
}
@@ -530,14 +530,15 @@ public final class SocketEngine: NSObject, WebSocketDelegate {
private func parseEngineMessage(var message: String, fromPolling: Bool) {
Logger.log("Got message: %@", type: logType, args: message)
if fromPolling {
fixDoubleUTF8(&message)
}
let type = PacketType(str: (message["^(\\d)"].groups()?[1]) ?? "") ?? {
self.checkIfMessageIsBase64Binary(message)
return .Noop
}()
if fromPolling && type != .Noop {
fixDoubleUTF8(&message)
}
switch type {
case PacketType.Message:
+4 -4
View File
@@ -171,10 +171,10 @@ public final class SocketIOClient: NSObject, SocketEngineClient {
let time = dispatch_time(DISPATCH_TIME_NOW, Int64(timeoutAfter) * Int64(NSEC_PER_SEC))
dispatch_after(time, dispatch_get_main_queue()) {
if self.status != .Connected {
self.status = .Closed
self.engine?.close(fast: true)
dispatch_after(time, handleQueue) {[weak self] in
if let this = self where this.status != .Connected {
this.status = .Closed
this.engine?.close(fast: true)
handler?()
}
+1 -1
View File
@@ -116,7 +116,7 @@ struct SocketPacket {
message += jsonString! as String + ","
} catch {
Logger.error("Error creating JSON object in SocketPacket.completeMessage", type: SocketPacket.logType)
Logger.error("Error creating JSON object in SocketPacket.completeMessage", type: SocketPacket.logType)
}
} else if var str = arg as? String {
str = str["\n"] ~= "\\\\n"