Coder Social home page Coder Social logo

sweetdaddy2015 / lgsublimationview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lukegeiger/lgsublimationview

0.0 2.0 0.0 3.46 MB

(Objective-C Version) The LGSublimationView is a view that has a cool paging animation on its UIScrollView. The effect it gives off is that there are views behind the scroll view that don't scroll with the scroll view. Rather, when the scroll view pages, they cross dissolve into one another

License: MIT License

Objective-C 63.10% Ruby 5.06% C 2.82% Shell 29.02%

lgsublimationview's Introduction

LGSublimationView

Version License Platform

LukeGeigerSublimer

Introduction

The LGSublimationView is a view that has a cool paging animation on its UIScrollView. The effect it gives off is that there are views behind the scroll view that don't scroll with the scroll view. Rather, when the scroll view pages, they cross dissolve into one another.

  • This view has the ability to also add titles, and descriptions to each of the views a part of its scroll view.
  • Super lightweight, and customizable. All fonts, colors, etc are editable.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

    //This is an example.
    LGSublimationView *lgSublimer = [[LGSublimationView alloc]initWithFrame:self.view.bounds];
    
    //Optional protocol methods
    lgSublimer.delegate = self;

    //This is just for the purposes of the demo. You probably wouldn't do this.
    NSMutableArray*views = [NSMutableArray new];
    for (int i  = 1; i<=4; i++) {
        UIImageView *view = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
        view.image = [UIImage imageNamed:[NSString stringWithFormat:@"%i.jpg",i]];
        view.contentMode = UIViewContentModeScaleAspectFill;
        [views addObject:view];
    }
    
    //Based on how many views are in this array, will determine how many times you can scroll the scroll view which applies the sublime effect.
    lgSublimer.viewsToSublime = views;

    lgSublimer.titleLabelTextColor = [UIColor whiteColor];
    lgSublimer.descriptionLabelTextColor = [UIColor whiteColor];
    lgSublimer.titleLabelFont = [UIFont fontWithName:@"HelveticaNeue-Light" size:20];
    lgSublimer.descriptionLabelFont = [UIFont fontWithName:@"HelveticaNeue-UltraLight" size:20];
    
    //Titles are optional
    lgSublimer.titleStrings = @[@"This is title one",
                                @"This is title two",
                                @"This is title three",
                                @"This is title four"];
    
    //Descriptions are optional
    lgSublimer.descriptionStrings = @[@"This is a description of one",
                                      @"This is description two and also happens to be multi line, which is sweet"
                                      ,@"This is description three",
                                      @"follow luke on twitter @lukejgeiger"];
    
    
    
    // An optional assign property on the LGSublimer. You can use this if your views are images. It helps make the text appear more readable if there is a slight black tint over the view.
    UIView* shadeView = [[UIView alloc]initWithFrame:lgSublimer.frame];
    shadeView.backgroundColor = [UIColor blackColor];
    shadeView.alpha = .5;
    lgSublimer.inbetweenView = shadeView;
    
    [self.view addSubview:lgSublimer];

Installation

LGSublimationView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "LGSublimationView"

Author

Luke Geiger, [email protected]

License

LGSublimationView is available under the MIT license. See the LICENSE file for more info.

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.