Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release] Develop -> Main v2-rc0 #350

Merged
merged 96 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
ec912a3
Keyserver registry service
Jul 4, 2022
e3bdb9b
Mainscreen tabs
flypaper0 Jul 4, 2022
74ca34c
Update thread creation
llbartekll Jul 7, 2022
7b08817
comment out chat tests
llbartekll Jul 7, 2022
95e2bfa
expose messages and threads
llbartekll Jul 7, 2022
a7618c7
Chat UI
flypaper0 Jul 4, 2022
01c724b
Merge pull request #309 from WalletConnect/#296-update-thread-creation
flypaper0 Jul 7, 2022
bdd8d3e
Merge pull request #315 from WalletConnect/feature/chat-samplle-app-#298
flypaper0 Jul 7, 2022
c3b4bd5
Add database
llbartekll Jul 7, 2022
0daa75d
store threads
llbartekll Jul 7, 2022
216b745
Merge pull request #311 from WalletConnect/feature/#305-keyserver-ser…
flypaper0 Jul 7, 2022
9982193
ChatList screen
flypaper0 Jul 7, 2022
935d923
InvitesList screen
flypaper0 Jul 7, 2022
88dbbd6
savepoint
llbartekll Jul 8, 2022
d303409
expose getInvites
llbartekll Jul 8, 2022
7fdf048
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 8, 2022
a87b14c
comment out tests
llbartekll Jul 8, 2022
0e83758
add account param in invite
llbartekll Jul 8, 2022
c4b4034
savepoint
llbartekll Jul 8, 2022
4375b87
savepoint
llbartekll Jul 8, 2022
2d900a2
Re-enable ping test, fix deadlocked task
Jul 7, 2022
1313122
savepoint
llbartekll Jul 8, 2022
bdc3b04
fix task issue
llbartekll Jul 8, 2022
7f8752a
update
llbartekll Jul 8, 2022
1cd708e
Re-enable session delete integration test
Jul 8, 2022
cd83c7f
Invite screen UI
flypaper0 Jul 8, 2022
a5bafd0
run lint
llbartekll Jul 8, 2022
59dfd88
comment out chat integration tests
llbartekll Jul 8, 2022
14d204b
Merge pull request #317 from WalletConnect/feature/chat-sample-homesc…
Jul 8, 2022
423ff8f
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 8, 2022
2b255d5
Merge pull request #316 from WalletConnect/chat-interfaces
llbartekll Jul 8, 2022
a454d06
Merge pull request #318 from WalletConnect/tests/#250-delete-integrat…
llbartekll Jul 8, 2022
8a47f9f
remove invite envelope
llbartekll Jul 8, 2022
dcfb37f
Chat SDK integration
flypaper0 Jul 8, 2022
4eeeb84
remove invite envelope
llbartekll Jul 8, 2022
d62047e
Register and resolving
flypaper0 Jul 8, 2022
c86ec07
Send message MainActor
flypaper0 Jul 10, 2022
3739c4e
savepoint
llbartekll Jul 12, 2022
61c00e6
add custom encoder
llbartekll Jul 12, 2022
3ab42dc
fix chat encoding
llbartekll Jul 12, 2022
4ab7d33
rename pubkey to publicKey in chat invite
llbartekll Jul 12, 2022
8b00b2c
add reject method
llbartekll Jul 12, 2022
10e964f
Merge pull request #320 from WalletConnect/feature/chat-app-sdk-integ…
llbartekll Jul 12, 2022
7ca77e3
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 12, 2022
4862d0e
fix build
llbartekll Jul 12, 2022
0de54ce
sync messages with kotlin
llbartekll Jul 12, 2022
bb87e42
fix timestamp in message to miliseconds
llbartekll Jul 12, 2022
46f0d60
comment out tests
llbartekll Jul 12, 2022
dbd9cce
remove print statement
llbartekll Jul 12, 2022
5442871
Message callback on send
flypaper0 Jul 12, 2022
dc9ec49
add 6000 code to sign sdk on disconnect
llbartekll Jul 12, 2022
6dee074
Keyserver host changed
flypaper0 Jul 12, 2022
df4711a
Merge pull request #327 from WalletConnect/bugfix/message-callback-on…
llbartekll Jul 12, 2022
696cb1a
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 12, 2022
14b8d1e
remove invite payload after accepting an invite
llbartekll Jul 12, 2022
0ffedc8
apply PR comments
llbartekll Jul 12, 2022
08b49ee
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 12, 2022
566fed3
Merge pull request #322 from WalletConnect/kotlin-sync
llbartekll Jul 12, 2022
00ebce5
fix build
llbartekll Jul 12, 2022
2b441f0
fix dapp build
llbartekll Jul 12, 2022
52ac6f6
Merge pull request #328 from WalletConnect/#253-Add-user-disconnected…
llbartekll Jul 12, 2022
e5da729
savepoint
llbartekll Jul 13, 2022
b2a2068
add persistence for messages and threads
llbartekll Jul 13, 2022
5476522
comment tests
llbartekll Jul 13, 2022
2334627
resubscribe for threads after app relaunch
llbartekll Jul 13, 2022
c1b7cdf
run lint
llbartekll Jul 13, 2022
dcc50f3
Merge pull request #332 from WalletConnect/messages-and-threads-store
llbartekll Jul 13, 2022
9107f07
Merge pull request #333 from WalletConnect/add-resubscription
llbartekll Jul 13, 2022
9c0299f
Welcome screen with animation
flypaper0 Jul 12, 2022
4bf5638
Import Scene
flypaper0 Jul 13, 2022
9b21f7a
UX improvements
flypaper0 Jul 13, 2022
d6894d1
Refresh after Approve / Reject
flypaper0 Jul 13, 2022
82c0429
Dismiss invitelist after approve / reject
flypaper0 Jul 13, 2022
e687591
Filter logic removed
flypaper0 Jul 13, 2022
5f373da
Add tags to WCRequest methods
Jul 13, 2022
54a22d1
Replace publish calls with int tag
Jul 14, 2022
ee18a9e
Replaced chat publish calls with tags
Jul 14, 2022
b9910fa
Remove publish tag type
Jul 14, 2022
d5237a4
Fix broken integration test build
Jul 14, 2022
d38c8ba
remove hardcoded self account
llbartekll Jul 14, 2022
9bc39e3
Merge pull request #334 from WalletConnect/feature/sample-app-welcome…
llbartekll Jul 14, 2022
b7ff9c4
Merge pull request #335 from WalletConnect/feature/#330-granular-tags
llbartekll Jul 14, 2022
be7a7e9
Merge branch 'develop' of github.com:WalletConnect/WalletConnectSwift…
llbartekll Jul 14, 2022
e004c1b
remove messages duplicates after app relaunch
llbartekll Jul 14, 2022
71bbeb9
run lint
llbartekll Jul 14, 2022
a1338e7
typealias for Account
flypaper0 Jul 14, 2022
ddf3dce
Present ChatList
flypaper0 Jul 14, 2022
76d815a
EmptyState View
flypaper0 Jul 14, 2022
803d161
Changed session requirement to check update against proposal namespaces
Jul 15, 2022
905d49f
Refactor and cleanup
Jul 15, 2022
310d70f
Merge pull request #338 from WalletConnect/#337-fix-hardcoded-self-ac…
llbartekll Jul 15, 2022
6e0b397
Merge pull request #339 from WalletConnect/#336-remove-messages-dupli…
llbartekll Jul 15, 2022
77114f9
Merge pull request #341 from WalletConnect/feature/sample-app-empty-s…
llbartekll Jul 15, 2022
ac6a91c
Merge pull request #342 from WalletConnect/bugfix/#340-required-names…
llbartekll Jul 15, 2022
3be9ea2
add user agent
llbartekll Jul 18, 2022
01f3c4b
Merge pull request #349 from WalletConnect/user-agent
Jul 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Example/DApp/ Accounts/AccountsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class AccountsViewController: UIViewController, UITableViewDataSource, UIT
private func disconnect() {
Task {
do {
try await Sign.instance.disconnect(topic: session.topic, reason: Reason(code: 0, message: "disconnect"))
try await Sign.instance.disconnect(topic: session.topic)
DispatchQueue.main.async { [weak self] in
self?.onDisconnect?()
}
Expand Down
650 changes: 650 additions & 0 deletions Example/ExampleApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Example/ExampleApp/Wallet/WalletViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ extension WalletViewController: UITableViewDataSource, UITableViewDelegate {
let item = sessionItems[indexPath.row]
Task {
do {
try await Sign.instance.disconnect(topic: item.topic, reason: Reason(code: 0, message: "disconnect"))
try await Sign.instance.disconnect(topic: item.topic)
DispatchQueue.main.async { [weak self] in
self?.sessionItems.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .automatic)
Expand Down
76 changes: 56 additions & 20 deletions Example/IntegrationTests/Chat/ChatTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import WalletConnectRelay
import Combine

final class ChatTests: XCTestCase {
var invitee: Chat!
var inviter: Chat!
var invitee: ChatClient!
var inviter: ChatClient!
var registry: KeyValueRegistry!
private var publishers = [AnyCancellable]()

Expand Down Expand Up @@ -37,37 +37,40 @@ final class ChatTests: XCTestCase {
return
}

func makeClient(prefix: String) -> Chat {
func makeClient(prefix: String) -> ChatClient {
let logger = ConsoleLogger(suffix: prefix, loggingLevel: .debug)
let relayHost = "relay.walletconnect.com"
let projectId = "8ba9ee138960775e5231b70cc5ef1c3a"
let keychain = KeychainStorageMock()
let relayClient = RelayClient(relayHost: relayHost, projectId: projectId, keychainStorage: keychain, socketFactory: SocketFactory(), logger: logger)
return Chat(registry: registry, relayClient: relayClient, kms: KeyManagementService(keychain: keychain), logger: logger, keyValueStorage: RuntimeKeyValueStorage())
return ChatClient(registry: registry, relayClient: relayClient, kms: KeyManagementService(keychain: keychain), logger: logger, keyValueStorage: RuntimeKeyValueStorage())
}

func testInvite() async {
// await waitClientsConnected()
// let inviteExpectation = expectation(description: "invitation expectation")
// let account = Account(chainIdentifier: "eip155:1", address: "0x3627523167367216556273151")!
// let pubKey = try! await invitee.register(account: account)
// try! await inviter.invite(publicKey: pubKey, openingMessage: "")
// invitee.invitePublisher.sink { _ in
// inviteExpectation.fulfill()
// }.store(in: &publishers)
// wait(for: [inviteExpectation], timeout: 4)
await waitClientsConnected()
let inviteExpectation = expectation(description: "invitation expectation")
let inviteeAccount = Account(chainIdentifier: "eip155:1", address: "0x3627523167367216556273151")!
let inviterAccount = Account(chainIdentifier: "eip155:1", address: "0x36275231673672234423f")!
let pubKey = try! await invitee.register(account: inviteeAccount)
try! await inviter.invite(publicKey: pubKey, peerAccount: inviteeAccount, openingMessage: "", account: inviterAccount)
invitee.invitePublisher.sink { _ in
inviteExpectation.fulfill()
}.store(in: &publishers)
wait(for: [inviteExpectation], timeout: 4)
}

func testAcceptAndCreateNewThread() async {
// func testAcceptAndCreateNewThread() async {
// await waitClientsConnected()
// let newThreadInviterExpectation = expectation(description: "new thread on inviting client expectation")
// let newThreadinviteeExpectation = expectation(description: "new thread on invitee client expectation")
// let account = Account(chainIdentifier: "eip155:1", address: "0x3627523167367216556273151")!
// let pubKey = try! await invitee.register(account: account)
// try! await inviter.invite(publicKey: pubKey, openingMessage: "opening message")
// let inviteeAccount = Account(chainIdentifier: "eip155:1", address: "0x3627523167367216556273151")!
// let inviterAccount = Account(chainIdentifier: "eip155:1", address: "0x36275231673672234423f")!
// let pubKey = try! await invitee.register(account: inviteeAccount)
//
// invitee.invitePublisher.sink { [unowned self] inviteEnvelope in
// Task {try! await invitee.accept(inviteId: inviteEnvelope.pubKey)}
// try! await inviter.invite(publicKey: pubKey, peerAccount: inviteeAccount, openingMessage: "opening message", account: inviterAccount)
//
// invitee.invitePublisher.sink { [unowned self] invite in
// Task {try! await invitee.accept(inviteId: invite.id)}
// }.store(in: &publishers)
//
// invitee.newThreadPublisher.sink { _ in
Expand All @@ -79,5 +82,38 @@ final class ChatTests: XCTestCase {
// }.store(in: &publishers)
//
// wait(for: [newThreadinviteeExpectation, newThreadInviterExpectation], timeout: 4)
}
// }
//
// func testMessage() async {
// await waitClientsConnected()
// let messageExpectation = expectation(description: "message received")
// messageExpectation.expectedFulfillmentCount = 2
// let message = "message"
// let inviteeAccount = Account(chainIdentifier: "eip155:1", address: "0x3627523167367216556273151")!
// let inviterAccount = Account(chainIdentifier: "eip155:1", address: "0x36275231673672234423f")!
// let pubKey = try! await invitee.register(account: inviteeAccount)
// try! await inviter.invite(publicKey: pubKey, peerAccount: inviteeAccount, openingMessage: "opening message", account: inviterAccount)
//
// invitee.invitePublisher.sink { [unowned self] invite in
// Task {try! await invitee.accept(inviteId: invite.id)}
// }.store(in: &publishers)
//
// invitee.newThreadPublisher.sink { [unowned self] thread in
// Task {try! await invitee.message(topic: thread.topic, message: message)}
// }.store(in: &publishers)
//
// inviter.newThreadPublisher.sink { [unowned self] thread in
// Task {try! await inviter.message(topic: thread.topic, message: message)}
// }.store(in: &publishers)
//
// inviter.messagePublisher.sink { _ in
// messageExpectation.fulfill()
// }.store(in: &publishers)
//
// invitee.messagePublisher.sink { _ in
// messageExpectation.fulfill()
// }.store(in: &publishers)
//
// wait(for: [messageExpectation], timeout: 35)
// }
}
18 changes: 18 additions & 0 deletions Example/IntegrationTests/Chat/RegistryTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import XCTest
import WalletConnectRelay
import WalletConnectKMS
import WalletConnectUtils
@testable import Chat

final class RegistryTests: XCTestCase {

func testRegistry() async throws {
let client = HTTPClient(host: "keys.walletconnect.com")
let registry = KeyserverRegistryProvider(client: client)
let account = Account("eip155:1:" + Data.randomBytes(count: 16).toHexString())!
let pubKey = SigningPrivateKey().publicKey.hexRepresentation
try await registry.register(account: account, pubKey: pubKey)
let resolvedKey = try await registry.resolve(account: account)
XCTAssertEqual(resolvedKey, pubKey)
}
}
5 changes: 3 additions & 2 deletions Example/IntegrationTests/Relay/RelayClientEndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ final class RelayClientEndToEndTests: XCTestCase {
)
let urlFactory = RelayUrlFactory(socketAuthenticator: socketAuthenticator)
let socket = WebSocket(url: urlFactory.create(host: relayHost, projectId: projectId))

let logger = ConsoleLogger()
let dispatcher = Dispatcher(socket: socket, socketConnectionHandler: ManualSocketConnectionHandler(socket: socket), logger: logger)
return RelayClient(dispatcher: dispatcher, logger: logger, keyValueStorage: RuntimeKeyValueStorage())
Expand Down Expand Up @@ -75,15 +76,15 @@ final class RelayClientEndToEndTests: XCTestCase {
expectationB.fulfill()
}
relayA.socketConnectionStatusPublisher.sink { _ in
relayA.publish(topic: randomTopic, payload: payloadA, tag: .unknown, onNetworkAcknowledge: { error in
relayA.publish(topic: randomTopic, payload: payloadA, tag: 0, onNetworkAcknowledge: { error in
XCTAssertNil(error)
})
relayA.subscribe(topic: randomTopic) { error in
XCTAssertNil(error)
}
}.store(in: &publishers)
relayB.socketConnectionStatusPublisher.sink { _ in
relayB.publish(topic: randomTopic, payload: payloadB, tag: .unknown, onNetworkAcknowledge: { error in
relayB.publish(topic: randomTopic, payload: payloadB, tag: 0, onNetworkAcknowledge: { error in
XCTAssertNil(error)
})
relayB.subscribe(topic: randomTopic) { error in
Expand Down
77 changes: 43 additions & 34 deletions Example/IntegrationTests/Sign/SignClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,22 +112,49 @@ final class SignClientTests: XCTestCase {
}
wait(for: [sessionRejectExpectation], timeout: defaultTimeout)
}
//
// func testNewPairingPing() async {
// let responderReceivesPingResponseExpectation = expectation(description: "Responder receives ping response")
// await waitClientsConnected()
//
// let uri = try! await proposer.client.connect(requiredNamespaces: [:])!
//
// try! await responder.client.pair(uri: uri)
// let pairing = responder.client.getSettledPairings().first!
// responder.client.ping(topic: pairing.topic) { response in
// XCTAssertTrue(response.isSuccess)
// responderReceivesPingResponseExpectation.fulfill()
// }
// wait(for: [responderReceivesPingResponseExpectation], timeout: defaultTimeout)
// }
//

func testSessionDelete() async throws {
let dapp = proposer!
let wallet = responder!
let sessionDeleteExpectation = expectation(description: "Wallet expects session to be deleted")
let requiredNamespaces = ProposalNamespace.stubRequired()
let sessionNamespaces = SessionNamespace.make(toRespond: requiredNamespaces)

wallet.onSessionProposal = { proposal in
Task(priority: .high) {
do { try await wallet.client.approve(proposalId: proposal.id, namespaces: sessionNamespaces) } catch { XCTFail("\(error)") }
}
}
dapp.onSessionSettled = { settledSession in
Task(priority: .high) {
try await dapp.client.disconnect(topic: settledSession.topic)
}
}
wallet.onSessionDelete = {
sessionDeleteExpectation.fulfill()
}

let uri = try await dapp.client.connect(requiredNamespaces: requiredNamespaces)
try await wallet.client.pair(uri: uri!)
wait(for: [sessionDeleteExpectation], timeout: defaultTimeout)
}

func testNewPairingPing() async throws {
let dapp = proposer!
let wallet = responder!
let pongResponseExpectation = expectation(description: "Ping sender receives a pong response")

let uri = try await dapp.client.connect(requiredNamespaces: ProposalNamespace.stubRequired())!
try await wallet.client.pair(uri: uri)

let pairing = wallet.client.getSettledPairings().first!
wallet.client.ping(topic: pairing.topic) { result in
if case .failure = result { XCTFail() }
pongResponseExpectation.fulfill()
}
wait(for: [pongResponseExpectation], timeout: defaultTimeout)
}

//
// func testNewSessionOnExistingPairing() async {
// await waitClientsConnected()
Expand Down Expand Up @@ -159,24 +186,6 @@ final class SignClientTests: XCTestCase {
// wait(for: [proposerSettlesSessionExpectation, responderSettlesSessionExpectation], timeout: defaultTimeout)
// }
//
// func testDeleteSession() async {
// await waitClientsConnected()
// let sessionDeleteExpectation = expectation(description: "Responder is notified on session deletion")
// let uri = try! await proposer.client.connect(namespaces: [Namespace.stub()])!
// _ = try! await responder.client.pair(uri: uri)
// responder.onSessionProposal = {[unowned self] proposal in
// try? self.responder.client.approve(proposalId: proposal.id, accounts: [], namespaces: [])
// }
// proposer.onSessionSettled = {[unowned self] settledSession in
// Task {
// try await self.proposer.client.disconnect(topic: settledSession.topic, reason: Reason(code: 5900, message: "User disconnected session"))
// }
// }
// responder.onSessionDelete = {
// sessionDeleteExpectation.fulfill()
// }
// wait(for: [sessionDeleteExpectation], timeout: defaultTimeout)
// }
//
// func testProposerRequestSessionRequest() async {
// await waitClientsConnected()
Expand Down
20 changes: 20 additions & 0 deletions Example/Showcase/Classes/ApplicationLayer/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import UIKit

@main
class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {

}
}
17 changes: 17 additions & 0 deletions Example/Showcase/Classes/ApplicationLayer/Application.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation
import Chat

final class Application {

let chatService: ChatService = {
return ChatService(client: ChatFactory.create())
}()

lazy var accountStorage: AccountStorage = {
return AccountStorage(defaults: .standard)
}()

lazy var registerService: RegisterService = {
return RegisterService(chatService: chatService)
}()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import UIKit

struct AppearanceConfigurator: Configurator {

func configure() {
let appearance = UINavigationBarAppearance()
appearance.backgroundColor = .w_background
appearance.shadowColor = .clear
appearance.titleTextAttributes = [
.foregroundColor: UIColor.w_foreground
]

UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
UINavigationBar.appearance().compactAppearance = appearance

UIApplication.currentWindow.overrideUserInterfaceStyle = .dark
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Combine

struct ApplicationConfigurator: Configurator {

private var publishers = Set<AnyCancellable>()

private let app: Application

init(app: Application) {
self.app = app
}

func configure() {
WelcomeModule.create(app: app).present()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
protocol Configurator {
func configure()
}

extension Array where Element == Configurator {
func configure() {
forEach { $0.configure() }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
struct MigrationConfigurator: Configurator {

let app: Application

init(app: Application) {
self.app = app
}

func configure() {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
struct ThirdPartyConfigurator: Configurator {

func configure() {

}
}
26 changes: 26 additions & 0 deletions Example/Showcase/Classes/ApplicationLayer/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import UIKit

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

private let app = Application()

private var configurators: [Configurator] {
return [
MigrationConfigurator(app: app),
ApplicationConfigurator(app: app),
AppearanceConfigurator(),
ThirdPartyConfigurator()
]
}

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = (scene as? UIWindowScene) else { return }

window = UIWindow(windowScene: windowScene)
window?.makeKeyAndVisible()

configurators.configure()
}
}
Loading