FloatingBubbles is a customizable views that float like zero gravity animation.

Overview

Floating Bubbles

FloatingBubbles is a customizable views that float like zero gravity animation.

License Platform Stars Issues

FlowingMenu

$ pod try FloatingBubbles

Features

  • Create Multiple Views
  • Customization
  • Different size for every view.
  • ------- More Features Coming Soon -------------

Requirements

  • iOS 13.0+
  • Xcode 11.0+
  • Swift 5 (FloatingBubbles)

Usage

A FloatingBubbles object is an [UIView]

To display, you present it from an [UIView] object.

import FloatingBubbles

class ViewController: UIViewController {

    var floatingView = BouncyFloatingViews()
    
    override func loadView() {
        super.loadView()
        
        view.addSubview(floatingView)
        view.bringSubviewToFront(floatingView)

        NSLayoutConstraint.activate([
            floatingView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
            floatingView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
            floatingView.topAnchor.constraint(equalTo: self.view.topAnchor),
            floatingView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor)
        ])
        
        floatingView.delegate = self
    }
    
    override func viewDidAppear(_ animated: Bool) {
        floatingView.startAnimation()
    }
}

//MARK:- Customizations
extension ViewController: BouncyFloatingPresenable {
    func viewForBubbleAt(withIndex index: Int) -> UIView? {
        let v = UIView()
        v.backgroundColor = .red
        return v
    }
    
    
    var floatingViews: Int {
        6
    }
    
    var fps: Double {
        60
    }
    
    var speed: CGFloat {
        12
    }
    
    var heightWidth: CGFloat {
        50
    }
}

Properties

floatingView.delegate: BouncyFloatingPresenable? // floating views delegate
var floatingViews: Int // returns number of views
var heightWidth: CGFloat // returns height and width of the view for making a square
var fps: CGFloat // returns frame per seconds
var speed: CGFloat // returns the speed of moving in pixels per inch
func heightForViewAt(atIndex index: Int) -> CGSize? //Return size for every view if its nil then default (heightWidth)size is used

Delegation

The BouncyFloatingPresenable protocol provides a customizations to our views.

func viewForBubbleAt(withIndex index: Int) -> UIView? {
    let v = UIView()
    v.backgroundColor = .red
    return v
}


var floatingViews: Int {
    6
}

var speed: CGFloat {
    12
}


var fps: Double {
    60
}

var heightWidth: CGFloat {
    50
}

func heightForViewAt(atIndex index: Int) -> CGSize? {
    return CGSize(width: 80, height: 80)
}

Customization

Return View for customization.

For example,

func viewForBubbleAt(withIndex index: Int) -> UIView? {

    // create your custom view and return it
    let v = UIView()
    v.backgroundColor = .red
    return v
}

func heightForViewAt(atIndex index: Int) -> CGSize? {
    return CGSize(width: 80, height: 80)
}

Installation

CocoaPods

To install with CocoaPods, simply add this in your Podfile:

use_frameworks!
pod "FloatingBubbles"

Manually

  • Drop FloatingBubbles Files into your project.

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.

Author

Chandan Sharda, [email protected]

License

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

You might also like...
Tinder/Bumble like user image with user details scroll animation
Tinder/Bumble like user image with user details scroll animation

TinderUserProfile Tinder/Bumble like user image with user details scroll animation Add ProfileView.m,ProfileView.h class to your project. Set the clas

Add smooth water waves to your views.
Add smooth water waves to your views.

WXWaveView Add pretty and smooth waves to your views! The wave can be added to any type of view. 中文说明 e.g. Integration Cocoapods: pod 'WXWaveView' Or

Various view's effects for iOS, written in Swift. Allows you to animate views nicely with easy to use extensions
Various view's effects for iOS, written in Swift. Allows you to animate views nicely with easy to use extensions

Various view's effects for iOS, written in Swift. Allows you to animate views nicely with easy to use extensions. Every animation is randomized. Currently supported animations:

Create a smooth transition between any two SwiftUI Views
Create a smooth transition between any two SwiftUI Views

GZMatchedTransformEffect Create a smooth transition between any two SwiftUI Views. It is very similar to the built-in .matchedGeometryEffect() modifie

iOS framework for impressive transition animations between views.

CoreTransition iOS framework for impressive transition animations between views. Built using Swift, and supports a lot of animations to navigate to a

A DSL to make animation easy on iOS with Swift.
A DSL to make animation easy on iOS with Swift.

This project is highly inspired by JHChainableAnimations, If you project is developed with Objective-C, use JHChainableAnimations instead. With DKChai

Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers
Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers

Ease is an event driven animation system that combines the observer pattern with custom spring animations as observers. It's magic. Features Animate a

Elegant SVG animation kit for swift
Elegant SVG animation kit for swift

Elephant This is SVG animation presentation kit for iOS. Example You can run example app. Please open Example-iOS/Elephant-iOS.xcworkspace! Usage You

Releases(1.0.6)
Owner
Chandan Sharda
IOS Engineer. I am having knowledge of swift and its associated Frameworks like Core Data,UIKit , UIDynamics , Alamofire, RxSwift
Chandan Sharda
An experiment for using SwiftUI's custom timing Animation to create an orbital-like animation.

Orbital-SwiftUI-Animation An experiment for using SwiftUI's custom timing curve to create an orbital-like animation. How it looks: How it works: Apply

Mostafa Abdellateef 7 Jan 2, 2023
ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation

ChainPageCollectionView A custom View with two level chained collection views and fancy transition animation. Demo Requirements iOS 9.0+ Xcode 8 Insta

Yansong Li 775 Dec 7, 2022
An Objective-C animation library used to create floating image views.

JRMFloatingAnimation [![CI Status](http://img.shields.io/travis/Caroline Harrison/JRMFloatingAnimation.svg?style=flat)](https://travis-ci.org/Caroline

Caroline Harrison 233 Dec 28, 2022
Simple Interface Core Animation. Run type-safe animation sequencially or parallelly

Simple Interface Core Animation Sica can execute various animations sequentially or parallelly. Features Animation with duration and delay parallel /

CATS Open Source Softwares 1k Nov 10, 2022
SwiftUI-Text-Animation-Library - Text animation library for SwiftUI

⚠️ This repository is under construction. SwiftUI Text Animation Library Make yo

null 28 Jan 8, 2023
Swiftui-animation-observer - Track SwiftUI animation progress and completion via callbacks

SwiftUI Animation Observer Track SwiftUI animation progress and completion via c

Gordan Glavaš 9 Nov 5, 2022
CCMRadarView uses the IBDesignable tools to make an easy customizable radar view with animation

CCMRadarView CCMRadarView is a simple to use view that uses the new IBDesignable and IBInspectable features of XCode6 to easily configure the icon in

Carlos Compean 183 Sep 17, 2022
🎨 Gradient animation effect like Instagram

Pastel ?? Gradient animation effect like Instagram Example override func viewDidLoad() { super.viewDidLoad() let pastelView = PastelView(fram

Cruz 3.4k Jan 1, 2023
Bring life to CALayers with SpriteKit-like animation builders

Animo Bring life to CALayers with SpriteKit-like animation builders. Why use Animo? Because declaring CAAnimations (especially with CAAnimationGroups)

エウレカ 279 Dec 9, 2022