marin-hyatt / flix Goto Github PK
View Code? Open in Web Editor NEWA movie browsing app.
A movie browsing app.
Awesome job! I can see you learning the material as you progress via your commenting. Your logic is sound, with no obvious anti-patterns. Good job also with committing often & clearly stating what each commit does!
You're doing a lot of things right, so I'm mostly going to walk through ways to improve your code quality. Since this feedback is coming the day your last assignment is due (this is my fault), I'm not going to expect this feedback to be part of Twitter โ but cleaning up some things before final submission is always a good bet regardless :)
We have a lot of repetitive code, namely around error handling in network requests (and it looks like fetchMovies
is exactly the same in the MoviesVC and MoviesGridVC)
flix/Flix/View Controllers/MoviesViewController.m
Lines 56 to 85 in a3e8933
flix/Flix/View Controllers/TrailerViewController.m
Lines 32 to 60 in a3e8933
flix/Flix/View Controllers/MoviesGridViewController.m
Lines 57 to 86 in a3e8933
One way that you can clean this up is creating a new class with class methods. For example, in the fetchMovies
case, I might create something like:
FlixHelpers.h
@interface FlixHelpers : NSObject
+ (void)fetchMovies;
+ (void)networkErrorDialog;
@end
FlixHelpers.m
@implementation FlixHelpers
+ (void)fetchMovies {
// code here
// can call [self networkErrorDialog] here too
}
+ (void)networkErrorDialog {
// code here
}
@end
To use:
#import "FlixHelpers.h"
// ...
- (void)viewDidLoad {
//...
[FlixHelpers fetchMovies];
}
This also helps in line with creating the separation of model-view-controller, where the data from the movies is essentially the model.
nits == tiny things that don't hurt anything, but are nice for legibility
@ FB, we don't want to leave behind commented out code; comments are strictly used to explain what's going on. So, for example, this would be cleaned up before being pushed to the FB codebase:
flix/Flix/View Controllers/TrailerViewController.m
Lines 88 to 91 in a3e8933
I also noticed TODOs for code that you actually implemented lol - you can probably remove the comment completely and/or the TODO so it isn't confusing to the reader.
Not sure if this is actually XCode doing the wonky indentation, but if not, you can fix it by highlighting -> CTRL-I
flix/Flix/View Controllers/MoviesViewController.m
Lines 148 to 155 in a3e8933
This is the TINIEST nit because tbh these are probably tiny typos, but going to mention it anyways to be reflective of FB coding standards, but for spacing, it's best to err on the side of how CodePath has been doing them:
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
// ...
}
// If no search, don't filter anything
UICollectionViewFlowLayout *layout = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout;
flix/Flix/View Controllers/MoviesViewController.m
Lines 82 to 84 in a3e8933
completion:
can be nil
[self presentViewController:alert animated:YES completion:nil];
Nice work! The purpose of this project was to continue learning Objective-C and the Cocoa Touch (iOS) framework. You should be comfortable creating table views (one of the most common views in iOS) and working with array of dictionaries created from JSON (in this case from the Movies Database API).
A key part of these projects is that you work to polish the visuals and the small UI / UX touches. Developing your design sense is an important part of being a mobile engineer. You'll find that perfecting the UI / UX will often lead to interesting technical challenges as well because the libraries may not behave exactly as you want them to, so you'll have to learn how to achieve the effect that you want. A few other things to note:
However there were some user stories not reflected on your GIF:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.