Optional Methods

The summaryScreenDataSourcesForVoucher: method is called when the default summary screen is displayed to the user. The summary screen requires an array of data sources, each representing sections of cells in the tableView. They will be displayed in the default summary screen in the order given. Custom data sources & cells can be added as long as they follow the VOSectionDataSourceProtocol.

Example Implementation

- (NSArray <id<VOSectionDataSourceProtocol>> *)summaryScreenDataSourcesForVoucher:(VOVoucher *)voucher {
	// You can mix default and custom sections

	// default data source
    VOSummaryScreenClaimerInfoDataSource *claimerInfoDataSource = [[VOSummaryScreenClaimerInfoDataSource alloc] initWithClaimer:voucher.claimer
                                                 																      claimDate:voucher.claimDate
                                                													                vouchrTheme:self.vouchrTheme];

    // custom data source
    CustomSummaryScreenClaimerInfoDataSource *customDataSource = [CustomSummaryScreenClaimerInfoDataSource dataSourceWithVoucher:voucher];

	return @[claimerInfoDataSource, customDataSource];
}
func summaryScreenDataSources(for voucher: Voucher?) -> [SectionDataSourceProtocol?]? {
    // You can mix default and custom sections

    // default data source
    let claimerInfoDataSource = VOSummaryScreenClaimerInfoDataSource(claimer: voucher?.claimer, claimDate: voucher?.claimDate, vouchrTheme: vouchrTheme)

    // custom data source
    let customDataSource = CustomSummaryScreenClaimerInfoDataSource(voucher: voucher)

    return [claimerInfoDataSource, customDataSource]
}