flixter's Issues
Feedback
Style
This is a good reference for coding style: https://github.com/NYTimes/objective-c-style-guide
Class name and File names should start with Capital Letters. ✅
Properties and local variables MUST be camel-case with the leading word being lowercase. ✅
Properties should be accessed using self.propertyName
instead of _propertyName
. ✅
My personal opinion for your naming:
DetailsViewController
should be nameMovieDetailsViewController
.
myArray
is not a descriptive name.movies
ormovieArray
would be a better name.
Remove unused files
ViewController.h
and ViewController.m
are not used, so you should remove them.
Reusing your details view controller
Think about how you can reuse the same detail view controller when you tap on a cell in your collection view.
Commit Messages
Commit messages should follow these guidelines: https://cbea.ms/git-commit/
Since this is the first project, I do not expect you to have commits, but in the future, please add a commit for every feature.
Logging
You should be logging every function in your application. This will help you understand your function call order. In production app, you'll likely be logging errors and crashes. You will also be tracking every user action.
NSLog(@"%@", NSStringFromSelector(_cmd));
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"%@", NSStringFromSelector(_cmd));
}
I personally add my initials to my log messages on my personal projects because it makes it easy for me to filter because you will receive log messages from various places.
My log messages look like this:
NSLog(@":NC: %@", NSStringFromSelector(_cmd));
UITableViewDelegate
You could also use UITableViewDelegate
to navigate to details screen instead of segues.
Step 1
Conform to the UITableViewDelegate
@interface MovieViewController () <UITableViewDataSource, UITableViewDelegate>
You'll also need to specify to the table view who the delegate is which is similar to how you specified to the table view who the data source was.
self.tableView.dataSource = self;
self.tableView.delegate = self;
Step 2
Implement didSelectRowAtIndexPath
method of UITableViewDelegate
interface.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
}
Step 3
Add a storyboard id for your details view controller
Step 4
You will instantiate your view controller from storyboard and push it with your navigation controller. Navigation Controller will be nil if you did not embed your view controller in a navigation controller in storyboard.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UINavigationController *navigationController = self.navigationController;
MovieDetailsViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"MovieDetailsViewController"];
viewController.movie = self.movies[indexPath.row];
[navigationController pushViewController: viewController animated:YES];
}
Project Feedback!
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:
- Did you use groups to organize your source files? It's pretty common to organize your source files into Groups, especially for larger projects. You can organize by type of class (i.e. View Controllers, Views, etc) or for larger apps by functionality (i.e. Home Screen, Search Screen, etc).
- Did you minimize the number of public methods and properties in your classes? You should always try to minimize the number of properties and methods that are in the header files. Only expose what you have to, e.g., properties and methods that must be accessed by other classes.
- Did you properly set the Content Mode for your ImageViews? By default the UIContentMode will stretch the image to match the dimensions of the image view, which is probably not what you want. The most common combination is to use Aspect Fill combined with clipping subviews.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.