|
|
@ -21,7 +21,6 @@ class KycForm3ViewController: UIViewController { |
|
|
|
|
|
|
|
// MARK: IBOutlets |
|
|
|
|
|
|
|
|
|
|
|
// MARK: Properties |
|
|
|
|
|
|
|
var presenter: KycForm3ModuleInterface? |
|
|
@ -65,52 +64,27 @@ class KycForm3ViewController: UIViewController { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Residue of the old developer. i just make it workable. I dont have time to remake it all. you can use git histry or "tig" to go back and see what a mess your are. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func showSample(type: PictureType, titleString: String) { |
|
|
|
var imageToShow: UIImage! |
|
|
|
var imageView: UIImageView! |
|
|
|
var vertical_spacing: String! |
|
|
|
var imageHeightConstraint: CGFloat! |
|
|
|
var imageWidthConstraint: CGFloat! |
|
|
|
let image: UIImage? |
|
|
|
switch type { |
|
|
|
case .selfie: |
|
|
|
|
|
|
|
imageView = UIImageView(image: #imageLiteral(resourceName: "sampleSelfie")) |
|
|
|
vertical_spacing = String(repeating: "\n", count: 15) |
|
|
|
imageHeightConstraint = imageToShow.size.height * 0.825 |
|
|
|
imageWidthConstraint = imageToShow.size.width * 0.825 |
|
|
|
image = #imageLiteral(resourceName: "sampleSelfie") |
|
|
|
case .front: |
|
|
|
imageView = UIImageView(image: #imageLiteral(resourceName: "sampleFront")) |
|
|
|
vertical_spacing = String(repeating: "\n", count: 10) |
|
|
|
imageHeightConstraint = imageToShow.size.height * 0.9 |
|
|
|
imageWidthConstraint = imageToShow.size.width * 0.9 |
|
|
|
image = #imageLiteral(resourceName: "sampleFront") |
|
|
|
case .back: |
|
|
|
imageView = UIImageView(image: #imageLiteral(resourceName: "sampleBack")) |
|
|
|
vertical_spacing = String(repeating: "\n", count: 10) |
|
|
|
imageHeightConstraint = imageToShow.size.height * 0.9 //initially 150 |
|
|
|
imageWidthConstraint = imageToShow.size.width * 0.9 //initially 200 |
|
|
|
image = #imageLiteral(resourceName: "sampleBack") |
|
|
|
case .passbook: |
|
|
|
imageView = UIImageView(image: #imageLiteral(resourceName: "samplePassbook")) |
|
|
|
vertical_spacing = String(repeating: "\n", count: 12) |
|
|
|
imageHeightConstraint = imageToShow.size.height * 1.2 //initially 150 |
|
|
|
imageWidthConstraint = imageToShow.size.width * 1.2 //initially 200 |
|
|
|
image = #imageLiteral(resourceName: "sampleBack") |
|
|
|
case .passport: |
|
|
|
imageView = UIImageView(image: #imageLiteral(resourceName: "samplePassport")) |
|
|
|
vertical_spacing = String(repeating: "\n", count: 12) |
|
|
|
imageHeightConstraint = imageToShow.size.height * 1.2 //initially 150 |
|
|
|
imageWidthConstraint = imageToShow.size.width * 1.2 //initially 200 |
|
|
|
image = #imageLiteral(resourceName: "sampleBack") |
|
|
|
} |
|
|
|
|
|
|
|
let alert = UIAlertController(title: titleString, message: vertical_spacing, preferredStyle: .alert) |
|
|
|
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) |
|
|
|
|
|
|
|
alert.view.addSubview(imageView) |
|
|
|
imageView.translatesAutoresizingMaskIntoConstraints = false |
|
|
|
alert.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .centerX, relatedBy: .equal, toItem: alert.view, attribute: .centerX, multiplier: 1, constant: 0)) |
|
|
|
alert.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .centerY, relatedBy: .equal, toItem: alert.view, attribute: .centerY, multiplier: 1, constant: 0)) |
|
|
|
alert.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: imageWidthConstraint)) |
|
|
|
alert.view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: imageHeightConstraint)) |
|
|
|
alert.view.tintColor = UIColor(hex: 0xEC1C24) |
|
|
|
self.present(alert, animated: true, completion: nil) |
|
|
|
// show alert |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|