
Explore building a dollar cost averaging calculator for us stocks and etfs by fetching data via api from Alpha advantage, using mvc architecture and unit tests.
Set up the iOS project, install the required libraries, and scaffold a storyboard with a navigation controller and table view controllers to prepare for robust unit testing.
Add a UI search controller to the first table view, wiring it into the navigation bar and setting a placeholder 'enter a company name or symbol'.
Explore building prototype cells in a storyboard, using static and stack views, labels, and constraints, and wire a table view cell with an identifier.
Obtain a free Alpha Vantage api key, wire up an api service in your iOS project, and understand limits such as five requests per minute.
Learn to build a search results model that decodes the API's best_matches array into results with symbol, name, type, and currency using coding keys.
Build an api service to fetch search results by randomly selecting from multiple api keys, using a data task publisher and json decoder, with error handling on the main thread.
Learn to connect a search bar to an API call by passing typed keywords, debounce input with a publisher, observe changes, and update search results on the main thread.
Reflect search results in the table view cell by configuring each cell with a single search result’s name, symbol, type, and currency, and refresh the table view when results update.
Architect onboarding with a mode switch that toggles between onboarding and search states, showing or hiding image and label, and using a table view background to manage the UI.
Create a custom search placeholder view with an image and a label in a vertical stack, and apply it as the table view's background view while enabling large navigation titles.
Learn to show a loading animation during stock symbol searches by delaying for API response, using a progress HUD library, and applying a protocol extension to keep the code clean.
Design and assemble the calculator tape view in a static table view using the main storyboard, vertical and horizontal stack views, labels, and precise font, spacing, and constraints.
Adjust a two-cell table view by resizing the cell, embedding static and stack views, and adding a text view, labels, and a slider with investment placeholders.
Refine the iOS UI by adjusting the table view controller layout, separating the denomination and USD labels, and tightening stack view spacing; implement a segue from the search table view.
Guard against empty search query by ensuring the query is not empty before triggering the search, preventing the loading animation.
Design a Swift model for time series monthly adjusted stock data from Alpha Vantage, mapping symbol and open-high-low-close-money adjusted fields using coding keys to handle a hash payload.
Learn to fetch symbol search results from Alpha1 Vantage by encoding spaces to %20, define a custom API service error for encoding failures, and ensure safe publisher returns.
Fetch the time series monthly adjusted publisher for a symbol via a new function, with keywords and API key. Address decoding and error handling while refactoring to remove code duplication.
Refactor the API service to remove duplicate code by extracting logic into private functions, renaming and using a query string, and handling success and failure through a single, maintainable pattern.
Handle the search results selection by fetching time series money adjusted information for the selected symbol, enabling gains and annual returns calculations by passing data to the calculator view.
Learn to fix an unsorted time series dictionary by modeling month data with date, open, and adjusted close, and implement a function to return a sorted array of months.
Transform the time series dictionary into an array of month infos by parsing dates with a Swift date formatter and computing adjusted open and close from OHLC data.
Create an asset model that combines time series monthly adjusted data with the search result's symbol, name, and currency, and display them on the calculator screen.
Update the currency labels across the calculator table view using an outlet collection to apply each asset's currency symbol, and implement a string extension for formatting with brackets.
Fixes two ui bugs in the iOS financial app, removing currency and brackets from investment labels, and adds a loading spinner during ETF searches before opening the calculator.
Build the calculator screen with number keypad inputs for initial investment and monthly cost averaging, and implement a date selection via a table view with a keyboard dismissal done button.
Populate dummy date selection cells by configuring a table view with a horizontal stack view, date labels, and passing time series money adjusted to the selection table view controller.
Update the date selection cell by renaming the month label, using a date extension to format dates with a date formatter, and showing months ago with the cell index.
Tap a date in the date selection table view to trigger a closure that passes the selection back to the calculator. Update the tax field with the chosen date.
Pop the date selection table view controller from a navigation controller when a date is chosen, by checking the visible view controller in the calculator table view controller and popping.
Learn to handle previous date selection by passing the selected index between table view controllers and toggling the checkmark for the chosen date in the selection tape.
Implement a date slider to select investment dates, update the text view accordingly, and wire up the slider with the Combine framework to publish index changes.
Fix an index out of range crash by setting the slider maximum to the data count minus one, then refactor text view handling to stabilize keyboard and deselection navigation.
Observe text fields for the initial investment and monthly dollar-cost averaging, subscribing to their changes via notification center and publishers to update the top results reactively.
Create a dollar cost averaging service in a swift ios app, building a calculator to compute current value, gain, and annual return and update outputs reactively from text input.
Implement a private function to compute the total investment amount by combining the initial investment with monthly dollar cost averaging, using the first day of the month open price.
Calculate the current value by multiplying the number of shares by the latest share price from the asset's time series via the adjusted close price; return zero if data unavailable.
Learn to calculate number of shares for the initial investment and dollar cost averaging by dividing amounts by the adjusted open price, then compute total shares and prepare unit tests.
Refactor the stock investment calculator and perform manual tests to verify the number of shares computed from initial investment, dollar-cost averaging, and opening price data.
Update the current value view to show currency with two decimal places and indicate profitability with a color cue based on current value versus investment.
Refactor the UI to improve readability by converting the current value label into a horizontal stack and constraining its width. Apply currency formatting to investment amounts for clearer presentation.
Calculate net gain as current value minus investment, and display it with a currency format that supports plus or minus symbols, dollar symbol, and decimal places.
Compute yield by dividing gains by investment and format as a two-decimal percent in a swift iOS app. Display plus or minus in brackets and color-code profits.
Learn to calculate the annual return using CAGR, by linking ending value, beginning value, and years (months divided by 12) to determine the per-year growth in your finance app.
Update the interface by resetting current value and investment amount to zero; set labels to dashes until three parameters are entered; focus the investment field on launch.
Remove the redundant animation when returning from the search screen by clearing the search text and avoid unnecessary API calls, while displaying the asset symbol as the navigation title.
Debug the annual return bug by tracing why integer division yields infinity or negative percent and convert the initial investment index to a double to fix results.
Improve the financial app by removing decimal places from currency displays and add a custom app icon using the provided icon assets in the assets folder.
Learn to disable the table view scrolling on the search page until results load, then enable it when results appear, and clean up the UI by removing a punctuation mark.
Learn to set up unit tests for a swift iOS app, create a unit test target, import the module, and run tests to verify the DCA calculator logic.
This crash course explains unit tests in an iOS Swift project, covering testable targets, target membership, setup and tear down, given-when-then tests, and disabling or running tests with test framework.
Explore unit testing of the dollar-cost averaging calculation in a swift-based financial app, covering get investment amount, DCA result accuracy, test naming, and running permutations to ensure correct investment amounts.
Outline the test case plan for the DCA service, testing assets (stocks or etfs) as winning or losing with initial investment and DCA on/off across four permutations.
Present the first unit tests for the stock app, validating four cases: winning and losing assets with and without dollar cost averaging, using given-when-then and mock time series.
Complete the first unit test by validating investment amount, current value, and gains; calculate shares from monthly prices, fix adjusted open logic, and address precision with rounding for accurate returns.
Add a second unit test case for iOS & Swift financial app, testing zero dollar cost averaging with a five thousand dollar initial investment, calculating shares, current value, and gains.
Explore how to verify a losing asset scenario with unit tests, calculating shares, dollar cost averaging, and gains to determine profitability in a stock investment example.
Increase label and value sizes for better legibility on small devices. Adjust table view cell height, apply dollar formatting, and update the app display name in project settings.
Move the profitability logic from the table view controller into a calculator presenter. Write unit tests to ensure green or red UI colors and labels stay correct, guarding against regressions.
Create and test the calculator presenter with unit tests in Xcode, validating that profitable results color the return label green, nonprofitable color red, and proper bracket formatting.
Refactor the time series and money adjustment models to eliminate force unwraps, replace them with safe optional handling and conditional returns, and validate changes with unit tests.
Welcome to the iOS & Swift - Financial App with Stock APIs & Unit Tests course!
This course is designed for iOS developers with at least 1 year iOS experience who want to learn to work with Stocks APIs to build a finance investment app. You will learn to make Restful API calls to Alpha Vantage, a stock API provider to query asset prices and other financial data to build a dollar cost averaging calculator to project potential returns for financial assets like stocks, shares, equities & ETFs.
You will also learn how to write unit tests to ensure that the app logic is maintained and protected from erroneous change. This is an important skill to master if you are working in a huge team and with a high tier tech company.
We will also build this app using a reactive architecture where states are observed using the Combine framework with Swift 5 and Xcode 12. You will learn how to structure clean code that is both reusable, extensible and highly readable.
Here are some of the comments by my students
Well, I can say this course is really creating an "Awesome Onboarding" for me. Great job.
- Hery Yang
This is most excellent course. you are speaking clearly, and at a good pace, :-) many thanks for answering my question about git and producing a video to explain its use, very easy to follow and it was just what I needed so I am now able to manage my mistakes!
- Jason Walkins
It's a easy course and good for students who would like to start with iOS like me :)
- ਦੀਪ ਗਿੱਲ
This is a great course, The instructor is very knowledgeable. consider taking this course if you already have iOS experience. The instructor brings real world knowledge that benefit me a lot.
- Shushan Mordi
This course is as good as it gets. Kelvin is an extremely professional and thorough tutor that is very quick at getting back to your queries. I would highly recommend this course!
- Michael
Excellent Content, I appreciate the different styles of onboarding screens and all the great explanation!
- Carey M
The instructor is knowledgeable and clear with his instructions. The course is great and informative for those who are planning to build a skeleton they can build on their own app projects Instructor is also helpful
- Raphael Lim