JubeatPlus 3.9.11
Loading...
Searching...
No Matches
StorePackTableView Class Reference

A table of one genre's store packs with lazily-downloaded artwork and an infinite-scroll "load more" row. More...

#include <StorePackTableView.h>

Inheritance diagram for StorePackTableView:
Collaboration diagram for StorePackTableView:

Instance Methods

(instancetype) - initWithFrame:style:
 Designated initialiser: registers the cell classes, builds the download queue, cache and in-flight list, and loads the four resizable pack-background images and the default artwork.
(void) - stopLoadingMore:
 Ends the "load more" spinner state, re-enables selection, and optionally reloads the "load more" row so it shows the prompt again when a further page remains.
(void) - clearArtworkCache
 Empties the artwork cache, cancels every queued download, and clears the in-flight list.
(void) - downloadImageSync:
 Downloads one pack's artwork synchronously on the operation queue, then caches and installs it via a completion block.
(void) - storePackViewSelected:
 StorePackViewDelegate callback: opens the tapped tile's pack through viewController, if selection is allowed.
(NSInteger) - numPackRows
 The number of pack rows: the genre's pack count on iPhone, or half of it (rounded up) on iPad where each row holds two packs.
(void) - setupPackView:index:
 Fills one pack view (a StorePackCell or a StorePackView) from the pack at index, installing cached artwork or queueing a download for it.
(UITableViewCell *) - tableView:cellForRowAtIndexPath:
 Vends the row cell: a pack cell for a pack row, or the "load more" cell past the end.
(NSInteger) - numberOfSectionsInTableView:
 The number of sections.
(NSInteger) - tableView:numberOfRowsInSection:
 The number of rows in a section: numPackRows plus one when the genre reports a further page.
(CGFloat) - tableView:heightForRowAtIndexPath:
 The row height: the valid-row height for a pack row, otherwise the "load more" height.
(void) - tableView:willDisplayCell:forRowAtIndexPath:
 Sets each pack view's alternating background just before display, choosing the extended variant for a pack that has an extend.
(void) - tableView:didSelectRowAtIndexPath:
 Opens the selected pack through viewController (iPhone only), or begins a page fetch on the "load more" row.
(void) - selectLoadMoreCell:
 Enters the "load more" state: shows the spinner and prompt in the given cell, disables its selection, and asks viewController to fetch the next page.
(void) - scrollViewDidScroll:
 Scroll callback: begins a page fetch once the list is scrolled to its bottom, unless one is already in flight or the genre has no further page.
(void) - scrollViewDidEndDecelerating:
 Deceleration-ended callback (iPhone, tap-navigation preference off): tells viewController the list scrolled once the content is dragged past the frame height.
(void) - scrollViewDidEndDragging:willDecelerate:
 Drag-ended callback (iPhone, tap-navigation preference off, no further deceleration): the same "list scrolled" notification as -scrollViewDidEndDecelerating: .
(void) - cache:willEvictObject:
 NSCacheDelegate eviction callback.
Instance Methods inherited from <StorePackViewDelegate>
(void) - storePackViewSelected:
 Sent when the tile is tapped.

Properties

StorePackListGenre * currentGenre
 The genre whose packs this table lists.
UIViewController * viewController
 The owning controller told when a pack is tapped, a page must be fetched, or the list has scrolled.

Detailed Description

A table of one genre's store packs with lazily-downloaded artwork and an infinite-scroll "load more" row.

Conforms to the table data-source and delegate protocols, to UIScrollViewDelegate, to NSCacheDelegate (for the eviction callback), and to StorePackViewDelegate (each iPad pack tile reports its selection back here).

Method Documentation

◆ cache:willEvictObject:

- (void) cache: (NSCache *) cache
willEvictObject: (nullable id) obj 

NSCacheDelegate eviction callback.

The shipped body is empty (a single ret ).

Parameters
cacheThe cache evicting an object.
objThe object being evicted.
Ghidra address:
0x1b3614

◆ clearArtworkCache

- (void) clearArtworkCache

Empties the artwork cache, cancels every queued download, and clears the in-flight list.

Ghidra address:
0x1b1570

◆ downloadImageSync:

- (void) downloadImageSync: (nullable NSArray *) arg

Downloads one pack's artwork synchronously on the operation queue, then caches and installs it via a completion block.

Parameters
argA two-element array: the artwork NSURL followed by the cache-key NSIndexPath.
Ghidra address:
0x1b15d0

◆ initWithFrame:style:

- (instancetype) initWithFrame: (CGRect) frame
style: (UITableViewStyle) style 

Designated initialiser: registers the cell classes, builds the download queue, cache and in-flight list, and loads the four resizable pack-background images and the default artwork.

On iPad it also gives the table a thin bordered layer and inset scroll indicators.

Parameters
frameThe table's frame.
styleThe table style.
Returns
The initialised table.
Ghidra address:
0x1b0eb8
Ghidra address:
0x1b0eb8

◆ numberOfSectionsInTableView:

- (NSInteger) numberOfSectionsInTableView: (UITableView *) tableView

The number of sections.

Always one.

Parameters
tableViewThe table view.
Returns
One.
Ghidra address:
0x1b294c
Ghidra address:
0x1b294c

◆ numPackRows

- (NSInteger) numPackRows

The number of pack rows: the genre's pack count on iPhone, or half of it (rounded up) on iPad where each row holds two packs.

Returns
The row count.
Ghidra address:
0x1b1e04
Ghidra address:
0x1b1e04

◆ scrollViewDidEndDecelerating:

- (void) scrollViewDidEndDecelerating: (UIScrollView *) scrollView

Deceleration-ended callback (iPhone, tap-navigation preference off): tells viewController the list scrolled once the content is dragged past the frame height.

Parameters
scrollViewThe scrolling view.
Ghidra address:
0x1b3390
Ghidra address:
0x1b3390

◆ scrollViewDidEndDragging:willDecelerate:

- (void) scrollViewDidEndDragging: (UIScrollView *) scrollView
willDecelerate: (BOOL) decelerate 

Drag-ended callback (iPhone, tap-navigation preference off, no further deceleration): the same "list scrolled" notification as -scrollViewDidEndDecelerating: .

Parameters
scrollViewThe scrolling view.
decelerateWhether scrolling will continue to decelerate.
Ghidra address:
0x1b34d0
Ghidra address:
0x1b34d0

◆ scrollViewDidScroll:

- (void) scrollViewDidScroll: (UIScrollView *) scrollView

Scroll callback: begins a page fetch once the list is scrolled to its bottom, unless one is already in flight or the genre has no further page.

Parameters
scrollViewThe scrolling view.
Ghidra address:
0x1b3250
Ghidra address:
0x1b3250

◆ selectLoadMoreCell:

- (void) selectLoadMoreCell: (nullable UITableViewCell *) cell

Enters the "load more" state: shows the spinner and prompt in the given cell, disables its selection, and asks viewController to fetch the next page.

A no-op while already loading.

Parameters
cellThe "load more" cell.
Ghidra address:
0x1b2fc8

◆ setupPackView:index:

- (void) setupPackView: (nullable id) view
index: (NSUInteger) index 

Fills one pack view (a StorePackCell or a StorePackView) from the pack at index, installing cached artwork or queueing a download for it.

Parameters
viewThe pack view to configure.
indexThe pack's index in the genre.
Ghidra address:
0x1b1e70

◆ stopLoadingMore:

- (void) stopLoadingMore: (BOOL) reload

Ends the "load more" spinner state, re-enables selection, and optionally reloads the "load more" row so it shows the prompt again when a further page remains.

Parameters
reloadWhether to reload the "load more" row.
Ghidra address:
0x1b1420
Ghidra address:
0x1b1420

◆ storePackViewSelected:

- (void) storePackViewSelected: (nullable id) packView

StorePackViewDelegate callback: opens the tapped tile's pack through viewController, if selection is allowed.

Parameters
packViewThe tapped pack tile.
Ghidra address:
0x1b1cd0

◆ tableView:cellForRowAtIndexPath:

- (UITableViewCell *) tableView: (UITableView *) tableView
cellForRowAtIndexPath: (NSIndexPath *) indexPath 

Vends the row cell: a pack cell for a pack row, or the "load more" cell past the end.

Parameters
tableViewThe table view.
indexPathThe row's index path.
Returns
The configured cell.
Ghidra address:
0x1b223c
Ghidra address:
0x1b223c

◆ tableView:didSelectRowAtIndexPath:

- (void) tableView: (UITableView *) tableView
didSelectRowAtIndexPath: (NSIndexPath *) indexPath 

Opens the selected pack through viewController (iPhone only), or begins a page fetch on the "load more" row.

Parameters
tableViewThe table view.
indexPathThe row's index path.
Ghidra address:
0x1b2e00
Ghidra address:
0x1b2e00

◆ tableView:heightForRowAtIndexPath:

- (CGFloat) tableView: (UITableView *) tableView
heightForRowAtIndexPath: (NSIndexPath *) indexPath 

The row height: the valid-row height for a pack row, otherwise the "load more" height.

The valid-row height differs between idioms.

Parameters
tableViewThe table view.
indexPathThe row's index path.
Returns
The row height.
Ghidra address:
0x1b29b8
Ghidra address:
0x1b29b8

◆ tableView:numberOfRowsInSection:

- (NSInteger) tableView: (UITableView *) tableView
numberOfRowsInSection: (NSInteger) section 

The number of rows in a section: numPackRows plus one when the genre reports a further page.

Parameters
tableViewThe table view.
sectionThe section index.
Returns
The row count.
Ghidra address:
0x1b2954
Ghidra address:
0x1b2954

◆ tableView:willDisplayCell:forRowAtIndexPath:

- (void) tableView: (UITableView *) tableView
willDisplayCell: (UITableViewCell *) cell
forRowAtIndexPath: (NSIndexPath *) indexPath 

Sets each pack view's alternating background just before display, choosing the extended variant for a pack that has an extend.

On iPad the cell also gets a grey backdrop.

Parameters
tableViewThe table view.
cellThe cell about to be shown.
indexPathThe row's index path.
Ghidra address:
0x1b2a3c
Ghidra address:
0x1b2a3c

Property Documentation

◆ currentGenre

- (StorePackListGenre*) currentGenre
readwritenonatomicstrong

The genre whose packs this table lists.

Its genreID seeds each artwork cache key's section, which lets an in-flight download detect that the table has moved on to a different genre before the image arrives.

◆ viewController

- (UIViewController*) viewController
readwritenonatomicweak

The owning controller told when a pack is tapped, a page must be fetched, or the list has scrolled.

Weak in the metadata; every message is delivered through -respondsToSelector: and -performSelector: rather than a declared conformance.


The documentation for this class was generated from the following files: