Git Product home page Git Product logo

mflfillabletextloader's Introduction

MFLFillableTextLoader

Loading/progress indicator based on filling stroked text.

Code Example

You can create an MFLFillableTextLoader either in a xib or in code. Here is a short code example:

  //Main text that will be stroked and filled.
    self.loader = [[MFLFillableTextLoader alloc] initWithString:@"Loading..."
                                                         font:[UIFont boldSystemFontOfSize:28]
                                                    alignment:NSTextAlignmentCenter
                                                    withFrame:CGRectMake(0, 0, 320, 400)];

  //Subheading displayed describing load
    NSAttributedString *details = [[NSAttributedString alloc] initWithString:@"Never tell me the odds."];
    [self.loader setDetailText:details];
    
  //Set the font used for the percentage of the load displayed.
    [self.loader setProgressFont:[UIFont systemFontOfSize:18]];
    
  //Properties used for stroking/filling the text.
    [self.loader setStrokeColor:UIColorFromRGB(0xe5b13a)];
    [self.loader setStrokeWidth:4];

Usage

After creation, you can then add it to a UIView as a subview, and update the progress as you need to. It will automatically update it's fill.

    [self.view addSubview:self.loader];
    [self.loader setProgress:<Progress 0.0 - 1.0>];

Further Customization

You can find a much more detailed example in the sample project found in this repo, with examples of both xib creation and in code, as well as an example animation to use.

mflfillabletextloader's People

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.