Skip to content

mikefrederick/MFSlidingView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MFSlidingView

Sometimes it's nice to be able to present a nice overlay view without having to present a whole new view controller. MFSlidingView helps animate views on top of your current view.

Screenshots

image

Features

  • Ability to easily configure the start and stop positions of the sliding animation (i.e. slide a view from below the screen to the middle of the screen, or from above the screen to the top of the screen).
  • Option to display a toolbar above or below your view.
  • Option to display a title, cancel button, and/or done button on the toolbar.
  • Option to dismiss the view when the background is pressed.
  • Option to perform keyboard avoidance for UITextFields and UITextViews.
  • Usage of blocks for dismissal actions.

Usage

###Minimum Configuration [MFSlidingView slideView:[[[UIDatePicker alloc] init] autorelease] intoView:self.view onScreenPosition:BottomOfScreen];

###Medium Configuration [MFSlidingView slideView:viewToSlideIn intoView:viewToSlideInTo onScreenPosition:MiddleOfScreen offScreenPosition:LeftOfScreen];

###Full Configuration SlidingViewOptions options = ShowDoneButton|ShowCancelButton|CancelOnBackgroundPressed|AvoidKeyboard; void (^cancelOrDoneBlock)() = ^{ // we must manually slide out the view out if we specify this block [MFSlidingView slideOut]; };

[MFSlidingView slideView:viewToSlideIn intoView:self.view 
         onScreenPosition:BottomOfScreen 
        offScreenPosition:BelowScreen title:@"Avoid Keyboard"
                  options:options 
                doneBlock:cancelOrDoneBlock 
              cancelBlock:cancelOrDoneBlock];

License

Copyright (c) 2012, Michael Frederick All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of Michael Frederick, 'viamike.com' nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Michael Frederick BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Contact

mike@viamike.com
http://viamike.com
http://twitter.com/mike_frederick

About

A container view that animates the presentation of any UIView.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published