Skip to content

Commit 0a1e58e

Browse files
Update tab to 4 spaces
1 parent e13fc35 commit 0a1e58e

File tree

165 files changed

+14500
-14500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+14500
-14500
lines changed

Adamant/AppDelegate.swift

Lines changed: 296 additions & 296 deletions
Large diffs are not rendered by default.

Adamant/Helpers/AdamantError.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@
99
import Foundation
1010

1111
struct AdamantError: Error, CustomStringConvertible {
12-
public let message: String
13-
public let internalError: Error?
14-
15-
init(message: String, error: Error? = nil) {
16-
self.message = message
17-
self.internalError = error
18-
}
19-
20-
// MARK: CustomStringConvertible
21-
public var description: String {
22-
return message
23-
}
12+
public let message: String
13+
public let internalError: Error?
14+
15+
init(message: String, error: Error? = nil) {
16+
self.message = message
17+
self.internalError = error
18+
}
19+
20+
// MARK: CustomStringConvertible
21+
public var description: String {
22+
return message
23+
}
2424
}

Adamant/Helpers/AdamantUserInfoKey.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
import Foundation
1010

1111
struct AdamantUserInfoKey {
12-
private init() {}
12+
private init() {}
1313
}

Adamant/Helpers/AddressValidationResult.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
enum AddressValidationResult {
12-
case valid
13-
case system
14-
case invalid
12+
case valid
13+
case system
14+
case invalid
1515
}

Adamant/Helpers/BigInt+Decimal.swift

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,25 @@ import Foundation
1010
import BigInt
1111

1212
extension BigInt {
13-
func asDecimal(exponent: Int) -> Decimal {
14-
let decim = Decimal(floatLiteral: Double(self))
15-
16-
if exponent != 0 {
17-
return Decimal(sign: decim.sign, exponent: exponent, significand: decim)
18-
} else {
19-
return decim
20-
}
21-
}
13+
func asDecimal(exponent: Int) -> Decimal {
14+
let decim = Decimal(floatLiteral: Double(self))
15+
16+
if exponent != 0 {
17+
return Decimal(sign: decim.sign, exponent: exponent, significand: decim)
18+
} else {
19+
return decim
20+
}
21+
}
2222
}
2323

2424
extension BigUInt {
25-
func asDecimal(exponent: Int) -> Decimal {
26-
let decim = Decimal(floatLiteral: Double(self))
27-
28-
if exponent != 0 {
29-
return Decimal(sign: .plus, exponent: exponent, significand: decim)
30-
} else {
31-
return decim
32-
}
33-
}
25+
func asDecimal(exponent: Int) -> Decimal {
26+
let decim = Decimal(floatLiteral: Double(self))
27+
28+
if exponent != 0 {
29+
return Decimal(sign: .plus, exponent: exponent, significand: decim)
30+
} else {
31+
return decim
32+
}
33+
}
3434
}

Adamant/Helpers/Comparable+clamped.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
import Foundation
1010

1111
extension Comparable {
12-
func clamped(min: Self, max: Self) -> Self {
13-
if self < min {
14-
return min
15-
}
16-
17-
if self > max {
18-
return max
19-
}
20-
21-
return self
22-
}
12+
func clamped(min: Self, max: Self) -> Self {
13+
if self < min {
14+
return min
15+
}
16+
17+
if self > max {
18+
return max
19+
}
20+
21+
return self
22+
}
2323
}

Adamant/Helpers/MyLittlePinpad+adamant.swift

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,70 @@ import Foundation
1010
import MyLittlePinpad
1111

1212
extension String.adamantLocalized {
13-
struct pinpad {
14-
static let createPin = NSLocalizedString("Pinpad.EnterNewPin", comment: "Pinpad: Ask user to create new pin")
15-
static let reenterPin = NSLocalizedString("Pinpad.ReenterPin", comment: "Pinpad: Ask user to repeat new pin")
16-
}
13+
struct pinpad {
14+
static let createPin = NSLocalizedString("Pinpad.EnterNewPin", comment: "Pinpad: Ask user to create new pin")
15+
static let reenterPin = NSLocalizedString("Pinpad.ReenterPin", comment: "Pinpad: Ask user to repeat new pin")
16+
}
1717
}
1818

1919
extension PinpadBiometryButtonType {
20-
var localAuthType: BiometryType {
21-
switch self {
22-
case .hidden:
23-
return .none
24-
25-
case .faceID:
26-
return .faceID
27-
28-
case .touchID:
29-
return .touchID
30-
}
31-
}
20+
var localAuthType: BiometryType {
21+
switch self {
22+
case .hidden:
23+
return .none
24+
25+
case .faceID:
26+
return .faceID
27+
28+
case .touchID:
29+
return .touchID
30+
}
31+
}
3232
}
3333

3434
extension BiometryType {
35-
var pinpadButtonType: PinpadBiometryButtonType {
36-
switch self {
37-
case .none:
38-
return .hidden
39-
40-
case .faceID:
41-
return .faceID
42-
43-
case .touchID:
44-
return .touchID
45-
}
46-
}
35+
var pinpadButtonType: PinpadBiometryButtonType {
36+
switch self {
37+
case .none:
38+
return .hidden
39+
40+
case .faceID:
41+
return .faceID
42+
43+
case .touchID:
44+
return .touchID
45+
}
46+
}
4747
}
4848

4949
extension PinpadViewController {
5050
static func adamantPinpad(biometryButton: PinpadBiometryButtonType) -> PinpadViewController {
51-
let pinpad = PinpadViewController.instantiateFromResourceNib()
52-
53-
pinpad.bordersColor = UIColor.adamant.secondary
54-
pinpad.setColor(UIColor.adamant.primary, for: .normal)
55-
pinpad.buttonsHighlightedColor = UIColor.adamant.pinpadHighlightButton
56-
pinpad.buttonsFont = UIFont.adamantPrimary(ofSize: pinpad.buttonsFont.pointSize, weight: .light)
57-
58-
pinpad.placeholdersSize = 15
59-
60-
if pinpad.view.frame.height > 600 {
61-
pinpad.buttonsSize = 75
62-
pinpad.buttonsSpacing = 20
63-
pinpad.placeholderViewHeight = 50
64-
} else {// iPhone 5
65-
pinpad.buttonsSize = 70
66-
pinpad.buttonsSpacing = 15
67-
pinpad.placeholderViewHeight = 25
68-
pinpad.bottomSpacing = 24
69-
pinpad.pinpadToCancelSpacing = 14
70-
}
71-
72-
pinpad.placeholderActiveColor = UIColor.adamant.pinpadHighlightButton
73-
pinpad.biometryButtonType = biometryButton
74-
pinpad.cancelButton.setTitle(String.adamantLocalized.alert.cancel, for: .normal)
75-
pinpad.pinDigits = 6
51+
let pinpad = PinpadViewController.instantiateFromResourceNib()
52+
53+
pinpad.bordersColor = UIColor.adamant.secondary
54+
pinpad.setColor(UIColor.adamant.primary, for: .normal)
55+
pinpad.buttonsHighlightedColor = UIColor.adamant.pinpadHighlightButton
56+
pinpad.buttonsFont = UIFont.adamantPrimary(ofSize: pinpad.buttonsFont.pointSize, weight: .light)
57+
58+
pinpad.placeholdersSize = 15
59+
60+
if pinpad.view.frame.height > 600 {
61+
pinpad.buttonsSize = 75
62+
pinpad.buttonsSpacing = 20
63+
pinpad.placeholderViewHeight = 50
64+
} else {// iPhone 5
65+
pinpad.buttonsSize = 70
66+
pinpad.buttonsSpacing = 15
67+
pinpad.placeholderViewHeight = 25
68+
pinpad.bottomSpacing = 24
69+
pinpad.pinpadToCancelSpacing = 14
70+
}
71+
72+
pinpad.placeholderActiveColor = UIColor.adamant.pinpadHighlightButton
73+
pinpad.biometryButtonType = biometryButton
74+
pinpad.cancelButton.setTitle(String.adamantLocalized.alert.cancel, for: .normal)
75+
pinpad.pinDigits = 6
7676

77-
return pinpad
78-
}
77+
return pinpad
78+
}
7979
}

Adamant/Helpers/NSRegularExpression+adamant.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Foundation
1010

1111
extension NSRegularExpression {
12-
func perfectMatch(with string: String) -> Bool {
13-
return matches(in: string, options: [], range: NSRange(location: 0, length: string.count)).count == 1
14-
}
12+
func perfectMatch(with string: String) -> Bool {
13+
return matches(in: string, options: [], range: NSRange(location: 0, length: string.count)).count == 1
14+
}
1515
}

Adamant/Helpers/QRCodeReader+adamant.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ import Foundation
1010
import QRCodeReader
1111

1212
extension QRCodeReaderViewController {
13-
static func adamantQrCodeReader() -> QRCodeReaderViewController {
14-
let builder = QRCodeReaderViewControllerBuilder {
15-
$0.reader = QRCodeReader(metadataObjectTypes: [.qr ], captureDevicePosition: .back)
16-
$0.cancelButtonTitle = String.adamantLocalized.alert.cancel
17-
$0.showSwitchCameraButton = false
18-
}
19-
20-
return QRCodeReaderViewController(builder: builder)
21-
}
13+
static func adamantQrCodeReader() -> QRCodeReaderViewController {
14+
let builder = QRCodeReaderViewControllerBuilder {
15+
$0.reader = QRCodeReader(metadataObjectTypes: [.qr ], captureDevicePosition: .back)
16+
$0.cancelButtonTitle = String.adamantLocalized.alert.cancel
17+
$0.showSwitchCameraButton = false
18+
}
19+
20+
return QRCodeReaderViewController(builder: builder)
21+
}
2222
}

Adamant/Helpers/UIFont+adamant.swift

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@
99
import UIKit
1010

1111
extension UIFont {
12-
static func adamantPrimary(ofSize size: CGFloat) -> UIFont {
13-
return UIFont(name: "Exo 2", size: size)!
14-
}
15-
16-
static func adamantPrimary(ofSize size: CGFloat, weight: UIFont.Weight) -> UIFont {
17-
let name: String
18-
19-
switch weight {
20-
case UIFont.Weight.bold:
21-
name = "Exo 2 Bold"
22-
23-
case UIFont.Weight.medium:
24-
name = "Exo 2 Medium"
25-
26-
case UIFont.Weight.thin:
27-
name = "Exo 2 Thin"
28-
29-
case UIFont.Weight.light:
30-
name = "Exo 2 Light"
31-
32-
default:
33-
name = "Exo 2"
34-
}
35-
36-
return UIFont(name: name, size: size)!
37-
}
38-
39-
static var adamantChatDefault = UIFont.systemFont(ofSize: 17)
12+
static func adamantPrimary(ofSize size: CGFloat) -> UIFont {
13+
return UIFont(name: "Exo 2", size: size)!
14+
}
15+
16+
static func adamantPrimary(ofSize size: CGFloat, weight: UIFont.Weight) -> UIFont {
17+
let name: String
18+
19+
switch weight {
20+
case UIFont.Weight.bold:
21+
name = "Exo 2 Bold"
22+
23+
case UIFont.Weight.medium:
24+
name = "Exo 2 Medium"
25+
26+
case UIFont.Weight.thin:
27+
name = "Exo 2 Thin"
28+
29+
case UIFont.Weight.light:
30+
name = "Exo 2 Light"
31+
32+
default:
33+
name = "Exo 2"
34+
}
35+
36+
return UIFont(name: name, size: size)!
37+
}
38+
39+
static var adamantChatDefault = UIFont.systemFont(ofSize: 17)
4040
}

0 commit comments

Comments
 (0)