O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ProgressViewIOS example

To begin, we will need to make an addition to our storageMethods file to grab the current month's spent amount so that we can calculate the progress prop for ProgressViewIOS. This can be done by modifying checkCurrentMonthBudget:

// Expenses/app/utils/storageMethods.js export const checkCurrentMonthBudget = async () => {   let year = dateMethods.getYear();   let month = dateMethods.getMonth();   let response = await getAsyncStorage();   if (response === null || !response.hasOwnProperty(year) ||  !response[year].hasOwnProperty(month)) {     return false;   }   let details = response[year][month];   return {     budget: details.budget,     spent: details.spent   } } 

Here, we are returning an object containing both the budget and spent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required