Giter Site home page Giter Site logo

messengerbubbles's Introduction

MessengerBubbles

Banner

Version License Platform

App Image

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

CocoaPods

MessengerBubbles is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MessengerBubbles'

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate CodableCloudKit into your project manually. Simply drag the Sources Folder into your Xcode project.

Usage

From Storyboard

MessengerBubbles is a subview of UIView

Storyboard

Just create a UIView and replace the Custom Class with MessengerBubbles

You can choose if you want to enable the online bubble indicator, if the user or group is online or not, change the online buble color and border color.

Programmatically

You have many ways to create a MessengerBubbles

public init(size: CGFloat,
            borderColor: UIColor = .white,
            onlineBubbleColor: UIColor = PrivateConstants.onlineBubbleColor,
            enableOnlineBubble: Bool = true,
            isOnline: Bool = false)


public init(images: [UIImage?]?,
            size: CGFloat,
            borderColor: UIColor = .white,
            onlineBubbleColor: UIColor = PrivateConstants.onlineBubbleColor,
            enableOnlineBubble: Bool = true,
            isOnline: Bool = false)

public init(urls: [String?]?,
            size: CGFloat,
            borderColor: UIColor = .white,
            onlineBubbleColor: UIColor = PrivateConstants.onlineBubbleColor,
            enableOnlineBubble: Bool = true,
            isOnline: Bool = false)

Size is always requiered. All others properties have a default value.

MessengerBubbles(size: 60) // With size only

MessengerBubbles(size: 60, borderColor: .blue, 
                 onlineBubbleColor: .yellow,
                 enabledOnlineBubble: false,
                 isOnline: false) // With custom values

MessengerBubbles(images: images,
                 size: 60) // With an array of UIImage at initialization

MessengerBubbles(urls: urls,
                 size: 60) // With an array of String at initialization

You can set images after MessengerBubbles has been created. If your array contains 1 element, it will create a single bubble. By the way, if it contains 2 elements or more, it will create 2 bubbles even if it contains more than 2 elements.

public func setImages(with images: [UIImage?]?) // Set images with an array of UIImage
public func setImages(with urls: [String?]?) // Set images with an array of String

let bubble = MessengerBubbles(size: 60)
bubble.setImages(with: images)
//or
bubble.setImages(with: urls)

isOnline and onlineBubbleColor can be changed after initialization

bubble.isOnline = true // or false
bubble.onlineBubbleColor = .black // or whatever you want

Author

Laurent Grondin, [email protected]

Contributing

Contributions are very welcome ๐Ÿ™Œ

License

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

messengerbubbles's People

Contributors

rpx974 avatar

Stargazers

MohsinAli avatar

Watchers

MohsinAli avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.