Skip to content

Commit

Permalink
DEMRUM-620: swiftlint: remove needless self references and fix whites…
Browse files Browse the repository at this point in the history
…pace
  • Loading branch information
carlosmcevilly committed Jan 17, 2025
1 parent 6383672 commit 6b01813
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions AgentTestApp/AgentTestApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,36 +22,37 @@ class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSour

override func viewDidLoad() {
super.viewDidLoad()

// Register the table view cell class and its reuse id
self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellReuseIdentifier)
tableView.register(UITableViewCell.self, forCellReuseIdentifier: cellReuseIdentifier)

// This view controller itself will provide the delegate methods and row data for the table view.
tableView.delegate = self
tableView.dataSource = self
}

// number of rows in table view
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return self.displayName.count
return displayName.count
}

// create a cell for each table view row
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

// create a new cell if needed or reuse an old one
let cell:UITableViewCell = (self.tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier) as UITableViewCell?)!
let cell: UITableViewCell = (self.tableView.dequeueReusableCell(withIdentifier: cellReuseIdentifier) as UITableViewCell?)!

// set the text from the data model
cell.textLabel?.text = self.displayName[indexPath.row]
cell.textLabel?.text = displayName[indexPath.row]

return cell
}

// method to run when table view cell is tapped
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print("You tapped row \(indexPath.row), for \(self.displayName[indexPath.row])")
self.performSegue(withIdentifier: self.segueName[indexPath.row], sender: self)
print("You tapped row \(indexPath.row), for \(displayName[indexPath.row])")

performSegue(withIdentifier: segueName[indexPath.row], sender: self)
}
}

0 comments on commit 6b01813

Please sign in to comment.