-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathInt64Row.swift
44 lines (37 loc) · 1.16 KB
/
Int64Row.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import Foundation
import Eureka
import UIKit
extension Int64: InputTypeInitiable {
public init?(string stringValue: String) {
self.init(stringValue, radix: 10)
}
}
open class Int64Cell: _FieldCell<Int64>, CellType {
required public init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
}
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
open override func setup() {
super.setup()
textField.autocorrectionType = .default
textField.autocapitalizationType = .none
textField.keyboardType = .numberPad
}
}
class _Int64Row: FieldRow<Int64Cell> { //swiftlint:disable:this type_name
required init(tag: String?) {
super.init(tag: tag)
let numberFormatter = NumberFormatter()
numberFormatter.locale = Locale.current
numberFormatter.numberStyle = .decimal
numberFormatter.minimumFractionDigits = 0
formatter = numberFormatter
}
}
final class Int64Row: _Int64Row, RowType {
required init(tag: String?) {
super.init(tag: tag)
}
}