let cell = tableView.dequeueReusableCell(withIdentifier: "ToDoItemCell", for: indexPath)
cell.textLabel?.text = tasks[indexPath.row].title
return cell
}
}
Connect the View Controllers with the Swift files and Interface Builder:
Click on the Table View Controller in the storyboard.
Open the Identity Inspector and set the "Class" to "ToDoListTableViewController."
Click on the Add Task View Controller in the storyboard.
Set the "Class" to "AddTaskViewController" in the Identity Inspector.
Set the "Storyboard ID" to "AddTaskViewController" in the Identity Inspector.
Open the Add Task View Controller scene.
Control-drag from the Text Field to the AddTaskViewController.swift file to create an IBOutlet named "textField."
Control-drag from the "Add Task" Button to the AddTaskViewController.swift file to create an IBAction named "addTaskButtonTapped."
Run the app:
Select a simulator or a connected iOS device in Xcode.
Press the "Run" button (or press Cmd + R) to build and run the app.
You should now be able to add tasks to your To-Do List app.
This lab provided a simple introduction to creating a To-Do List app using View Controllers and Storyboard in iOS. You should now have a better understanding of how to create and connect user interfaces with Swift code.
For your Course Project: will will add these further features:
Editing Tasks
Deleting tasks,
Course Project: The Fully Functional To Do App
Working with the Code you developed above:
Add functionality to Edit and Delete Tasks.
You have now make a fully functional To Do App.
How to hand in your Course Project:
Zip your XCODE project: Name as StudentName_StudentID_MAD3115_Project,zip