cleaned up some compiler warnings

pull/1222/head
James Sangalli 6 years ago
parent f14737c006
commit 594594da91
  1. 2
      AlphaWallet/AssetDefinition/DirectoryContentsWatcher.swift
  2. 1
      AlphaWallet/Browser/Coordinators/DappBrowserCoordinator.swift
  3. 2
      AlphaWallet/Browser/ViewControllers/DiscoverDappsViewController.swift
  4. 4
      AlphaWallet/Browser/ViewControllers/MyDappsViewController.swift
  5. 4
      AlphaWallet/Browser/Views/DappBrowserNavigationBar.swift
  6. 1
      AlphaWallet/Browser/Views/MyDappCell.swift
  7. 4
      AlphaWallet/Core/Initializers/MigrationInitializer.swift
  8. 2
      AlphaWallet/EtherClient/Wallet.swift
  9. 12
      AlphaWallet/Extensions/Date.swift
  10. 2
      AlphaWallet/InCoordinator.swift
  11. 27
      AlphaWallet/Market/Coordinators/UniversalLinkCoordinator.swift
  12. 2
      AlphaWallet/Tokens/Coordinators/ClaimOrderCoordinator.swift
  13. 2
      AlphaWallet/Tokens/Coordinators/GetERC721BalanceCoordinator.swift
  14. 1
      AlphaWallet/Tokens/Types/TokensDataStore.swift
  15. 2
      AlphaWallet/UI/ButtonsBar.swift
  16. 2
      AlphaWallet/UI/FloatLabelTextField.swift

@ -56,7 +56,7 @@ public protocol DirectoryContentsWatcherProtocol {
public extension DirectoryContentsWatcher {
// We don't necessary need the structure of a Local class within an enum as the "namespace", but just keeping it to be similar to the original codebase' structure
public final class Local: DirectoryContentsWatcherProtocol {
final class Local: DirectoryContentsWatcherProtocol {
private typealias CancelBlock = () -> Void
private enum State {

@ -558,7 +558,6 @@ extension DappBrowserCoordinator: DiscoverDappsViewControllerDelegate {
}
}
extension DappBrowserCoordinator: MyDappsViewControllerDelegate {
func didTapToEdit(dapp: Bookmark, inViewController viewController: MyDappsViewController) {
let vc = EditMyDappViewController()

@ -129,7 +129,7 @@ extension DiscoverDappsViewController: DiscoverDappCellDelegate {
}
}
fileprivate class SectionHeaderView: UIView {
private class SectionHeaderView: UIView {
private let label = UILabel()
var title: String {

@ -61,13 +61,13 @@ class MyDappsViewController: UIViewController {
}
@objc private func keyboardWillShow(notification: NSNotification) {
if let keyboardEndFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let keyboardBeginFrame = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
if let keyboardEndFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let _ = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
tableView.contentInset.bottom = keyboardEndFrame.size.height
}
}
@objc private func keyboardWillHide(notification: NSNotification) {
if let keyboardEndFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let keyboardBeginFrame = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
if let _ = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let _ = (notification.userInfo?[UIResponder.keyboardFrameBeginUserInfoKey] as? NSValue)?.cgRectValue {
tableView.contentInset.bottom = 0
}
}

@ -12,13 +12,13 @@ protocol DappBrowserNavigationBarDelegate: class {
func didTapClose(inNavigationBar navigationBar: DappBrowserNavigationBar)
}
fileprivate enum State {
private enum State {
case editingURLTextField
case notEditingURLTextField
case browserOnly
}
fileprivate struct Layout {
private struct Layout {
static let width: CGFloat = 34
static let moreButtonWidth: CGFloat = 24
}

@ -3,7 +3,6 @@
import Foundation
import UIKit
class MyDappCell: UITableViewCell {
static let identifier = "MyDappCell"

@ -21,7 +21,7 @@ class MigrationInitializer: Initializer {
if oldSchemaVersion < 2 {
//Fix bug created during multi-chain implementation. Where TokenObject instances are created from transfer Transaction instances, with the primaryKey as a empty string; so instead of updating an existing TokenObject, a duplicate TokenObject instead was created but with primaryKey empty
migration.enumerateObjects(ofType: TokenObject.className()) { oldObject, newObject in
guard let oldObject = oldObject else { return }
guard let _ = oldObject else { return }
guard let newObject = newObject else { return }
if let primaryKey = newObject["primaryKey"] as? String, primaryKey.isEmpty {
migration.delete(newObject)
@ -33,7 +33,7 @@ class MigrationInitializer: Initializer {
config.migrationBlock = { migration, oldSchemaVersion in
if oldSchemaVersion < 3 {
migration.enumerateObjects(ofType: Transaction.className()) { oldObject, newObject in
guard let oldObject = oldObject else { return }
guard let _ = oldObject else { return }
guard let newObject = newObject else { return }
newObject["isERC20Interaction"] = false
}

@ -8,7 +8,7 @@ enum WalletType: Equatable {
case watch(Address)
}
struct Wallet: Equatable {
struct Wallet: Equatable {
let type: WalletType
var address: Address {

@ -13,7 +13,7 @@ public extension Date {
private static var formatsMap: [String: DateFormatter] = [:]
private static var formatsMapLocale: String?
public init?(string: String, format: String) {
init?(string: String, format: String) {
let date = Date.formatter(with: format).date(from: string)
if date != nil {
self = date!
@ -22,11 +22,11 @@ public extension Date {
return nil
}
public func format(_ format: String, withTimeZone timezone: TimeZone? = nil) -> String {
func format(_ format: String, withTimeZone timezone: TimeZone? = nil) -> String {
return Date.formatter(with: format, withTimeZone: timezone).string(from: self)
}
public static func formatter(with format: String, withTimeZone timeZone: TimeZone? = nil) -> DateFormatter {
static func formatter(with format: String, withTimeZone timeZone: TimeZone? = nil) -> DateFormatter {
if Config.getLocale() != formatsMapLocale {
formatsMapLocale = Config.getLocale()
formatsMap = Dictionary()
@ -49,15 +49,15 @@ public extension Date {
return foundFormatter!
}
public static var yesterday: Date {
static var yesterday: Date {
return Calendar.current.date(byAdding: .day, value: -1, to: Date())!
}
public static var tomorrow: Date {
static var tomorrow: Date {
return Calendar.current.date(byAdding: .day, value: 1, to: Date())!
}
public func formatAsShortDateString(withTimezone timezone: TimeZone? = nil) -> String {
func formatAsShortDateString(withTimezone timezone: TimeZone? = nil) -> String {
return format("dd MMM yyyy", withTimeZone: timezone)
}
}

@ -687,7 +687,7 @@ extension InCoordinator: PromptBackupCoordinatorDelegate {
}
}
extension InCoordinator: DappBrowserCoordinatorDelegate{
extension InCoordinator: DappBrowserCoordinatorDelegate {
func didSentTransaction(transaction: SentTransaction, inCoordinator coordinator: DappBrowserCoordinator) {
handlePendingTransaction(transaction: transaction)
}

@ -166,24 +166,23 @@ class UniversalLinkCoordinator: Coordinator {
let parameters: Parameters
let query: String
switch signedOrder.order.nativeCurrencyDrop {
case true:
parameters = createHTTPParametersForCurrencyLinksToPaymentServer(
signedOrder: signedOrder,
recipient: recipient
)
query = Constants.currencyDropServer
case false:
parameters = createHTTPParametersForNormalLinksToPaymentServer(
signedOrder: signedOrder,
isForTransfer: true
)
query = Constants.paymentServer
case true:
parameters = createHTTPParametersForCurrencyLinksToPaymentServer(
signedOrder: signedOrder,
recipient: recipient
)
query = Constants.currencyDropServer
case false:
parameters = createHTTPParametersForNormalLinksToPaymentServer(
signedOrder: signedOrder,
isForTransfer: true
)
query = Constants.paymentServer
}
return (parameters, query)
}
func completeOrderHandling(signedOrder: SignedOrder)
{
func completeOrderHandling(signedOrder: SignedOrder) {
let requiresPaymaster = requiresPaymasterForCurrencyLinks(signedOrder: signedOrder)
if signedOrder.order.price == 0 {
self.checkPaymentServerSupportsContract(contractAddress: signedOrder.order.contractAddress) { supported in

@ -78,7 +78,7 @@ class ClaimOrderCoordinator {
completion: @escaping (Result<Data, AnyError>) -> Void) {
do {
let parameters: [Any] = [expiry, tokenIds, BigUInt(v), Data(hex: r), Data(hex: s), Address(string: recipient)]
let parameters: [Any] = [expiry, tokenIds, BigUInt(v), Data(hex: r), Data(hex: s), Address(string: recipient) as Any]
let functionEncoder = Function(name: "spawnPassTo", parameters: [
.uint(bits: 256),
.dynamicArray(.uint(bits: 256)),

@ -22,7 +22,7 @@ class GetERC721BalanceCoordinator {
) {
let function = GetERC721Balance()
callSmartContract(withServer: server, contract: contract, functionName: function.name, abiString: function.abi, parameters: [address.eip55String] as [AnyObject]).done { balanceResult in
let balance = self.adapt(balanceResult["0"])
let balance = self.adapt(balanceResult["0"] as Any)
completion(.success(balance))
}.catch { error in
completion(.failure(AnyError(Web3Error(description: "Error extracting result from \(contract.eip55String).\(function.name)(): \(error)"))))

@ -260,7 +260,6 @@ class TokensDataStore {
}
}
func getERC875Balance(for addressString: String,
completion: @escaping (ResultResult<[String], AnyError>.t) -> Void) {
let address = Address(string: addressString)

@ -54,7 +54,7 @@ class ButtonsBar: UIView {
}
}
fileprivate struct ButtonsBarViewModel {
private struct ButtonsBarViewModel {
var buttonBackgroundColor: UIColor {
return Colors.appActionButtonGreen
}

@ -18,7 +18,7 @@ import Eureka
}
}
set {
accessibilityLabel = newValue
self.accessibilityLabel = newValue
}
}

Loading…
Cancel
Save