GithubHelp home page GithubHelp logo

bekzattt / afspritz Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sumitmundra/afspritz

0.0 2.0 0.0 1.56 MB

A complete Spritz SDK for iOS

License: MIT License

Ruby 1.22% Objective-C 91.97% C 0.73% Shell 6.08%

afspritz's Introduction

AFSpritz

A complete Spritz SDK for iOS

alt text

##CocoaPods

AFSpritz is on CocoaPods, so you can get the pod by adding this line to your Podfile

pod 'AFSpritz', '~> 1.3'

If not, just import these files to your project:

AFSpritzManager.h
AFSpritzManager.m
AFSpritzWords.h
AFSpritzWords.m
AFSpritzLabel.h
AFSpritzLabel.m
NSTimer+Blocks.h
NSTimer+Blocks.m
NSTimer+Control.h
NSTimer+Control.m

##Usage

First of all, import AFSpritzManager.h to your class

#import "AFSpritzManager.h"

Initialise AFSpritzManager assigning a text and a number of words per minute, that will determine the speed of the reading. Theorically, there's no limit, but the more confortable speed is 200-250 words per minute. However, Spritz is made for let you read more than 500 words per minute.

AFSpritzManager *manager = [[AFSpritzManager alloc]initWithText:@"Welcome to AFSpritz! Spritz is a brand new revolutionary reading method that will help you to improve your number of words per minute. Take a look at AFSpritz!" andWordsPerMinute:250];

Then, call the block that will update the Spritz label

[manager updateLabelWithNewWordAndCompletion:^(AFSpritzWords *word, BOOL finished) {

    if (!finished) {

		//Update the AFSpritzLabel

    } else {
        NSLog(@"Finished!");
    }
}];

###Checking the status

typedef NS_ENUM(int, AFSpritzStatus) {
	AFSpritzStatusStopped,
	AFSpritzStatusReading,
	AFSpritzStatusNotStarted,
	AFSpritzStatusFinished
};

AFSpritz has the feature of checking in each moment the status of the reading using -status:.

Example:

if ([manager status:AFSpritzStatusReading]) {
	// The current status is reading
} else if ([manager status:AFSpritzStatusNotStarted]) {
	// The current status is not started yet
}  else if ([manager AFSpritzStatusStopped]) {
	// The current status is stopped, so it can be resumed
} else if ([manager AFSpritzStatusFinished]) {
	// The current status is finished
}

###Pausing and resuming

Now you can pause and resume your reading just calling these two methods:

[manager pauseReading];

[manager resumeReading];

##AFSpritzLabel API

AFSpritzLabel is an incredible, well crafted and 100% AFSpritzWords-compatible UIView subclass that will let you show your Spritz reading.

You can customize many properties from AFSpritzLabel, such as:

Property Class Required Default Description
word AFSpritzWords Yes nil Determines the AFSpritzWords-subclassed word to show.
markerColor UIColor No Red Determines the color of the letter you're supposed to be focused on.
markeringLinesColor UIColor No Black Determines the color of the lines around the word.
textColor UIColor No Black Determines the color of the text.
textFont UIFont No System font with size 20 Determines the font of the text.
backgroundColor UIColor No White Determines the color of the background.

##Wishlist

  1. Customize speed throught the number of words per minute.

  2. Stop and resume the reading.

  3. Add a little stop when there's a stop on the text (. โ€ฆ : , ! ?).

  4. Restart the reading.

##Author

Made by Alvaro Franco. If you have any question, feel free to drop me a line at [email protected]

afspritz's People

Contributors

alvarofranco avatar

Watchers

 avatar  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.