Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
- @IBOutlet weak var titleLabel: UILabel!
- @IBOutlet weak var topicLabel: UILabel!
- var dictionary1:[Int:String] = [0:"Whether you have experienced Pricking-pain, Desquamation,itching or dry skin sensation during seasonal alternate.",
- 1:"Whether your skin apt to flush( Redness) in hot humid environment ",
- 2:"Whether your skin has multiple disernible dilated capillaries.",
- 3:"whether you have once been diagnosed atopic dermatitis or seborrheic dermatitis."]
- var dictionary2:[Int:Array<String>] = [0:["Never","Seldom","Usually","Always"],
- 1:["Never","Seldom","Usually","Always"],
- 2:["Never","Seldom","Usually","Always"],
- 3:["Yes", "No"]]
- override func viewDidLoad() {
- super.viewDidLoad()
- titleLabel.text = "Fill Skin Type Survey Form "
- titleLabel.textColor = UIColor.black
- topicLabel.text = "Are You with sensitive skin type ?"
- topicLabel.font = UIFont.boldSystemFont(ofSize: 18)
- }
- //TableView
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return dictionary1.count
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell:TableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell
- //cell.questionLabel.text = NSObject.dictionaryWithValues(forKeys: [indexPath.row])
- cell.questionLabel.text = dictionary1[indexPath.row]
- cell.questionLabel.textColor = UIColor.black
- //cell.optionsLabel.text = dictionary2[indexPath.row]
- let arr = dictionary2[indexPath.row]
- var strr = String()
- for str in arr! {
- strr = strr + str
- }
- cell.optionsLabel.text = strr
- cell.optionsLabel.textColor = UIColor.black
- return cell
- }
Add Comment
Please, Sign In to add comment