This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Install all iOS simulators after Xcode update | |
2. Open Xcode preferences (Cmd+,) and navigate to "Locations" tab where will be shown path to "DerivedData" folder | |
3. Click on small circle with arrow on the right side of shown "DerivedData" path to open it in Finder | |
4. Quit Xcode | |
5. Remove "DerivedData" folder | |
6. Clean up CocoaPods (if integrated with it) caches by entering this in Terminal: | |
rm -rf ~/Library/Caches/CocoaPods | |
7. From project root (where Podfile is located) run this in Terminal: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.client?.subscribeToChannels(["chat"], withPresence: false, | |
clientState: ["chat": ["Key": "Value"]]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.client?.setState(["Key": "Value"], forUUID: self.client?.uuid(), onChannel: "chat", | |
withCompletion: { (status) -> Void in | |
if !status.error { | |
// Client state successfully modified on specified channel. | |
} | |
else { | |
// Handle client state modification error. Check 'category' property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance properties | |
var client: PubNub? | |
override init() { | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
configuration.uuid = "Stephen" | |
client = PubNub.clientWithConfiguration(configuration) | |
super.init() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance property | |
var client: PubNub? | |
// For demo purposes init function used to ensure what client will be instantiated before | |
// it will be used. | |
override init() { | |
// Instantiate configuration instance. | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
// Instantiate PubNub client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance property | |
var client: PubNub? | |
// For demo purposes init function used to ensure what client will be instantiated before | |
// it will be used. | |
override init() { | |
// Instantiate configuration instance. | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
// Instantiate PubNub client. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance properties | |
var client: PubNub? | |
// Configure PubNub client instance | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
configuration.TLSEnabled = true | |
self.client = PubNub.clientWithConfiguration(configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance properties | |
var client: PubNub? | |
// Configure PubNub client instance | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
self.client = PubNub.clientWithConfiguration(configuration) | |
self.client?.addListener(self) | |
self.client?.subscribeToChannels(["my_secret_channel"], withPresence: false) | |
// Handle new message from one of channels on which client has been subscribed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instance properties | |
var client: PubNub? | |
// Configure PubNub client instance | |
let configuration = PNConfiguration(publishKey: "demo-36", subscribeKey: "demo-36") | |
configuration.cipherKey = "my_cipherkey" | |
self.client = PubNub.clientWithConfiguration(configuration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let channelGroup = "family" | |
self.client?.removeChannelsFromGroup(channelGroup, withCompletion: { (status) -> Void in | |
if !status.error { | |
// Handle successful channel group removal. | |
} | |
else { | |
// Handle channel group removal error. Check 'category' property |
NewerOlder