:+1: Nice work. The primary challenge of this homework was to learn how to use UITableView to manage a complex form, establish communication between view controllers, and apply the correct Auto Layout constraints.
This was a challenging assignment, congrats on completing it successfully!
Grading Summary:
Functionality: Good
Code Style: Excellent
Visual Design: Good
Overall: Good
Detailed Notes
Nice work specifying the Auto Layout constraints. To rotate the simulator you can use Cmd-Left Arrow or Cmd-Right Arrow. Rotating the screen is a great way to see if you set up your constraints properly. Note that you should resolve all the constraint warnings (even it's just the warning, not the error)
Nice work linking the filter model with the controls. All cells in FilterVC are dequeued correctly. If you want to implement the drop down (aka expandable session) in the filter page, you can refer back to the github repo lab. See this popular form library for an alternative to implementing forms manually.
Nice work connecting the view controllers via the custom filter delegate. This is a popular pattern for handling events between view controllers.
You are implementing search as user type. When I type too fast , I will stuck with this HUD forever. It triggers the search and while it hasn't completed, another search was triggered.
The best practice for this is using debounce technique, meaning if user pauses the typing for a certain amount of time then you trigger the search. If user types too fast, you don't want to send the request for every character changed. It consumes network resource and makes screen flashing.
var debounceTimer: NSTimer?
// Search as you type?
func searchBar(searchBar: UISearchBar, textDidChange searchText: String) {
print("new text = \(searchBar.text!)")
// Delay 0.5 seconds
if let timer = debounceTimer {
timer.invalidate()
}
searchTerm = searchBar.text!
debounceTimer = NSTimer(timeInterval: 0.5, target: self, selector: Selector("searchNow"), userInfo: nil, repeats: false)
NSRunLoop.currentRunLoop().addTimer(debounceTimer!, forMode: "NSDefaultRunLoopMode")
}
func searchNow() {
// search
}
When search returns nothing, you should display something like "No result". Don't display an empty table.
Good job to check for the imageUrl is nil, but in case it's nil, you should show the no-image placeholder, rather then not showing anything. Something like this should work:
:+1: Nice work. The primary challenge of this homework was to learn how to use UITableView to manage a complex form, establish communication between view controllers, and apply the correct Auto Layout constraints.
This was a challenging assignment, congrats on completing it successfully!
Grading Summary:
Overall: Good
Detailed Notes
github repo
lab. See this popular form library for an alternative to implementing forms manually.debounce technique
, meaning if user pauses the typing for a certain amount of time then you trigger the search. If user types too fast, you don't want to send the request for every character changed. It consumes network resource and makes screen flashing.nil
, but in case it's nil, you should show the no-image placeholder, rather then not showing anything. Something like this should work: