MEVFloatingButton
  • October 7, 2023

An iOS drop-in UITableView, UICollectionView, UIScrollView superclass category for showing a customizable floating button on top of it.

Features


  • Multiple animation types.
  • Different display modes.
  • Different screen positions.
  • Customizable button icon.
  • Multiple delegate methods.

Demo


Demo App

Usage


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

Requirements

Requires iOS SDK version > 8.0

Installation


CocoaPods

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

pod ‘MEVFloatingButton’

Manual

Simply include UIScrollView+FloatingButton.h and UIScrollView+FloatingButton.m from /Pod/Classes/ folder in your App’s Xcode project.

How to use

 Step 1

#import “UIScrollView+FloatingButton.h”

Step 2

Add datasource and delegate methods.

@interface ViewController () <MEVFloatingButtonDelegate>

#pragma mark – MEScrollToTopDelegate Methods

– (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button;
– (void)floatingButtonWillAppear:(UIScrollView *)scrollView;
– (void)floatingButtonDidAppear:(UIScrollView *)scrollView;
– (void)floatingButtonWillDisappear:(UIScrollView *)scrollView;
– (void)floatingButtonDidDisappear:(UIScrollView *)scrollView;

Step 3

Create a MEVFloatingButtonobject.

MEVFloatingButton *button = [[MEVFloatingButton alloc] init];
button.animationType = MEVFloatingButtonAnimationFromBottom;
button.displayMode = MEVFloatingButtonDisplayModeWhenScrolling;
button.position = MEVFloatingButtonPositionBottomCenter;
button.image = [UIImage imageNamed:@”Icon0″];
button.imageColor = [UIColor groupTableViewBackgroundColor];
button.backgroundColor = [UIColor darkGrayColor];
button.outlineColor = [UIColor darkGrayColor];
button.outlineWidth = 0.0f;
button.imagePadding = 20.0f;
button.horizontalOffset = 20.0f;
button.verticalOffset = -30.0f;
button.rounded = YES;
button.hideWhenScrollToTop = YES;

Set the object to your UIScrollView/UITableView/UICollectionView.

[self.tableView setFloatingButtonView:button];

Set the delegate.

[self.tableView setFloatingButtonDelegate:self]

Sample Project


For more info check the Examples project. Everything is there.

GitHub


View Github

#cocoapods #ios #iosanimation #objectivec #objectivecextensions #objectiveclibrary
YOU MIGHT ALSO LIKE...
exyte

     

camerakit-ios

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service ...

HybridCamera

[video width="192" height="416" mp4="https://swiftgit.com/wp-content/uploads/2024/12/68747470733a2f2f7261776769742e636f6d2f7374796c656b69742f696d672f6d61737465722f7669645f6564697465645f325f326d622e676966.mp4"][/video]

TakeASelfie

An iOS framework that uses the front camera, detects your face and takes a selfie. This api opens the front ...

iOS-Depth-Sampler

Code examples of Depth APIs in iOS