-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeadProspect.swift
84 lines (68 loc) · 2.63 KB
/
DeadProspect.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
76
77
78
79
80
81
82
83
84
//
// DeadProspect.swift
// PreSales-Huddle
//
// Created by Himanshu Phirke on 31/08/15.
// Copyright (c) 2015 synerzip. All rights reserved.
//
import UIKit
class DeadProspect: UIViewController, UITextFieldDelegate, UITextViewDelegate {
var itemToView: [String: AnyObject]?
@IBOutlet weak var technology: UITextField!
@IBOutlet weak var name: UITextField!
@IBOutlet weak var salesID: UITextField!
@IBOutlet weak var notes: UITextView!
@IBOutlet weak var domain: UITextField!
override func viewDidLoad() {
addLabels()
if let item = itemToView {
showData(item)
}
}
private func addLabels() {
let technologyLabel = UILabel(frame: CGRectZero)
technologyLabel.font = UIFont.systemFontOfSize(12)
technologyLabel.text = " Technology "
technologyLabel.sizeToFit()
technologyLabel.textColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 0.50)
technology.leftViewMode = UITextFieldViewMode.Always
technology.leftView = technologyLabel
let nameLabel = UILabel(frame: CGRectZero)
nameLabel.font = UIFont.systemFontOfSize(12)
nameLabel.text = " Name "
nameLabel.sizeToFit()
nameLabel.textColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 0.50)
name.leftViewMode = UITextFieldViewMode.Always
name.leftView = nameLabel
let salesIDLabel = UILabel(frame: CGRectZero)
salesIDLabel.font = UIFont.systemFontOfSize(12)
salesIDLabel.text = " Sales "
salesIDLabel.sizeToFit()
salesIDLabel.textColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 0.50)
salesID.leftViewMode = UITextFieldViewMode.Always
salesID.leftView = salesIDLabel
let domainLabel = UILabel(frame: CGRectZero)
domainLabel.font = UIFont.systemFontOfSize(12)
domainLabel.text = " Domain "
domainLabel.sizeToFit()
domainLabel.textColor = UIColor(red: 0.000, green: 0.478, blue: 1.000, alpha: 0.50)
domain.leftViewMode = UITextFieldViewMode.Always
domain.leftView = domainLabel
notes.layer.borderWidth = 1.0
notes.layer.cornerRadius = 5.0
notes.layer.borderColor = UIColor(red: 0.835, green: 0.835, blue: 0.835, alpha: 1.00).CGColor
}
private func showData(dict: [String: AnyObject]) {
name.text = dict["Name"] as? String
technology.text = dict["TechStack"] as? String
domain.text = dict["Domain"] as? String
salesID.text = dict["SalesID"] as? String
notes.text = dict["Notes"] as? String
}
func textFieldShouldBeginEditing(textField: UITextField) -> Bool {
return false
}
func textViewShouldBeginEditing(textView: UITextView) -> Bool {
return false
}
}