RichieIndexedContainerView

Objective-C

@interface RichieIndexedContainerView : UIView

Swift

class RichieIndexedContainerView : UIView

@brief Abstract UIView subclass for managing indexed collection of subviews.

RichieIndexedContainerView is an abstract view class for managing indexed collection of subviews. It implements array management for the indexed views and provides callbacks for managing the subview layout.

The main idea behind RichieIndexedContainerView is that can handle lazily loading and unloading subviews in a similar fashion to UITableView. Views are loaded and added to view hierarchy when they become visible, and are then removed from view hierarchy when they are moved outside of viewable area. It is up to concrete subclasses to manage firstVisibleIndex and lastVisibleIndex, and call setNeedsViewRefresh when they change. This will schedule a view refresh to be done at layout time.

It is up to the concrete subclass to actually add and remove the managed views to and from the view hierarchy. This allows all kinds of intelligent caching behaviors.

Concrete subclasses can implemented any kind of actual layout for the subviews. RichieIndexedContainerView delegates frame setting behavior to subclasses by calling -setFrameForView:atIndex: whenever visible views need refreshing. The implementation for this method should be efficient, because this method will be called often.

  • Undocumented

    Declaration

    Objective-C

    - (void)invalidate;

    Swift

    func invalidate()
  • Undocumented

    Declaration

    Objective-C

    - (NSArray<__kindof UIView *> *)views;

    Swift

    func views() -> [UIView]!
  • Undocumented

    Declaration

    Objective-C

    - (__kindof UIView *)viewAtIndex:(NSInteger)index;

    Swift

    func view(at index: Int) -> UIView!
  • Undocumented

    Declaration

    Objective-C

    - (void)enumerateViewsUsingBlock:(void (^)(__kindof UIView *, NSInteger))block;

    Swift

    func enumerateViews(_ block: ((UIView?, Int) -> Void)!)
  • Undocumented

    Declaration

    Objective-C

    - (void)reloadData;

    Swift

    func reloadData()
  • Undocumented

    Declaration

    Objective-C

    -(void) reloadViewAtIndex:(NSInteger)index;

    Swift

    func reload(at index: Int)
  • Undocumented

    Declaration

    Objective-C

    - (void)noteNumberOfViewsChanged;

    Swift

    func noteNumberOfViewsChanged()
  • Undocumented

    Declaration

    Objective-C

    -(void) insertViewAtIndex:(NSInteger)index;

    Swift

    func insert(at index: Int)
  • Undocumented

    Declaration

    Objective-C

    -(void) removeViewAtIndex:(NSInteger)index;

    Swift

    func remove(at index: Int)
  • Undocumented

    Declaration

    Objective-C

    - (void)frameDidChange;

    Swift

    func frameDidChange()
  • Undocumented

    Declaration

    Objective-C

    - (void)setNeedsViewRefresh;

    Swift

    func setNeedsViewRefresh()
  • Undocumented

    Declaration

    Objective-C

    - (void)refreshViews;

    Swift

    func refreshViews()
  • Undocumented

    Declaration

    Objective-C

    - (void)refreshViewFrames;

    Swift

    func refreshViewFrames()
  • Undocumented

    Declaration

    Objective-C

    - (void)commonInit;

    Swift

    func commonInit()
  • Undocumented

    Declaration

    Objective-C

    - (void)didRemoveView:(UIView *)view atIndex:(NSInteger)index;

    Swift

    func didRemoveView(_ view: UIView!, at index: Int)
  • Undocumented

    Declaration

    Objective-C

    - (void)didRefreshVisibleViews;

    Swift

    func didRefreshVisibleViews()
  • Undocumented

    Declaration

    Objective-C

    - (void)didChangeViewCount;

    Swift

    func didChangeViewCount()
  • Undocumented

    Declaration

    Objective-C

    - (void)didReloadData;

    Swift

    func didReloadData()
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isInReloadData

    Swift

    var isInReloadData: Bool { get }
  • Undocumented

    Declaration

    Objective-C

    -(__kindof UIView *) viewAtIndex:(NSInteger)index doingLayoutBefore:(BOOL)doLayout;

    Swift

    func view(at index: Int, doingLayoutBefore doLayout: Bool) -> UIView!
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger viewCount;

    Swift

    var viewCount: UInt { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSUInteger numberOfViewsFromDataSource;

    Swift

    var numberOfViewsFromDataSource: UInt { get }
  • Undocumented

    Declaration

    Objective-C

    - (UIView *)viewFromDataSourceAtIndex:(NSInteger)index;

    Swift

    func viewFromDataSource(at index: Int) -> UIView!
  • Undocumented

    Declaration

    Objective-C

    - (void)setFrameForView:(UIView *)view atIndex:(NSInteger)index;

    Swift

    func setFrameFor(_ view: UIView!, at index: Int)
  • Undocumented

    Declaration

    Objective-C

    - (void)addView:(UIView *)view toContainerViewAtIndex:(NSInteger)index;

    Swift

    func addView(_ view: UIView!, toContainerViewAt index: Int)
  • Undocumented

    Declaration

    Objective-C

    - (void)removeView:(UIView *)view fromContainerViewWithIndex:(NSInteger)index;

    Swift

    func removeView(_ view: UIView!, fromContainerViewWith index: Int)
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger firstVisibleIndex;

    Swift

    var firstVisibleIndex: Int { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSInteger lastVisibleIndex;

    Swift

    var lastVisibleIndex: Int { get }