SFTextReader

Objective-C

@interface SFTextReader : NSObject

Swift

class SFTextReader : NSObject

Read through text string

  • Initialize

    Declaration

    Objective-C

    - (instancetype)initWithText:(NSString *)text;

    Swift

    init!(text: String!)

    Parameters

    text

    text

    Return Value

    new text reader

  • Get the text

    Declaration

    Objective-C

    - (NSString *)text;

    Swift

    func text() -> String!

    Return Value

    text

  • Read the next token. Ignores whitespace until a non whitespace character is encountered. Returns a contiguous block of token characters ( [a-z] | [A-Z] | [0-9] | - | . | + ) or a non whitespace single character.

    Declaration

    Objective-C

    - (NSString *)readToken;

    Swift

    func readToken() -> String!

    Return Value

    token

  • Peek at the next token without reading past it

    Declaration

    Objective-C

    - (NSString *)peekToken;

    Swift

    func peekToken() -> String!

    Return Value

    next token

  • Read a double

    Declaration

    Objective-C

    - (double)readDouble;

    Swift

    func readDouble() -> Double

    Return Value

    double