Skip to content

Instantly share code, notes, and snippets.

View ThemingBasicsApp.swift
import SwiftUI
import StreamChat
import StreamChatSwiftUI
@main
struct SwiftUIChatDemoApp: App {
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
let nordeaDarkRed = Color(#colorLiteral(red: 0.9058823529, green: 0.01568627451, blue: 0.01568627451, alpha: 1))
var body: some Scene {
View MessagesView.swift
//
// MessagesView.swift
// iMessageClone
//
//
import SwiftUI
struct MessagesView: View {
View NavBarItems.swift
.navigationBarItems(
leading: Button {
print("Pressed edit button")
} label: {
Text("Edit")
},
trailing: Button {
print("Pressed compose button")
} label: {
View HeaderView.swift
//
// HeaderView.swift
// iMessageClone
//
//
import SwiftUI
struct HeaderView: View {
View MessagesStructure.swift
import Foundation
// Data structure
struct MessagesStructure: Identifiable { // Identifiable protocol - makes it possible to use value types that needs to have a stable notion of identity.
var id = UUID() // A universally unique identifier to identify a particular datafield and types
var unreadIndicator: String
var avatar: String
var name: String
var messageSummary: String
var timestamp: String
View MessagesDataModel.swift
//
// MessagesDataModel.swift
// MessagesDataModel
//
//
import Foundation
// Data structure
struct MessagesStructure: Identifiable { // Identifiable protocol - makes it possible to use value types that needs to have a stable notion of identity.
View StreamTextSpring.swift
//
// Chains.swift
// Stream Spring Demo
//
// Created by Amos
//
import SwiftUI
struct StreamDemo: View {
View textSpring.swift
//
// ChainedSpring.swift
// HundredDaysOfSwiftUI
//
//
import SwiftUI
struct ChainedSpring: View {
View SwiftUIChatDemoApp.swift
import SwiftUI
// Add the following two imports
import StreamChat
import StreamChatSwiftUI
@main
struct SwiftUIChatDemoApp: App {
// This is the property with a wrapper we need to add.
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
View draggableMenu.swift
//
// DraggableMenu.swift
// HundredDaysOfSwiftUI
//
// Created by Amos
//
import SwiftUI
struct DraggableMenu: View {