- December 17, 2024
- Mins Read
An iOS drop-in UITableView, UICollectionView, UIScrollView superclass category for showing a customizable floating button on top of it.
To run the example project, clone the repo, and run pod install
from the Example directory first.
Requires iOS SDK version > 8.0
MEVFloatingButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod ‘MEVFloatingButton’
Simply include UIScrollView+FloatingButton.h
and UIScrollView+FloatingButton.m
from /Pod/Classes/
folder in your App’s Xcode project.
#import “UIScrollView+FloatingButton.h”
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;
Create a MEVFloatingButton
object.
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]
For more info check the Examples project. Everything is there.
A vertical stackview which takes subviews with different widths and adds them to it's rows with paddings, spacings etc.
AudioManager is a Swift package that provides a modular and easy-to-use interface for implementing audio feedback in your applications. It ...