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

hyperwallet / hyperwallet-ios-ui-sdk / 15917870960

27 Jun 2025 04:02AM UTC coverage: 95.207%. Remained the same
15917870960

push

github

grmeyer-hw-dev
Ignore Cartfile.resolved

2304 of 2420 relevant lines covered (95.21%)

17.06 hits per line

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

23.53
/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
3✔
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

×
39
        case "UPDATE_BUTTON":
×
40
            return nil
×
41

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

47
    var errorMessage: String?
48

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

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

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

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

70
    func reset() {
×
71
        containsFocusedField = false
×
72
        fieldToBeFocused = nil
×
73
        rowShouldBeScrolledTo = nil
×
74
    }
×
75
}
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