Skip to content
Awesomeplayer165 edited this page Mar 6, 2022 · 6 revisions

PillboxView

A small pill that presents a view on an asynchronous on-going task, the state of an asynchronous task, or instant task

Overview

PillboxView shows a small bubble, pill looking rounded box that slides in from the top of the screen. You most likely have seen this throughout iOS when the ringer state is changed, Airpods are connected and when you copy your Discord ID, among others. This provides users with assurance that things are happening behind the works and helps bring safely reporting background proccesses to the main UI.

image

image

image

Topics

Essentials

  • class PillView
    • A UIView to display two forms of dynamic content based on the conditions or needs of a developer.
  • enum PillShowType
    • Indicates the type of information that the PillView is showing.

Asynchronous Tasking

  • func showTask(message: String, vcView: UIView)
    • Starts the acknowledgement of the asynchronous task to the main UI
  • func completedTask(state: Bool, completionHandler: (() -> Void)?)
    • Shows the result of your asynchronous task as a positive or negative

Instant Erring

  • func showError(message: String, vcView: UIView)
    • Starts the acknowledgement of the error of an instant task to the main UI.

Visual Transitions

  • func reveal(animated: Bool, completionHandler: (() -> Void)?)
    • Hides the pillView to the top of the screen.
  • func dismiss(animated: Bool, completionHandler: (() -> Void)?)
    • Hides the pillView to the top of the screen.

PillView

  • init()
  • init(activityIndicator: UIActivityIndicatorView)
  • init(isNavigationControllerPresent: Bool)
  • init(showType: PillShowType)
  • init(width: Int, height: Int)
  • var activityIndicator: UIActivityIndicatorView
  • var errorSymbol: UIImage
  • var failureSymbol: UIImage
  • var height: Int
  • var isAwaitingTaskCompletion: Bool
  • var isNavigationControllerPresent: Bool
  • var pillView: UIView
  • var showType: PillShowType?
  • var successSymbol: UIImage
  • var titleLabel: UILabel
  • var vcView: UIView?
  • var width: Int
  • static var activePillBoxViews: Set
Clone this wiki locally