GithubHelp home page GithubHelp logo

martinblampied / mbtwitterscroll Goto Github PK

View Code? Open in Web Editor NEW
420.0 15.0 58.0 160 KB

Recreate Twitter's profile page scrolling animation for UITableView and UIScrollViews.

License: MIT License

Ruby 1.96% Objective-C 98.04%
uitableview objective-c twitter uiscrollview animation

mbtwitterscroll's Introduction

MBTwitterScroll

========== Recreate Twitter's profile page scrolling animation for UITableView and UIScrollViews. Librarys uses Core graphics framework and is based of thinkandbuild.it's swift tutorial converted into Obj-C.

alt tag

Twitter: @martinblampied Version License Platform

Installation

From CocoaPods

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

pod "MBTwitterScroll"

Manually

Copy the source files MBTwitterScroll folder into your project.

Usage

Import the project

   #import "MBTwitterScroll.h"

UITableView

To show animation on UITableVIew use the following code:

    MBTwitterScroll *myTableView = [[MBTwitterScroll alloc]
                                    initTableViewWithBackgound:[UIImage imageNamed:@"your image"]
                                    avatarImage:[UIImage imageNamed:@"your avatar"]
                                    titleString:@"Main title"
                                    subtitleString:@"Sub title"
                                    buttonTitle:@"Follow"];  // Set nil for no button
    myTableView.delegate = self;
    [self.view addSubview:myTableView];

UIScrollView

To show animation on UIScrollView use the following code:

   MBTwitterScroll *myScrollView = [[MBTwitterScroll alloc]
                                      initScrollViewWithBackgound:nil
                                      avatarImage:[UIImage imageNamed:@"avatar.png"]
                                      titleString:@"Main title"
                                      subtitleString:@"Sub title"
                                      buttonTitle:@"Follow" // // Set nil for no button
                                      contentHeight:2000];
    myScrollView.delegate = self;
    [self.view addSubview:myScrollView];

License

MBTwitterScroll is free for all use available under the MIT license. See the LICENSE file for more information.

Feedback or feature request?

Any problems or features contact me at @martinblampied

mbtwitterscroll's People

Contributors

martinblampied avatar zozman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mbtwitterscroll's Issues

memory leak

I got memory leak because the observer for "contentOffset" was never removed.

So I added this in MBTwitterScroll.m

  • (void) dealloc {
    [self.tableView removeObserver:self forKeyPath:@"contentOffset"];
    }

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.