Open Juliang0705 opened 8 years ago
:+1: Nice work! The point of this homework was to get a chance to implement a TableView (one of the most common views in iOS) and to work with real data over the network (in this case from the Movies Database API).
A key part of these projects is that you add additional features and tweak the UI / UX because that will provide the most learning opportunities. We encourage you to complete the projects early each week with the required stories and then spend time adding your own UI elements and experimenting with optional extensions that will improve the user experience.
if let
to unwrap variables :+1: But after that why don't you use the unwrapped variable to use? func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int{
if let _ = filteredMovies{
return filteredMovies!.count
}else{
return 0
}
}
You can rewrite it like this:
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if let filteredMovies = filteredMovies {
return filteredMovies.count
} else {
return 0
}
}
Please put the `and
{` at the right positions.
filteredMovies
when declare like this var filteredMovies = [NSDictionary]()
so you can use it anywhere without unwrapping. By this way, the function numberOfRowsInSection
will be simpler, just use return filteredMovies.count
.To avoid this, you can set 0
for the number of lines of this UILabel
in order to display multiple lines.
search
feature. It's not a big deal but in case there is no result, you should show a label No results found
to make your app more friendly :wink: A small issue is that I cannot hide the keyboard after searching.Excellent submission overall! :horse_racing:
We have a detailed Project 1 Feedback Guide which covers the best practices for implementing this assignment. Read through the feedback guide point-by-point to determine ways you might be able to improve your submission. You should consider going back and implementing these improvements as well. Keep in mind that one of the most important parts of iOS development is learning the correct patterns and conventions.
If you have any particular questions about the assignment or the feedback, feel free to reply here or email us at universitysupport@codepath.com.
My app for week 1 is completed. Please review /cc @codepathreview