Code Monkey home page Code Monkey logo

jwfolders's Introduction

JWFolders is a class that attempts to mimic the folder animation present on the iOS SpringBoard.

##Preview JWFolders is being used in my commercial application, QuickWeather. Depicted here is a beta version of the app:

ExampleFolder

##Usage Just include the entire folder, JWFolders, in your project. Import JWFolders.h in the class in which you wish to create the folder.

#import "JWFolders.h"

Here's a quick example of how to create a new folder and open it upwards.

JWFolders *folder = [JWFolders folder];
folder.contentView = self.sampleFolder.view;
folder.containerView = self.view;
folder.position = openPoint;
folder.direction = JWFoldersOpenDirectionUp;
folder.contentBackgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"noise"]];
folder.shadowsEnabled = YES;
folder.showsNotch = YES;
[folder open]; // opens the folder.

An issue can arise if the folder is set to show the notch, and the position is set to a point with an x-coordinate of 0. The notch will appear to be cut off on the left side of the screen. This can be simply resolved by providing a non-zero x-coordinate. Most likely this will be the center of the item from which you present the folder.

Please check the header file for complete documentation.

##ARC The project currently uses Automatic Reference Counting, which means that if your project does not use ARC there will be memory leaks. There are no plans to create a non-ARC branch at this time.

##Important note

This library makes use of CALayer's renderInContext: method to render the current state of your view into an image. Unfortunately, renderInContext: does not take 3D transforms into account. If you would like this to be fixed, please file a radar.

##License JWFolders is licensed under the BSD License.

##Todo

  • Finish implementing the animated notch content to complete the effect.
  • Optimize the renderInContext: call. I fear this is impossible.

Please feel free to fork the project and improve it as much as possible!

##About Me I'm an 18-year-old developer and designer with a passion for great interface design and detail. See my applications, learn more about me, or get in touch. I'm on Twitter as well: @j_willing.

jwfolders's People

Contributors

jwilling avatar

Watchers

张宝才 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.