0

Attempting to write a delete function. I am building an app to list courses after a button is clicked. I am using a text view to display this information and appending each course with a new line. Now i want the user to be able to delete a course. I was thinking if i can keep track of which line the user is on right now, then i can also tell which line the user will like to delete. Thoughts? Maybe there is a better way of doing this, perhaps using labels instead of text view?

EDIT: Use table view /s

2 Answers2

1

You should use a UITableView to create a section for "Courses" and create rows in it with your courses.

And you should handle the insert/delete with the UITableView methods.

Check this out, or similiar tutorials out there.

Community
  • 1
  • 1
0

Perhaps you could use a UITableView to achieve this. One benefit to using a UITableView is you can use built in functionality for deleting and creating new items. Here is a guide on UITableView.

thexande
  • 1,645
  • 16
  • 23