Skip to content

Commit

Permalink
Merge pull request #1281 from WalletConnect/just-works-fix
Browse files Browse the repository at this point in the history
Just works
  • Loading branch information
llbartekll authored Jan 26, 2024
2 parents bd88354 + 2dce12f commit 6504bdf
Show file tree
Hide file tree
Showing 99 changed files with 1,498 additions and 982 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WalletConnectSignTests"
BuildableName = "WalletConnectSignTests"
BlueprintName = "WalletConnectSignTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1520"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "WalletConnectUtilsTests"
BuildableName = "WalletConnectUtilsTests"
BlueprintName = "WalletConnectUtilsTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
1 change: 0 additions & 1 deletion Example/DApp/ApplicationLayer/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ import WalletConnectUtils

final class Application {
var uri: WalletConnectURI?
var requestSent = false
}
42 changes: 42 additions & 0 deletions Example/DApp/Common/ActivityIndicatorManager.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import UIKit

class ActivityIndicatorManager {
static let shared = ActivityIndicatorManager()
private var activityIndicator: UIActivityIndicatorView?
private let serialQueue = DispatchQueue(label: "com.yourapp.activityIndicatorManager")

private init() {}

func start() {
serialQueue.async {
self.stopInternal()

DispatchQueue.main.async {
guard let windowScene = UIApplication.shared.connectedScenes.first as? UIWindowScene,
let window = windowScene.windows.first(where: { $0.isKeyWindow }) else { return }

let activityIndicator = UIActivityIndicatorView(style: .large)
activityIndicator.center = window.center
activityIndicator.color = .white
activityIndicator.startAnimating()
window.addSubview(activityIndicator)

self.activityIndicator = activityIndicator
}
}
}

func stop() {
serialQueue.async {
self.stopInternal()
}
}

private func stopInternal() {
DispatchQueue.main.sync {
self.activityIndicator?.stopAnimating()
self.activityIndicator?.removeFromSuperview()
self.activityIndicator = nil
}
}
}
35 changes: 35 additions & 0 deletions Example/DApp/Common/AlertPresenter.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import Foundation
import SwiftMessages
import UIKit

struct AlertPresenter {
enum MessageType {
case warning
case error
case info
case success
}

static func present(message: String, type: AlertPresenter.MessageType) {
DispatchQueue.main.async {
let view = MessageView.viewFromNib(layout: .cardView)
switch type {
case .warning:
view.configureTheme(.warning, iconStyle: .subtle)
case .error:
view.configureTheme(.error, iconStyle: .subtle)
case .info:
view.configureTheme(.info, iconStyle: .subtle)
case .success:
view.configureTheme(.success, iconStyle: .subtle)
}
view.button?.isHidden = true
view.layoutMarginAdditions = UIEdgeInsets(top: 20, left: 20, bottom: 20, right: 20)
view.configureContent(title: "", body: message)
var config = SwiftMessages.Config()
config.presentationStyle = .top
config.duration = .seconds(seconds: 1.5)
SwiftMessages.show(config: config, view: view)
}
}
}
3 changes: 0 additions & 3 deletions Example/DApp/Modules/Auth/AuthInteractor.swift

This file was deleted.

16 changes: 0 additions & 16 deletions Example/DApp/Modules/Auth/AuthModule.swift

This file was deleted.

116 changes: 0 additions & 116 deletions Example/DApp/Modules/Auth/AuthPresenter.swift

This file was deleted.

16 changes: 0 additions & 16 deletions Example/DApp/Modules/Auth/AuthRouter.swift

This file was deleted.

Loading

0 comments on commit 6504bdf

Please sign in to comment.