Skip to content

Commit

Permalink
Fixed bug that the Button was disappearing after presenting and dismi…
Browse files Browse the repository at this point in the history
…ssing a view controller on top
  • Loading branch information
Manuel Escrig Ventura committed Mar 3, 2016
1 parent 9fe92d4 commit b459995
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion Example/MEVFloatingButton/MEVExample1ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#import "MEVExample1ViewController.h"
#import "UIScrollView+FloatingButton.h"
#import "MEVExample4ViewController.h"

static NSString *CellIdentifier = @"CellIdentifier";

Expand Down Expand Up @@ -76,7 +77,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N

- (void)floatingButton:(UIScrollView *)scrollView didTapButton:(UIButton *)button {
NSLog(@"didTapButton");
[self.tableView setContentOffset:CGPointMake(0, -self.tableView.contentInset.top) animated:YES];
MEVExample4ViewController *viewController = [MEVExample4ViewController new];
[self presentViewController:[[UINavigationController alloc] initWithRootViewController:viewController] animated:YES completion:nil];
}

- (void)floatingButtonWillAppear:(UIScrollView *)scrollView {
Expand Down
9 changes: 3 additions & 6 deletions MEVFloatingButton.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

Pod::Spec.new do |s|
s.name = "MEVFloatingButton"
s.version = "0.5.0"
s.summary = "An iOS drop-in UITableView/UICollectionView/UIScrollView superclass category for showing a customizable floating button on top of it."
s.version = "1.1.2"
s.summary = "An iOS drop-in UITableView, UICollectionView, UIScrollView superclass category for showing a customizable floating button on top of it."

# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
Expand All @@ -18,14 +18,11 @@ Pod::Spec.new do |s|
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
An iOS drop-in UITableView/UICollectionView/UIScrollView superclass category for showing a customizable floating button on top of it.
A very customazible category in order to add a floating button as seen as in material design on top of a UIScrollView, UITableView or a UICollectionView.
Includes different delegate methods such us 'didTapButton', 'floatingButtonWillAppear', 'floatingButtonDidAppear', 'floatingButtonWillDisappear' and 'floatingButtonDidDisappear'.
DESC

s.homepage = "https://github.com/manuelescrig/MEVFloatingButton"
# s.screenshots = "https://cloud.githubusercontent.com/assets/1849990/13219261/29aef4a8-d96f-11e5-8632-85b31c3c1c1f.gif", "https://cloud.githubusercontent.com/assets/1849990/13219263/29d8c3b4-d96f-11e5-9d12-502363e77759.gif", "https://cloud.githubusercontent.com/assets/1849990/13219262/29d78f94-d96f-11e5-8d01-0805ef799160.gif", "https://cloud.githubusercontent.com/assets/1849990/13219329/9efde354-d96f-11e5-88a5-4175729e471e.gif"
# s.screenshots = "https://cloud.githubusercontent.com/assets/1849990/13462466/db001be6-e087-11e5-92a1-79c8ecefb715.gif"
s.license = 'MIT'
s.author = { "Manuel Escrig Ventura" => "[email protected]" }
s.source = { :git => "https://github.com/manuelescrig/MEVFloatingButton.git", :tag => s.version.to_s }
Expand Down
9 changes: 6 additions & 3 deletions Pod/Classes/UIScrollView+FloatingButton.m
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void Swizzle(Class c, SEL orig, SEL new)
}

- (void)mev_dealloc
{
{
@try {
[self removeObserver:self forKeyPath:kObserverContentOffset context:nil];
[self removeObserver:self forKeyPath:kObserverContentSize context:nil];
Expand All @@ -308,8 +308,11 @@ - (void)mev_dealloc
- (void)mev_willMoveToWindow:(UIWindow *)newWindow
{
if (!newWindow) {
[self mev_stopTimer];
[self mev_didDisappear];
if (self.floatingButton.displayMode != MEVFloatingButtonDisplayModeAlways &&
self.floatingButton.displayMode != MEVFloatingButtonDisplayModeNone) {
[self mev_stopTimer];
[self mev_didDisappear];
}
}

[self mev_willMoveToWindow:newWindow];
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MEVFloatingButton
An iOS **drop-in** UITableView/UICollectionView/UIScrollView superclass **category** for showing a customizable floating button on top of it. MEVFloatingButton is also compatible with ASCollectionView/ASTableView from [AsynDisplayKit](https://github.com/facebook/AsyncDisplayKit).
An iOS **drop-in** UITableView, UICollectionView, UIScrollView superclass **category** for showing a customizable floating button on top of it. MEVFloatingButton is also compatible with ASCollectionView/ASTableView from [AsynDisplayKit](https://github.com/facebook/AsyncDisplayKit).

[![Version](https://img.shields.io/cocoapods/v/MEVFloatingButton.svg?style=flat)](http://cocoapods.org/pods/MEVFloatingButton)
[![License](https://img.shields.io/cocoapods/l/MEVFloatingButton.svg?style=flat)](http://cocoapods.org/pods/MEVFloatingButton)
Expand Down

0 comments on commit b459995

Please sign in to comment.