-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀[Release v3.10.0] Merge into Main (#136)
* 🦺[Techdebt] fix firebase (#115) * Update firebase config auto clean up strings - version bump - Commented out debug FB file * Checked the version is sending FB data - bump build number * 🥳[Techdebt] relayout address view controller (#120) * Successfully placed in UIHosting Address Updated the strings file * Added event * added delay - used for animating U Domain * Added function of subviews in SendViewController Layout is updated * Adding the function to the send Cleaned up and wired up Cells - UD View/Model - Send Address View/Model Reset the amount Label in SendViewController * Refactored SendButton - Using UIHostingViewController * Successfully send LTC -WIP: fix white space * Refactored the layout of the send button * buiid bump (#125) * [Techdebt] ci cd refactor (#132) * Removed flaky tests * build bump * build bump * removed unused file - build bump * build bump * fixed scan QR (#130) * fixed scan QR * update gitignore * Feature/add bitrefill new (#134) * Added llocalView - added bitrefill - basic function is available - build bump * bump * added basic web widget * updated logo * build bump * changed the Bitrefill link - build bump * pre-bump version - to get a binary to TestFlight * build bump * build bump again * Clean up background * build bump
- Loading branch information
Showing
16 changed files
with
283 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+6.44 KB
loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill-logo-app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-31.4 KB
loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@1x.png
Binary file not shown.
Binary file removed
BIN
-31.4 KB
loafwallet/Assets.xcassets/Partners/bitrefillLogo.imageset/bitrefill@3x.png
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// | ||
// LocalWebView.swift | ||
// loafwallet | ||
// | ||
// Created by Kerry Washington on 10/8/22. | ||
// Copyright © 2022 Litecoin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
import SwiftUI | ||
import WebKit | ||
import Combine | ||
|
||
// MARK: - WebViewHandlerDelegate | ||
protocol WebViewHandlerDelegate { | ||
} | ||
|
||
struct LocalWebView: UIViewRepresentable, WebViewHandlerDelegate { | ||
|
||
@ObservedObject | ||
var viewModel: LocalWebViewModel | ||
|
||
func makeCoordinator() -> Coordinator { | ||
Coordinator(self) | ||
} | ||
|
||
func makeUIView(context: Context) -> WKWebView { | ||
|
||
let preferences = WKPreferences() | ||
preferences.javaScriptCanOpenWindowsAutomatically = true | ||
|
||
let configuration = WKWebViewConfiguration() | ||
configuration.preferences = preferences | ||
|
||
let webView = WKWebView(frame: CGRect.zero, configuration: configuration) | ||
webView.navigationDelegate = context.coordinator | ||
webView.allowsBackForwardNavigationGestures = false | ||
webView.scrollView.isScrollEnabled = true | ||
return webView | ||
} | ||
|
||
func updateUIView(_ webView: WKWebView, context: Context) { | ||
|
||
if let url = Bundle.main.url(forResource: "bitrefill_index", withExtension: "html") { | ||
webView.loadFileURL(url, allowingReadAccessTo: url.deletingLastPathComponent()) | ||
} else { | ||
NSLog("ERROR: Local html not found") | ||
} | ||
} | ||
|
||
class Coordinator : NSObject, WKNavigationDelegate { | ||
var parent: LocalWebView | ||
var delegate: WebViewHandlerDelegate? | ||
var valueSubscriber: AnyCancellable? = nil | ||
var webViewNavigationSubscriber: AnyCancellable? = nil | ||
|
||
init(_ uiWebView: LocalWebView) { | ||
self.parent = uiWebView | ||
self.delegate = parent | ||
} | ||
|
||
deinit { | ||
valueSubscriber?.cancel() | ||
webViewNavigationSubscriber?.cancel() | ||
} | ||
|
||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | ||
|
||
self.parent.viewModel.showLoader.send(false) | ||
} | ||
|
||
//MARK: WKWebView's delegate functions | ||
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) { | ||
// Hides loader | ||
parent.viewModel.showLoader.send(false) | ||
} | ||
|
||
func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { | ||
// Shows loader | ||
parent.viewModel.showLoader.send(true) | ||
} | ||
|
||
func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { | ||
// Shows loader | ||
parent.viewModel.showLoader.send(true) | ||
} | ||
|
||
} | ||
} | ||
|
||
// MARK: - Extensions | ||
extension LocalWebView.Coordinator: WKScriptMessageHandler { | ||
func userContentController(_ userContentController: WKUserContentController, | ||
didReceive message: WKScriptMessage) { | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// LocalWebViewModel.swift | ||
// loafwallet | ||
|
||
import Foundation | ||
import Combine | ||
|
||
class LocalWebViewModel: ObservableObject { | ||
|
||
var showLoader = PassthroughSubject<Bool, Never>() | ||
var valuePublisher = PassthroughSubject<String, Never>() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.