Giter VIP home page Giter VIP logo

ssuiviewminime's Introduction

SSUIViewMiniMe

A miniature replica of your UIView with an indicator of your location.

Overview

SSUIViewMiniMe takes your UIView and creates a small version of it with an indicator of your location on the original UIView.

The example shown in the GIF above is in the SSUIViewMiniMeDemo/ directory:

Features

  • The MiniMe UIView is responsive to touch. Dragging your finger on it will move the actual UIScrollView
  • The MiniMe UIView indicator will track the current movment in the UIScrollView
  • The MiniMe UIView will draw on it self any changes made in the UIScrollView

All those features are shown in the GIF above (might take a few seconds to load)

Requirements

  • iOS 5+ (Should work on 4 if you are not using a StoryBoard, not tested)

Screenshot (The GIF above will explain a lot more)

Why?

In one of my projects I was asked to create a simple UI for seats selection in a movie theater. With the iPhone screen relatively small I had to find a way to zoom in on a view and still let the user know about his current location. I ended up using something much simpler for the seat selection project and found a lot of other uses for SSUIViewMiniMe class.

Installation

Just drag SSUIViewMiniMe.h & m to your project. (Cocopods will be added some time soon)

How to use

import SSUIViewMiniMe.h to your project.

miniMeView = [[SSUIViewMiniMe alloc]initWithView:yourView withRatio:4]; // ratio is the size of the miniMe view you want to create. UIView size \ ratio = UIViewMiniMe size
[self.view addSubview:miniMeView];

That's it!

If you want to use the delegate methods (optional) you will also need to add

@interface ViewController () <SSUIViewMiniMeDelegate>
...
miniMeView.delegate = self;

SSUIViewMiniMeDelegate Protocols

- (void)enlargedView:(SSUIViewMiniMe *)enlargedView willBeginDragging:(UIScrollView *)scrollView;

Tells the delegate when scrolling is about to start.

- (void)enlargedView:(SSUIViewMiniMe *)enlargedView didScroll:(UIScrollView *)scrollView;

Tells the delegate when the user scrolls the content view.

- (void)enlargedView:(SSUIViewMiniMe *)enlargedView didEndDragging:(UIScrollView *)scrollView;

Tells the delegate when dragging ended.

- (void)enlargedView:(SSUIViewMiniMe *)enlargedView willBeginDecelerating:(UIScrollView *)scrollView;

Tells the delegate that scrolling movement is starting to decelerate.

- (void)enlargedView:(SSUIViewMiniMe *)enlargedView didEndDecelerating:(UIScrollView *)scrollView;

Tells the delegate that the scroll view has ended decelerating the scrolling movement.

ToDo:

  1. CocoPods
  2. Rotation
  3. Other stuff

The MIT License (MIT)

Copyright (c) sSegev

ssuiviewminime's People

Contributors

ssegev avatar

Watchers

James Cloos avatar Arvin Li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.