Member-only story

Using iOS Notifications, Cryptography and iCloud to build your own Chat App III

Mark Lucking
5 min readFeb 20, 2020

I should start this article with a disclaimer, it based on iOS 13, Swift 5 and Xcode 11.x. If you reading this and those numbers look dated, be forewarned.

I should also warn you that notifications and iCloud code, involve Apple’s infrastructure which means you will need an Apple Developers account to use them.

Finally Obviously this is part III, you need to go back to part I and part IIfor it to make any sense, indeed you need to look at the notifications series before do that else your struggle.

So what is the status so far. We took noob from the notification project, added some cryptographic methods, added some CloudKit methods and a neat SwiftUI interface.

In this instalment we’ll be adding a little quite a bit more code to our Cloud.swift class and update our ContentView.swift to use it.

We’ll start with the Cloud.swift file. I included some code you already have to help you position this correctly.

import Foundation
import CloudKit
import Combine
let pingPublisher = PassthroughSubject<String, Never>()
let dataPublisher = PassthroughSubject<String, Never>()
let cloudPublisher = PassthroughSubject<String, Never>()
...func searchAndUpdate(name: String, publicK:String, device: String) {
print("searching ",name)
let predicate = NSPredicate(format: "name = %@", name)
let…

--

--

Mark Lucking
Mark Lucking

Written by Mark Lucking

Coding for 35+ years, enjoying using and learning Swift/iOS development. Writer @ Better Programming, @The StartUp, @Mac O’Clock, Level Up Coding & More

No responses yet