Skip to content

Instantly share code, notes, and snippets.

//
// SceneDelegate.swift
// SwiftUI Chat App
//
// Created by Nick Halavins on 10/11/19.
// Copyright © 2019 AntiChat, Inc. All rights reserved.
//
import UIKit
import SwiftUI
@halavins
halavins / contentView.swift
Last active October 12, 2019 04:20
contentView v2
//
// ContentView.swift
// SwiftUI Chat
//
// Created by Nick Halavins on 6/7/19. Updated 10/11/19
// Copyright © 2019 AntiLand. All rights reserved.
//
import SwiftUI
// let's create a structure that will represent each message in chat
@halavins
halavins / ChatController.swift
Last active October 12, 2019 04:35
ChatController in old Swift as the bridge with SwiftUI Views
//
// ChatController.swift
// SwiftUI Chat
//
// Created by Nick Halavins on 6/7/19. Updated 10/11/19
// Copyright © 2019 AntiLand. All rights reserved.
//
import Combine
import SwiftUI
@halavins
halavins / struct.swift
Last active October 12, 2019 03:43
ChatRow struct from contentView.swift
// ChatRow will be a view similar to a Cell in standard Swift
struct ChatRow : View {
// we will need to access and represent the chatMessages here
var chatMessage: ChatMessage
// body - is the body of the view, just like the body of the first view we created when opened the project
var body: some View {
// HStack - is a horizontal stack. We let the SwiftUI know that we need to place
// all the following contents horizontally one after another
//
// ContentView.swift
// SwiftUI Chat
//
// Created by Nick Halavins on 6/7/19. Updated 10/11/19
// Copyright © 2019 AntiLand. All rights reserved.
//
import SwiftUI