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

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

#include <StoreRecommendPackTableView.h>

Inheritance diagram for StoreRecommendPackTableView:
Collaboration diagram for StoreRecommendPackTableView:

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 and re-enables selection.
(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:
 StoreRecommendPackViewDelegate callback: opens the tapped tile's pack through parentView, if selection is allowed.
(NSInteger) - numPackRows
 The number of pack rows: the 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 StoreRecommendPackView) 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, which is numPackRows.
(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 parentView (iPhone only), or deselects the "load more" row.
(void) - reloadData
 Empties the artwork cache and reloads the table.
(void) - scrollViewDidScroll:
 Scroll callback.
(void) - cache:willEvictObject:
 NSCacheDelegate eviction callback.
Instance Methods inherited from <StoreRecommendPackViewDelegate>
(void) - storePackViewSelected:
 Sent when the tile is tapped.

Properties

NSArray * packList
 The packs to display.
id parentView
 The owner told when a pack is tapped.
StorePackInfo * parentInfo
 The pack whose recommendations this table lists.

Detailed Description

A table of recommended 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 StoreRecommendPackViewDelegate (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:
0x21446c

◆ clearArtworkCache

- (void) clearArtworkCache

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

Ghidra address:
0x2129f0

◆ 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:
0x212a50

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

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

◆ numberOfSectionsInTableView:

- (NSInteger) numberOfSectionsInTableView: (UITableView *) tableView

The number of sections.

Always one.

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

◆ numPackRows

- (NSInteger) numPackRows

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

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

◆ reloadData

- (void) reloadData

Empties the artwork cache and reloads the table.

Ghidra address:
0x21440c

◆ scrollViewDidScroll:

- (void) scrollViewDidScroll: (UIScrollView *) scrollView

Scroll callback.

The shipped body is empty (a single ret ).

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

◆ setupPackView:index:

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

Fills one pack view (a StorePackCell or a StoreRecommendPackView) 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 packList.
Ghidra address:
0x213308

◆ stopLoadingMore:

- (void) stopLoadingMore: (nullable id) sender

Ends the "load more" spinner state and re-enables selection.

Parameters
senderIgnored.
Ghidra address:
0x2129c8

◆ storePackViewSelected:

- (void) storePackViewSelected: (nullable id) packView

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

Parameters
packViewThe tapped pack tile.
Ghidra address:
0x213150

◆ 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:
0x2136d4
Ghidra address:
0x2136d4

◆ tableView:didSelectRowAtIndexPath:

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

Opens the selected pack through parentView (iPhone only), or deselects the "load more" row.

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

◆ 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:
0x213df8
Ghidra address:
0x213df8

◆ tableView:numberOfRowsInSection:

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

The number of rows in a section, which is numPackRows.

Parameters
tableViewThe table view.
sectionThe section index.
Returns
numPackRows .
Ghidra address:
0x213dec
Ghidra address:
0x213dec

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

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

Property Documentation

◆ parentInfo

- (StorePackInfo*) parentInfo
readwritenonatomicweak

The pack whose recommendations this table lists.

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

◆ parentView

- (id) parentView
readwritenonatomicweak

The owner told when a pack is tapped.

Weak and untyped in the metadata; the tap is delivered through -respondsToSelector: and -performSelector:withObject: rather than a declared conformance.


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