-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecieptView.swift
69 lines (48 loc) · 1.7 KB
/
RecieptView.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// RecieptView.swift
// SayanInAppPayment
//
// Created by Amir on 8/28/1397 AP.
// Copyright © 1397 Sayan. All rights reserved.
//
import UIKit
class RecieptView: UIView {
var contentView: UIView!
var paymentEnqueryRes : PaymentEnqueryRes?
@IBOutlet weak var Amoun: UILabel!
@IBOutlet weak var CardAcqId: UILabel!
@IBOutlet weak var TerminalId: UILabel!
@IBOutlet weak var Rrn: UILabel!
@IBOutlet weak var Trace: UILabel!
@IBOutlet weak var TransDate: UILabel!
override init(frame: CGRect) {
// For use in code
super.init(frame: frame)
}
convenience init(frame: CGRect,model : PaymentEnqueryRes) {
self.init(frame: frame)
commonInit()
self.tag = 981
self.Amoun.text = model.Amount.Seperate()
self.CardAcqId.text = model.CardAcqId
self.TerminalId.text = model.TerminalId
self.Rrn.text = model.RetrivalRefNo
self.Trace.text = model.SystemTraceNo
self.TransDate.text = model.PersianTransactionDate
self.paymentEnqueryRes = model
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
@IBAction func CompeleteBtn(_ sender: UIButton) {
self.superview?.removeFromSuperview()
}
func commonInit(){
let bundle = Bundle(for: type(of: self))
let nib = UINib(nibName: "Reciept", bundle: bundle)
self.contentView = nib.instantiate(withOwner: self, options: nil).first as! UIView
self.contentView.frame = self.bounds
self.contentView.bounds = self.bounds
addSubview(contentView)
}
}