Skip to content

Instantly share code, notes, and snippets.

View MarioBajr's full-sized avatar

Mário Araújo MarioBajr

  • EF - Education First
  • London
View GitHub Profile
@MarioBajr
MarioBajr / AppSyncMQTTClient.diff
Last active July 10, 2018 14:47
Thread Safe AppSyncMQTTClient
diff --git a/AWSAppSyncClient/AppSyncMQTTClient.swift b/AWSAppSyncClient/AppSyncMQTTClient.swift
index 7edf6a7..7c04eba 100644
--- a/AWSAppSyncClient/AppSyncMQTTClient.swift
+++ b/AWSAppSyncClient/AppSyncMQTTClient.swift
@@ -9,14 +9,14 @@ class AppSyncMQTTClient: MQTTClientDelegate {
var mqttClients = Set<MQTTClient<AnyObject, AnyObject>>()
var mqttClientsWithTopics = [MQTTClient<AnyObject, AnyObject>: Set<String>]()
- var topicSubscribersDictionary = [String: [MQTTSubscritionWatcher]]()
+ var topicSubscribers = TopicSubscribers()
@MarioBajr
MarioBajr / observableSubscriptions.diff
Created July 6, 2018 10:12
AWS Mobile AppSync SDK iOS - Observable Subscriptions State Diff
From ccd1a51084111d22a87cbe032e4b3b748836fb70 Mon Sep 17 00:00:00 2001
From: Mario Araujo <mario.araujo@ef.com>
Date: Fri, 6 Jul 2018 10:55:06 +0100
Subject: [PATCH] - Exposed subscriptions connection states via
SubscriptionStatusObserver, passing as an optional argument in subscribe
method - Moved AWSAppSyncSubscriptionError from struct to enum with more
detailed errors - Removed unnecessary SubscriptionOrderHelper class
---
AWSAppSyncClient/AWSAppSyncClient.swift | 67 ++++++++--

Keybase proof

I hereby claim:

  • I am mariobajr on github.
  • I am mariobajr (https://keybase.io/mariobajr) on keybase.
  • I have a public key ASDPoj0zZ6kTt_cK3ncOuHBBrz-Y8nPoOPvfcLLXIerMCQo

To claim this, I am signing this object:

<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
//: Playground - noun: a place where people can play
import UIKit
// Helper
extension String {
func matchingStrings(regex: String) -> [[String]] {
guard let regex = try? NSRegularExpression(pattern: regex, options: []) else { return [] }
let nsString = self as NSString