Skip to content

Commit

Permalink
Bumping version to 0.3.0 for Swift 3 support
Browse files Browse the repository at this point in the history
  • Loading branch information
hamin committed Jan 8, 2017
1 parent 117bb6f commit 24fd97d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions .swift-version
@@ -0,0 +1 @@
3.0
Binary file not shown.
4 changes: 2 additions & 2 deletions FayeSwift.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "FayeSwift"
s.version = "0.2.0"
s.version = "0.3.0"
s.summary = "A pure Swift Faye (Bayeux) Client"
s.description = <<-DESC
A Pure Swift Client Library for the Faye (Bayeux/Comet) Pub-Sub messaging server.
Expand All @@ -13,7 +13,7 @@ Pod::Spec.new do |s|
s.source = { :git => "https://github.com/hamin/FayeSwift.git", :tag => s.version.to_s }
s.social_media_url = "https://twitter.com/harisamin"
s.requires_arc = true
s.osx.deployment_target = "10.9"
s.osx.deployment_target = "10.10"
s.ios.deployment_target = "8.0"
s.tvos.deployment_target = "9.0"
s.source_files = "Sources/*.swift"
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Expand Up @@ -9,6 +9,8 @@ A simple Swift client library for the [Faye](http://faye.jcoglan.com/) publish-s

It was heavily inspired by the Objective-C client found here: [FayeObjc](https://github.com/pcrawfor/FayeObjC)

___**Note**: For Swift 2.2 please use FayeSwift 0.2.0___

## Example

### Installation
Expand Down
2 changes: 1 addition & 1 deletion Sources/FayeClient+Bayuex.swift
Expand Up @@ -130,7 +130,6 @@ extension FayeClient {
// "clientId": "Un1q31d3nt1f13r",
// "subscription": "/foo/**"
func subscribe(_ model:FayeSubscriptionModel) {
var model = model
writeOperationQueue.sync { [unowned self] in
do {
let json = try model.jsonString()
Expand All @@ -141,6 +140,7 @@ extension FayeClient {

} catch FayeSubscriptionModelError.clientIdNotValid
where self.fayeClientId?.characters.count > 0 {
var model = model
model.clientId = self.fayeClientId
self.subscribe(model)
} catch {
Expand Down
8 changes: 4 additions & 4 deletions Sources/FayeClient+Parsing.swift
Expand Up @@ -28,7 +28,7 @@ extension FayeClient {
self.fayeConnected = true;
self.connect()
self.subscribeQueuedSubscriptions()
pendingSubscriptionSchedule.isValid
_ = pendingSubscriptionSchedule.isValid
} else {
// OOPS
}
Expand All @@ -50,7 +50,7 @@ extension FayeClient {
case .Subscribe:
if let success = messageJSON[0][Bayeux.Successful.rawValue].int, success == 1 {
if let subscription = messageJSON[0][Bayeux.Subscription.rawValue].string {
removeChannelFromPendingSubscriptions(subscription)
_ = removeChannelFromPendingSubscriptions(subscription)

self.openSubscriptions.append(FayeSubscriptionModel(subscription: subscription, clientId: fayeClientId))
self.delegate?.didSubscribeToChannel(self, channel: subscription)
Expand All @@ -61,7 +61,7 @@ extension FayeClient {
// Subscribe Failed
if let error = messageJSON[0][Bayeux.Error.rawValue].string,
let subscription = messageJSON[0][Bayeux.Subscription.rawValue].string {
removeChannelFromPendingSubscriptions(subscription)
_ = removeChannelFromPendingSubscriptions(subscription)

self.delegate?.subscriptionFailedWithError(
self,
Expand All @@ -71,7 +71,7 @@ extension FayeClient {
}
case .Unsubscibe:
if let subscription = messageJSON[0][Bayeux.Subscription.rawValue].string {
removeChannelFromOpenSubscriptions(subscription)
_ = removeChannelFromOpenSubscriptions(subscription)
self.delegate?.didUnsubscribeFromChannel(self, channel: subscription)
} else {
print("Faye: Missing subscription for Unsubscribe")
Expand Down
8 changes: 4 additions & 4 deletions Sources/FayeClient+Subscriptions.swift
Expand Up @@ -15,8 +15,8 @@ extension FayeClient {
func subscribeQueuedSubscriptions() {
// if there are any outstanding open subscriptions resubscribe
for channel in self.queuedSubscriptions {
removeChannelFromQueuedSubscriptions(channel.subscription)
subscribeToChannel(channel)
_ = removeChannelFromQueuedSubscriptions(channel.subscription)
_ = subscribeToChannel(channel)
}
}

Expand All @@ -25,8 +25,8 @@ extension FayeClient {
print("Faye: Resubscribing to \(pendingSubscriptions.count) pending subscriptions")

for channel in pendingSubscriptions {
removeChannelFromPendingSubscriptions(channel.subscription)
subscribeToChannel(channel)
_ = removeChannelFromPendingSubscriptions(channel.subscription)
_ = subscribeToChannel(channel)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/FayeClient.swift
Expand Up @@ -155,12 +155,12 @@ open class FayeClient : TransportDelegate {
}

open func unsubscribeFromChannel(_ channel:String) {
removeChannelFromQueuedSubscriptions(channel)
_ = removeChannelFromQueuedSubscriptions(channel)

self.unsubscribe(channel)
self.channelSubscriptionBlocks[channel] = nil;

removeChannelFromOpenSubscriptions(channel)
removeChannelFromPendingSubscriptions(channel)
_ = removeChannelFromOpenSubscriptions(channel)
_ = removeChannelFromPendingSubscriptions(channel)
}
}

0 comments on commit 24fd97d

Please sign in to comment.