Skip to content
Create ImageView for User or Group like Messenger app
Branch: master
Clone or download
Latest commit 4c1a00b Jun 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example Initial Commit Jun 30, 2019
MessengerBubbles Initial Commit Jun 30, 2019
Screenshots Initial Commit Jun 30, 2019
.gitignore Initial commit Jun 27, 2019
.travis.yml Initial commit Jun 27, 2019
LICENSE Initial commit Jun 27, 2019
MessengerBubbles.podspec Initial Commit Jun 30, 2019
README.md Update Readme Jun 30, 2019
_Pods.xcodeproj Initial commit Jun 27, 2019

README.md

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, laurent.grondin@epitech.eu

Contributing

Contributions are very welcome 🙌

License

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

You can’t perform that action at this time.