Skip to content

A UIView subclass that supports showing and selecting / deselecting items in bubble form with animation.

License

Notifications You must be signed in to change notification settings

ispiropoulos/PRGBubblesView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRGBubblesView

A UIView subclass that supports showing and selecting / deselecting items in bubble form with animation.

PRGBubblesView

Installation

Copy PRGBubblesView folder into your project.

Requirements

iOS >= 9.x Swift 3.0

Usage

Storyboard:

  1. Add a UIView and change it's class to PRGBubblesView. You can use autolayout constraints.
  2. Create an IBOutlet and set the "elements" property of the BubblesView:
bubblesView.elements = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6"]
  1. You 're set! Just build and run the project!

Programmatically:

let bubbleViewFrame = CGRect(x: 0, y: 20, width: view.bounds.width, height: view.bounds.height - 20)
let bubblesView = PRGBubblesView(frame: bubbleViewFrame, elements: ["Andres","Noel","Lewis","Judson","Edgardo","Jarred","Myles","Darren","Erasmo","Rhea","Monica","Jo","Dara","Selma","Garnet","Verena","My","Vera","Josefa"])
self.view.addSubview(bubblesView)

or

let bubblesView = PRGBubblesView(frame: bubbleViewFrame, elements: ["Andres","Noel","Lewis","Judson","Edgardo","Jarred","Myles","Darren","Erasmo","Rhea","Monica","Jo","Dara","Selma","Garnet","Verena","My","Vera","Josefa"], maxElementsPerRow: 5, bubbleTextFont: UIFont.systemFont(ofSize: 10), bubbleBGColor: UIColor(red:0.61, green:0.35, blue:0.71, alpha:1.0)
            , bubbleStrokeColor: .clear, bubbleTextColor: .white, dividerColor: UIColor(red:0.61, green:0.35, blue:0.71, alpha:1.0))
self.view.addSubview(bubblesView)

Properties

open var elements: Array<String> // The total elements you want bubblesView to show
open var selectedElements: Array<String> // The elements you have selected
open var remainingElements: Array<String> // The remaining elements
open var allowsMultipleChoise: Bool // Wether the user can select multiple items or not. Default set to true

open var bubbleTextFont: UIFont // The font of the bubble text
open var bubbleTextColor: UIColor // The text color of unselected bubbles
open var selectedBubbleTextColor: UIColor // The text color of selected bubbles
open var bubbleBGColor: UIColor // The background color of unselected bubbles
open var selectedBubbleBGColor: UIColor // The background color of selected bubbles
open var bubbleStrokeColor: UIColor // The stroke color of unselected bubbles
open var selectedBubbleStrokeColor: UIColor // The stroke color of selected bubbles

open var dividerColor: UIColor // The color of the horizontal divider

Author

John Spiropoulos

Credits

Arkadiusz Holko for the initial BendableView code.

License

PRGBubblesView is available under the MIT license. See the LICENSE file for more info.

About

A UIView subclass that supports showing and selecting / deselecting items in bubble form with animation.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages