Guest User

Untitled

a guest
Apr 23rd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  2.  
  3.  
  4. @IBOutlet weak var titleLabel: UILabel!
  5.  
  6.  
  7. @IBOutlet weak var topicLabel: UILabel!
  8.  
  9.  
  10. var dictionary1:[Int:String] = [0:"Whether you have experienced Pricking-pain, Desquamation,itching or dry skin sensation during seasonal alternate.",
  11. 1:"Whether your skin apt to flush( Redness) in hot humid environment ",
  12. 2:"Whether your skin has multiple disernible dilated capillaries.",
  13. 3:"whether you have once been diagnosed atopic dermatitis or seborrheic dermatitis."]
  14.  
  15.  
  16. var dictionary2:[Int:Array<String>] = [0:["Never","Seldom","Usually","Always"],
  17. 1:["Never","Seldom","Usually","Always"],
  18. 2:["Never","Seldom","Usually","Always"],
  19. 3:["Yes", "No"]]
  20.  
  21. override func viewDidLoad() {
  22. super.viewDidLoad()
  23. titleLabel.text = "Fill Skin Type Survey Form "
  24. titleLabel.textColor = UIColor.black
  25. topicLabel.text = "Are You with sensitive skin type ?"
  26. topicLabel.font = UIFont.boldSystemFont(ofSize: 18)
  27.  
  28.  
  29.  
  30. }
  31.  
  32.  
  33.  
  34. //TableView
  35.  
  36.  
  37.  
  38. func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  39.  
  40. return dictionary1.count
  41. }
  42.  
  43.  
  44. func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  45. let cell:TableViewCell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell
  46. //cell.questionLabel.text = NSObject.dictionaryWithValues(forKeys: [indexPath.row])
  47.  
  48. cell.questionLabel.text = dictionary1[indexPath.row]
  49.  
  50. cell.questionLabel.textColor = UIColor.black
  51. //cell.optionsLabel.text = dictionary2[indexPath.row]
  52.  
  53. let arr = dictionary2[indexPath.row]
  54.  
  55. var strr = String()
  56. for str in arr! {
  57. strr = strr + str
  58. }
  59. cell.optionsLabel.text = strr
  60.  
  61. cell.optionsLabel.textColor = UIColor.black
  62.  
  63.  
  64. return cell
  65. }
Add Comment
Please, Sign In to add comment