• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperwallet / hyperwallet-ios-ui-sdk / 4735069856

pending completion
4735069856

push

github

Gustavo Meyer
DTPOMERSER-84 - Address swift lint

2255 of 2353 relevant lines covered (95.84%)

17.89 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

21.88
/TransferMethod/Sources/UpdateTransferMethodSectionData.swift
1
//
2
// Copyright 2018 - Present Hyperwallet
3
//
4
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5
// and associated documentation files (the "Software"), to deal in the Software without restriction,
6
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
7
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in all copies or
11
// substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
14
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18

19
import HyperwalletSDK
20
import UIKit
21

22
final class UpdateTransferMethodSectionData {
23
    var fieldGroup: String
24
    var country: String?
25
    var currency: String?
26

27
    var containsFocusedField = false
28
    var fieldToBeFocused: AbstractWidget?
29
    var rowShouldBeScrolledTo: Int?
30

31
    lazy var header: String? = {
×
32
        switch fieldGroup {
×
33
        case "ACCOUNT_INFORMATION":
×
34
            let format = "\(fieldGroup)".lowercased().localized()
×
35
            return String(format: format,
×
36
                          Locale.current.localizedString(forRegionCode: country ?? "") ?? "",
×
37
                          currency ?? "").uppercased()
×
38
        case "UPDATE_BUTTON":
×
39
            return nil
×
40

×
41
        default:
×
42
            return "\(fieldGroup)".lowercased().localized().uppercased()
×
43
        }
×
44
    }()
×
45

46
    var errorMessage: String?
47

48
    var cells: [UIView] = []
3✔
49

50
    var count: Int {
×
51
        return cells.count
×
52
    }
×
53

54
    init(fieldGroup: String,
55
         country: String? = nil,
56
         currency: String? = nil,
57
         cells: [UIView]
58
        ) {
3✔
59
        self.fieldGroup = fieldGroup
3✔
60
        self.cells = cells
3✔
61
        self.currency = currency
3✔
62
        self.country = country
3✔
63
    }
3✔
64

65
    subscript(index: Int) -> UIView {
×
66
        return cells[index]
×
67
    }
×
68

69
    func reset() {
×
70
        containsFocusedField = false
×
71
        fieldToBeFocused = nil
×
72
        rowShouldBeScrolledTo = nil
×
73
    }
×
74
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc