-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ask_ChildView_Searching.swift
82 lines (60 loc) · 2.45 KB
/
Ask_ChildView_Searching.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
70
71
72
73
74
75
//
// Ask_ParentViewController.swift
// roop
//
// Created by 이천지 on 2016. 12. 23..
// Copyright © 2016년 project. All rights reserved.
//
import UIKit
import Alamofire
import AlamofireImage
class Ask_ChildView_Searching: UIViewController {
@IBOutlet weak var photoImageView: UIImageView!
@IBOutlet weak var profileImageView: UIImageView!
@IBOutlet weak var userName: UILabel!
@IBOutlet weak var userEmail: UILabel!
@IBOutlet weak var userDescription: UILabel!
@IBOutlet weak var userSize: UILabel!
@IBOutlet weak var userColor: UILabel!
@IBOutlet weak var userGender: UILabel!
@IBOutlet weak var photoConstraints: NSLayoutConstraint!
var passDataInfo = CardViewData()
override func viewDidLoad() {
let pixelHeight = (self.passDataInfo.pixel?["h"] as! NSString).integerValue
let pixelWidth = (self.passDataInfo.pixel?["w"] as! NSString).integerValue
print("===================")
print(pixelHeight)
print(pixelWidth)
let widthRatio = UIScreen.main.bounds.width / CGFloat(pixelWidth)
photoConstraints.constant = CGFloat(CGFloat(pixelHeight) * widthRatio)
let radius = profileImageView.frame.size.height / 2
profileImageView.layer.cornerRadius = radius
profileImageView.layer.masksToBounds = false
Alamofire.request("http://www.roop.xyz\(passDataInfo.cardPhotoAddress!)").responseImage { response in
debugPrint(response)
if let image = response.result.value {
self.photoImageView.image = image
}
}
Alamofire.request("https:\(passDataInfo.profilePhotoAddress!)").responseImage { response in
debugPrint(response)
if let image = response.result.value {
self.profileImageView.image = image
}
}
userName.text = passDataInfo.userName
userEmail.text = passDataInfo.email!
if(passDataInfo.description != nil){
userDescription.text = passDataInfo.description
}
if(passDataInfo.userSize != nil){
userSize.text = passDataInfo.userSize
}
if(passDataInfo.userColor != nil){
userColor.text = passDataInfo.userColor
}
if(passDataInfo.userGender != nil){
userGender.text = passDataInfo.userGender
}
}
}