Xcode 10, iOS 12.1
-
Open LastFm.xcodeproj. When open press run using a simulator or device.
-
Run the test using CMD + U
-
The project has two view controllers called AlbumSearchtListViewController that shows a list of albums for a query. And the AlbumInfoViewController that shows the albums details including the tracks
-
Unit tests are done with XCTest. The test covearage is 97.2%.
-
The only third party libraries are RxSwift and RxCocoa and the code is written using the below coding standards. Also ImageCache that was developed by me some time ago.
- Use descriptive names with camelcase for classes, methods, variables, etc. Classes should be capitalized while method names should start with lowercase
- Method braces always open in the same line
- Use one space separation between any operators for clarity
- Use //MARK: - to make navigating the code easier
- Conditionals bodies should always be in braces
- Should only be used when increases clarity
- There should be an space between method arguments
- ClassName+Functionality
- Declare all protocols in its own file
- File should have the same name as the protocol
- Avoid using self since Swift doesn’t require it to access objects or methods
- Don't include their definition unless is necessary e.g () -> () in remove () -> ()
- Try to use native types when available
- Let the compiler infer the type for a constant or variable unless you need to specify a type
- No need to use them, you should not have two statements in the same line
- Should be removed as the code belongs to the team not to the person the has created the class
- Keep it simple
- Keep classes and methods short
- No comments (the code should be self explanatory)
- Classes
-
- AppDelegate
-
- Utils
-
- ThirdParty
-
- Model
-
-
- Domain
-
-
-
- Network
-
-
- Controllers
-
-
- Views
-
-
- Resources
-
-
- Images, fonts, strings, plists, etc
-
- Create class folders in finder and drag them to Xcode
- Unit testing is done using XCTest