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 ...

Get React Native By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.