From 0b86bf8e2d8a7bf3487c2e9edad32217fe2f0c79 Mon Sep 17 00:00:00 2001 From: Naomi Plasterer Date: Thu, 14 Nov 2024 16:51:06 -0800 Subject: [PATCH] more clean up --- Package.swift | 2 +- .../XMTPiOSExample.xcodeproj/project.pbxproj | 50 ----- .../xcshareddata/swiftpm/Package.resolved | 121 +---------- .../Account/WalletConnection.swift | 189 ------------------ .../Account/WalletConnectionMethod.swift | 55 ----- .../Views/MessageCellView.swift | 12 -- .../Views/MessageListView.swift | 19 -- 7 files changed, 3 insertions(+), 445 deletions(-) delete mode 100644 XMTPiOSExample/XMTPiOSExample/Account/WalletConnection.swift delete mode 100644 XMTPiOSExample/XMTPiOSExample/Account/WalletConnectionMethod.swift diff --git a/Package.swift b/Package.swift index a7840d2b..02623cec 100644 --- a/Package.swift +++ b/Package.swift @@ -30,7 +30,7 @@ let package = Package( .product(name: "Gzip", package: "GzipSwift"), .product(name: "Connect", package: "connect-swift"), .product(name: "LibXMTP", package: "libxmtp-swift"), - .product(name: "Crypto", package: "CryptoSwift") + .product(name: "CryptoSwift", package: "CryptoSwift") ] ), .target( diff --git a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj index fb6acc0d..3bd16867 100644 --- a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj +++ b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.pbxproj @@ -18,7 +18,6 @@ A6557A312941166E00CC4C7B /* MessageCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6557A302941166E00CC4C7B /* MessageCellView.swift */; }; A6557A3329411F4F00CC4C7B /* NewConversationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6557A3229411F4F00CC4C7B /* NewConversationView.swift */; }; A65F0704297B5D4E00C3C76E /* Persistence.swift in Sources */ = {isa = PBXBuildFile; fileRef = A65F0703297B5D4E00C3C76E /* Persistence.swift */; }; - A65F0707297B5E7600C3C76E /* WalletConnectSwift in Frameworks */ = {isa = PBXBuildFile; productRef = A65F0706297B5E7600C3C76E /* WalletConnectSwift */; }; A65F070A297B5E8600C3C76E /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = A65F0709297B5E8600C3C76E /* KeychainAccess */; }; A6606A1A2B5EE80000E2ED4D /* XMTPiOS in Frameworks */ = {isa = PBXBuildFile; productRef = A6606A192B5EE80000E2ED4D /* XMTPiOS */; }; A67CCEC129355B4B00131F5C /* AccountManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A67CCEC029355B4B00131F5C /* AccountManager.swift */; }; @@ -32,9 +31,6 @@ A69F33CA292DD557005A5556 /* LoggedInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69F33C9292DD557005A5556 /* LoggedInView.swift */; }; A69F33CC292DD568005A5556 /* QRCodeSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A69F33CB292DD568005A5556 /* QRCodeSheetView.swift */; }; A6C0F37B2AC1E321008C6AA7 /* Starscream in Frameworks */ = {isa = PBXBuildFile; productRef = A6C0F37A2AC1E321008C6AA7 /* Starscream */; }; - A6C0F37E2AC1E34F008C6AA7 /* WalletConnect in Frameworks */ = {isa = PBXBuildFile; productRef = A6C0F37D2AC1E34F008C6AA7 /* WalletConnect */; }; - A6C0F3802AC1E34F008C6AA7 /* WalletConnectModal in Frameworks */ = {isa = PBXBuildFile; productRef = A6C0F37F2AC1E34F008C6AA7 /* WalletConnectModal */; }; - A6C0F3822AC1E34F008C6AA7 /* Web3Wallet in Frameworks */ = {isa = PBXBuildFile; productRef = A6C0F3812AC1E34F008C6AA7 /* Web3Wallet */; }; A6C0F3842AC1E4B5008C6AA7 /* LoginView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6C0F3832AC1E4B5008C6AA7 /* LoginView.swift */; }; A6C0F3862AC1E549008C6AA7 /* Data.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6C0F3852AC1E549008C6AA7 /* Data.swift */; }; A6D192D0293A7B97006B49F2 /* ConversationListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D192CF293A7B97006B49F2 /* ConversationListView.swift */; }; @@ -88,13 +84,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A65F0707297B5E7600C3C76E /* WalletConnectSwift in Frameworks */, - A6C0F3802AC1E34F008C6AA7 /* WalletConnectModal in Frameworks */, E513AEA32CE6AF2700BC31C3 /* CryptoSwift in Frameworks */, A6606A1A2B5EE80000E2ED4D /* XMTPiOS in Frameworks */, 6AEE396E29F330CD0027B657 /* secp256k1 in Frameworks */, - A6C0F37E2AC1E34F008C6AA7 /* WalletConnect in Frameworks */, - A6C0F3822AC1E34F008C6AA7 /* Web3Wallet in Frameworks */, A6C0F37B2AC1E321008C6AA7 /* Starscream in Frameworks */, A65F070A297B5E8600C3C76E /* KeychainAccess in Frameworks */, ); @@ -210,13 +202,9 @@ ); name = XMTPiOSExample; packageProductDependencies = ( - A65F0706297B5E7600C3C76E /* WalletConnectSwift */, A65F0709297B5E8600C3C76E /* KeychainAccess */, 6AEE396D29F330CD0027B657 /* secp256k1 */, A6C0F37A2AC1E321008C6AA7 /* Starscream */, - A6C0F37D2AC1E34F008C6AA7 /* WalletConnect */, - A6C0F37F2AC1E34F008C6AA7 /* WalletConnectModal */, - A6C0F3812AC1E34F008C6AA7 /* Web3Wallet */, A6606A192B5EE80000E2ED4D /* XMTPiOS */, E513AEA22CE6AF2700BC31C3 /* CryptoSwift */, ); @@ -249,11 +237,9 @@ ); mainGroup = A6281986292DC825004B9117; packageReferences = ( - A65F0705297B5E7500C3C76E /* XCRemoteSwiftPackageReference "WalletConnectSwift" */, A65F0708297B5E8600C3C76E /* XCRemoteSwiftPackageReference "KeychainAccess" */, 6AEE396C29F330CD0027B657 /* XCRemoteSwiftPackageReference "secp256k1.swift" */, A6C0F3792AC1E321008C6AA7 /* XCRemoteSwiftPackageReference "Starscream" */, - A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */, E513AEA12CE6AF2700BC31C3 /* XCRemoteSwiftPackageReference "CryptoSwift" */, ); productRefGroup = A6281990292DC825004B9117 /* Products */; @@ -553,14 +539,6 @@ version = 0.10.0; }; }; - A65F0705297B5E7500C3C76E /* XCRemoteSwiftPackageReference "WalletConnectSwift" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/WalletConnect/WalletConnectSwift"; - requirement = { - branch = master; - kind = branch; - }; - }; A65F0708297B5E8600C3C76E /* XCRemoteSwiftPackageReference "KeychainAccess" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/kishikawakatsumi/KeychainAccess"; @@ -577,14 +555,6 @@ version = 3.1.2; }; }; - A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/WalletConnect/WalletConnectSwiftV2"; - requirement = { - kind = exactVersion; - version = 1.9.8; - }; - }; E513AEA12CE6AF2700BC31C3 /* XCRemoteSwiftPackageReference "CryptoSwift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/krzyzanowskim/CryptoSwift.git"; @@ -601,11 +571,6 @@ package = 6AEE396C29F330CD0027B657 /* XCRemoteSwiftPackageReference "secp256k1.swift" */; productName = secp256k1; }; - A65F0706297B5E7600C3C76E /* WalletConnectSwift */ = { - isa = XCSwiftPackageProductDependency; - package = A65F0705297B5E7500C3C76E /* XCRemoteSwiftPackageReference "WalletConnectSwift" */; - productName = WalletConnectSwift; - }; A65F0709297B5E8600C3C76E /* KeychainAccess */ = { isa = XCSwiftPackageProductDependency; package = A65F0708297B5E8600C3C76E /* XCRemoteSwiftPackageReference "KeychainAccess" */; @@ -620,21 +585,6 @@ package = A6C0F3792AC1E321008C6AA7 /* XCRemoteSwiftPackageReference "Starscream" */; productName = Starscream; }; - A6C0F37D2AC1E34F008C6AA7 /* WalletConnect */ = { - isa = XCSwiftPackageProductDependency; - package = A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */; - productName = WalletConnect; - }; - A6C0F37F2AC1E34F008C6AA7 /* WalletConnectModal */ = { - isa = XCSwiftPackageProductDependency; - package = A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */; - productName = WalletConnectModal; - }; - A6C0F3812AC1E34F008C6AA7 /* Web3Wallet */ = { - isa = XCSwiftPackageProductDependency; - package = A6C0F37C2AC1E34F008C6AA7 /* XCRemoteSwiftPackageReference "WalletConnectSwiftV2" */; - productName = Web3Wallet; - }; E513AEA22CE6AF2700BC31C3 /* CryptoSwift */ = { isa = XCSwiftPackageProductDependency; package = E513AEA12CE6AF2700BC31C3 /* XCRemoteSwiftPackageReference "CryptoSwift" */; diff --git a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b9e4d141..a156dcf3 100644 --- a/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/XMTPiOSExample/XMTPiOSExample.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,14 +1,5 @@ { "pins" : [ - { - "identity" : "bigint", - "kind" : "remoteSourceControl", - "location" : "https://github.com/attaswift/BigInt", - "state" : { - "revision" : "0ed110f7555c34ff468e72e1686e59721f2b0da6", - "version" : "5.3.0" - } - }, { "identity" : "connect-swift", "kind" : "remoteSourceControl", @@ -23,17 +14,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", "state" : { - "revision" : "039f56c5d7960f277087a0be51f5eb04ed0ec073", - "version" : "1.5.1" - } - }, - { - "identity" : "generic-json-swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/iwill/generic-json-swift", - "state" : { - "revision" : "0a06575f4038b504e78ac330913d920f1630f510", - "version" : "2.0.2" + "revision" : "678d442c6f7828def400a70ae15968aef67ef52d", + "version" : "1.8.3" } }, { @@ -63,15 +45,6 @@ "version" : "3.0.0" } }, - { - "identity" : "qrcode", - "kind" : "remoteSourceControl", - "location" : "https://github.com/WalletConnect/QRCode", - "state" : { - "revision" : "263f280d2c8144adfb0b6676109846cfc8dd552b", - "version" : "14.3.1" - } - }, { "identity" : "secp256k1.swift", "kind" : "remoteSourceControl", @@ -126,24 +99,6 @@ "version" : "1.0.0" } }, - { - "identity" : "swift-http-types", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-http-types", - "state" : { - "revision" : "99d066e29effa8845e4761dd3f2f831edfdf8925", - "version" : "1.0.0" - } - }, - { - "identity" : "swift-log", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-log.git", - "state" : { - "revision" : "532d8b529501fb73a2455b179e0bbb6d49b652ed", - "version" : "1.5.3" - } - }, { "identity" : "swift-nio", "kind" : "remoteSourceControl", @@ -153,15 +108,6 @@ "version" : "2.64.0" } }, - { - "identity" : "swift-nio-extras", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-extras.git", - "state" : { - "revision" : "798c962495593a23fdea0c0c63fd55571d8dff51", - "version" : "1.20.0" - } - }, { "identity" : "swift-nio-http2", "kind" : "remoteSourceControl", @@ -180,15 +126,6 @@ "version" : "2.26.0" } }, - { - "identity" : "swift-nio-transport-services", - "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-nio-transport-services.git", - "state" : { - "revision" : "ebf8b9c365a6ce043bf6e6326a04b15589bd285e", - "version" : "1.20.0" - } - }, { "identity" : "swift-protobuf", "kind" : "remoteSourceControl", @@ -198,15 +135,6 @@ "version" : "1.25.2" } }, - { - "identity" : "swift-qrcode-generator", - "kind" : "remoteSourceControl", - "location" : "https://github.com/dagronf/swift-qrcode-generator", - "state" : { - "revision" : "5ca09b6a2ad190f94aa3d6ddef45b187f8c0343b", - "version" : "1.0.3" - } - }, { "identity" : "swift-system", "kind" : "remoteSourceControl", @@ -215,51 +143,6 @@ "revision" : "025bcb1165deab2e20d4eaba79967ce73013f496", "version" : "1.2.1" } - }, - { - "identity" : "swiftimagereadwrite", - "kind" : "remoteSourceControl", - "location" : "https://github.com/dagronf/SwiftImageReadWrite", - "state" : { - "revision" : "5596407d1cf61b953b8e658fa8636a471df3c509", - "version" : "1.1.6" - } - }, - { - "identity" : "walletconnectswift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/WalletConnect/WalletConnectSwift", - "state" : { - "branch" : "master", - "revision" : "9e4dfba34fb35336fd5da551285d7986ff536cb8" - } - }, - { - "identity" : "walletconnectswiftv2", - "kind" : "remoteSourceControl", - "location" : "https://github.com/WalletConnect/WalletConnectSwiftV2", - "state" : { - "revision" : "addf9a3688ef5e5d9d148ecbb30ca0fd3132b908", - "version" : "1.9.8" - } - }, - { - "identity" : "web3.swift", - "kind" : "remoteSourceControl", - "location" : "https://github.com/argentlabs/web3.swift", - "state" : { - "revision" : "8ca33e700ed8de6137a0e1471017aa3b3c8de0db", - "version" : "1.6.0" - } - }, - { - "identity" : "websocket-kit", - "kind" : "remoteSourceControl", - "location" : "https://github.com/vapor/websocket-kit.git", - "state" : { - "revision" : "53fe0639a98903858d0196b699720decb42aee7b", - "version" : "2.14.0" - } } ], "version" : 2 diff --git a/XMTPiOSExample/XMTPiOSExample/Account/WalletConnection.swift b/XMTPiOSExample/XMTPiOSExample/Account/WalletConnection.swift deleted file mode 100644 index 91c1376b..00000000 --- a/XMTPiOSExample/XMTPiOSExample/Account/WalletConnection.swift +++ /dev/null @@ -1,189 +0,0 @@ -import Foundation -import UIKit -import WalletConnectSwift -import web3 -import XMTPiOS - -extension WCURL { - var asURL: URL { - // swiftlint:disable force_unwrapping - URL(string: "wc://wc?uri=\(absoluteString)")! - // swiftlint:enable force_unwrapping - } -} - -enum WalletConnectionError: String, Error { - case walletConnectURL - case noSession - case noAddress - case invalidMessage - case noSignature -} - -protocol WalletConnection { - var isConnected: Bool { get } - var walletAddress: String? { get } - func preferredConnectionMethod() throws -> WalletConnectionMethodType - func connect() async throws - func sign(_ data: Data) async throws -> Data -} - -class WCWalletConnection: WalletConnection, WalletConnectSwift.ClientDelegate { - @Published public var isConnected = false - - var walletConnectClient: WalletConnectSwift.Client! - var session: WalletConnectSwift.Session? { - didSet { - DispatchQueue.main.async { - self.isConnected = self.session != nil - } - } - } - - init() { - let peerMeta = Session.ClientMeta( - name: "xmtp-ios", - description: "XMTP", - icons: [], - // swiftlint:disable force_unwrapping - url: URL(string: "https://safe.gnosis.io")! - // swiftlint:enable force_unwrapping - ) - let dAppInfo = WalletConnectSwift.Session.DAppInfo(peerId: UUID().uuidString, peerMeta: peerMeta) - - walletConnectClient = WalletConnectSwift.Client(delegate: self, dAppInfo: dAppInfo) - } - - @MainActor func preferredConnectionMethod() throws -> WalletConnectionMethodType { - guard let url = walletConnectURL?.asURL else { - throw WalletConnectionError.walletConnectURL - } - - if UIApplication.shared.canOpenURL(url) { - return WalletRedirectConnectionMethod(redirectURI: url.absoluteString).type - } - - return WalletQRCodeConnectionMethod(redirectURI: url.absoluteString).type - } - - lazy var walletConnectURL: WCURL? = { - do { - let keybytes = try secureRandomBytes(count: 32) - - return WCURL( - topic: UUID().uuidString, - // swiftlint:disable force_unwrapping - bridgeURL: URL(string: "https://bridge.walletconnect.org")!, - // swiftlint:enable force_unwrapping - key: keybytes.reduce("") { $0 + String(format: "%02x", $1) } - ) - } catch { - return nil - } - }() - - func secureRandomBytes(count: Int) throws -> Data { - var bytes = [UInt8](repeating: 0, count: count) - - // Fill bytes with secure random data - let status = SecRandomCopyBytes( - kSecRandomDefault, - count, - &bytes - ) - - // A status of errSecSuccess indicates success - if status == errSecSuccess { - return Data(bytes) - } else { - fatalError("could not generate random bytes") - } - } - - func connect() async throws { - guard let url = walletConnectURL else { - throw WalletConnectionError.walletConnectURL - } - - try walletConnectClient.connect(to: url) - } - - func sign(_ data: Data) async throws -> Data { - guard session != nil else { - throw WalletConnectionError.noSession - } - - guard let walletAddress = walletAddress else { - throw WalletConnectionError.noAddress - } - - guard let url = walletConnectURL else { - throw WalletConnectionError.walletConnectURL - } - - guard let message = String(data: data, encoding: .utf8) else { - throw WalletConnectionError.invalidMessage - } - - return try await withCheckedThrowingContinuation { continuation in - do { - try walletConnectClient.personal_sign(url: url, message: message, account: walletAddress) { response in - if let error = response.error { - continuation.resume(throwing: error) - return - } - - do { - var resultString = try response.result(as: String.self) - - // Strip leading 0x that we get back from `personal_sign` - if resultString.hasPrefix("0x"), resultString.count == 132 { - resultString = String(resultString.dropFirst(2)) - } - - guard let resultDataBytes = resultString.web3.bytesFromHex else { - continuation.resume(throwing: WalletConnectionError.noSignature) - return - } - - var resultData = Data(resultDataBytes) - - // Ensure we have a valid recovery byte - resultData[resultData.count - 1] = 1 - resultData[resultData.count - 1] % 2 - - continuation.resume(returning: resultData) - } catch { - continuation.resume(throwing: error) - } - } - } catch { - continuation.resume(throwing: error) - } - } - } - - var walletAddress: String? { - if let address = session?.walletInfo?.accounts.first { - return EthereumAddress(address).toChecksumAddress() - } - - return nil - } - - func client(_: WalletConnectSwift.Client, didConnect _: WalletConnectSwift.WCURL) {} - - func client(_: WalletConnectSwift.Client, didFailToConnect _: WalletConnectSwift.WCURL) {} - - func client(_: WalletConnectSwift.Client, didConnect session: WalletConnectSwift.Session) { - // Future Implementation Cache session - self.session = session - } - - func client(_: WalletConnectSwift.Client, didUpdate session: WalletConnectSwift.Session) { - self.session = session - } - - func client(_: WalletConnectSwift.Client, didDisconnect _: WalletConnectSwift.Session) { - session = nil - } -} diff --git a/XMTPiOSExample/XMTPiOSExample/Account/WalletConnectionMethod.swift b/XMTPiOSExample/XMTPiOSExample/Account/WalletConnectionMethod.swift deleted file mode 100644 index 35c718ac..00000000 --- a/XMTPiOSExample/XMTPiOSExample/Account/WalletConnectionMethod.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// WalletConnectionMethod.swift -// -// -// Created by Pat Nakajima on 11/22/22. -// - -import CoreImage.CIFilterBuiltins -import UIKit -import WalletConnectSwift - -protocol WalletConnectionMethod { - var type: WalletConnectionMethodType { get } -} - -/// Describes WalletConnect flows. -public enum WalletConnectionMethodType { - case redirect(URL), qrCode(UIImage), manual(String) -} - -struct WalletRedirectConnectionMethod: WalletConnectionMethod { - var redirectURI: String - var type: WalletConnectionMethodType { - // swiftlint:disable force_unwrapping - .redirect(URL(string: redirectURI)!) - // swiftlint:enable force_unwrapping - } -} - -struct WalletQRCodeConnectionMethod: WalletConnectionMethod { - var redirectURI: String - var type: WalletConnectionMethodType { - let data = Data(redirectURI.utf8) - let context = CIContext() - let filter = CIFilter.qrCodeGenerator() - filter.setValue(data, forKey: "inputMessage") - - // swiftlint:disable force_unwrapping - let outputImage = filter.outputImage! - let scaledImage = outputImage.transformed(by: CGAffineTransform(scaleX: 3, y: 3)) - let cgImage = context.createCGImage(scaledImage, from: scaledImage.extent)! - // swiftlint:enable force_unwrapping - - let image = UIImage(cgImage: cgImage) - - return .qrCode(image) - } -} - -struct WalletManualConnectionMethod: WalletConnectionMethod { - var redirectURI: String - var type: WalletConnectionMethodType { - .manual(redirectURI) - } -} diff --git a/XMTPiOSExample/XMTPiOSExample/Views/MessageCellView.swift b/XMTPiOSExample/XMTPiOSExample/Views/MessageCellView.swift index 71105cc6..f7483ab9 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/MessageCellView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/MessageCellView.swift @@ -7,7 +7,6 @@ import SwiftUI import XMTPiOS -import web3 struct MessageTextView: View { var myAddress: String @@ -126,14 +125,3 @@ struct MessageCellView: View { } } } - -struct MessageCellView_Previews: PreviewProvider { - static var previews: some View { - PreviewClientProvider { client in - List { - MessageCellView(myAddress: "0x00", message: DecodedMessage.preview(client: client, topic: "foo", body: "Hi, how is it going?", senderAddress: "0x00", sent: Date())) - } - .listStyle(.plain) - } - } -} diff --git a/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift b/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift index 087035ec..258b6c1d 100644 --- a/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift +++ b/XMTPiOSExample/XMTPiOSExample/Views/MessageListView.swift @@ -39,22 +39,3 @@ struct MessageListView: View { } } } - -struct MessageListView_Previews: PreviewProvider { - static var previews: some View { - PreviewClientProvider { client in - // swiftlint: disable comma - MessageListView( - myAddress: "0x00", messages: [ - DecodedMessage.preview(client: client, topic: "foo", body: "Hello", senderAddress: "0x00", sent: Date().addingTimeInterval(-10)), - DecodedMessage.preview(client: client, topic: "foo",body: "Oh hi", senderAddress: "0x01", sent: Date().addingTimeInterval(-9)), - DecodedMessage.preview(client: client, topic: "foo",body: "Sup", senderAddress: "0x01", sent: Date().addingTimeInterval(-8)), - DecodedMessage.preview(client: client, topic: "foo",body: "Nice to see you", senderAddress: "0x00", sent: Date().addingTimeInterval(-7)), - DecodedMessage.preview(client: client, topic: "foo",body: "What if it's a longer message I mean really really long like should it wrap?", senderAddress: "0x01", sent: Date().addingTimeInterval(-6)), - DecodedMessage.preview(client: client, topic: "foo",body: "🧐", senderAddress: "0x00", sent: Date().addingTimeInterval(-5)), - ] - ) - // swiftlint: enable comma - } - } -}