-
Notifications
You must be signed in to change notification settings - Fork 273
Open
Description
import UIKit
class SecurityTipsViewController: UITableViewController {
let tips = [
"Use strong and unique passwords.",
"Enable two-factor authentication.",
"Avoid connecting to open WiFi networks without a password.",
"Keep your software up to date.",
"Be cautious with links in emails.",
"Use antivirus software.",
"Back up your data regularly.",
"Avoid sharing personal information online."
]
override func viewDidLoad() {
super.viewDidLoad()
title = "Security Tips"
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")
}
// MARK: - Table view data source
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return tips.count
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
cell.textLabel?.text = tips[indexPath.row]
cell.textLabel?.numberOfLines = 0 // allow multi-line text
return cell
}
}
Metadata
Metadata
Assignees
Labels
No labels