Member-only story

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

Mark Lucking
6 min readFeb 27, 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.

Obviously this is part X, you need to go back to the beginning for it to make any sense, indeed you need to look at the notifications series before do that else your struggle. Most of the parts are just 4 minutes long including code.

Where are we. In this article we going to be focusing on SwiftUI for the most part, with most of the background coding in place.

We setup our app such that we can register upto eight parties, identify their devices and send messages to each other, after an initial setup phase. It’s the setup phase we’re going to focus on here.

Firstly I want to setup a popup. It will look a little different on the iPad vs the iPhone, a feature of SwiftUI for now.

struct PopUp : View {
@Binding var code: String
@State var input: String
@State var status: String = ""
var body : some View {
VStack {
Text("and the Code is ...")
Text("\(self.code)")
TextField("Code?", text: $input, onEditingChanged: { (editing) in
if editing {
self.input = ""
}
}, onCommit: {
if self.code == self.input {…

--

--

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