LoremSwiftum

repository·master·Indexed 42 days ago

https://github.com/lukaskubanek/loremswiftum

A lightweight Swift library for generating random placeholder text, including words, sentences, paragraphs, names, emails, URLs, and tweets. Supports Swift 4.0+, Xcode 9.2+, iOS 8.0+, and macOS 10.10+.

Tokens
680
Snippets
3
Records
5
Agent score
3%

What's inside LoremSwiftum

  1. Install LoremSwiftum via Carthage

    master

    Add the following line to your Cartfile:

    github "lukaskubanek/LoremSwiftum"

    After running Carthage, drag either LoremSwiftum.xcodeproj or LoremSwiftum.framework into your Xcode project/workspace and link your target against LoremSwiftum.framework. Ensure the framework is copied into your application bundle.

  2. Install LoremSwiftum via Swift Package Manager

    master

    Add LoremSwiftum as a dependency in your Package.swift file using the following URL and version constraint.

    let package = Package(
        ...
        dependencies: [
            .package(url: "https://github.com/lukaskubanek/LoremSwiftum.git", from: "2.2.1")
        ],
        ...
    )
  3. Generate random text with Lorem

    master

    Import LoremSwiftum and use the Lorem static properties to generate various types of placeholder text. The library supports single items (e.g., .word, .sentence) and multiple items by passing an integer argument (e.g., .words(3), .sentences(3)).

    import LoremSwiftum
    
    Lorem.word
    // => One random word
    
    Lorem.words(3)
    // => Three random words
    
    Lorem.sentence
    // => One random sentence
    
    Lorem.sentences(3)
    // => Three random sentences
    
    Lorem.paragraph
    // => One random paragraph
    
    Lorem.paragraphs(3)
    // => Three random paragraphs
    
    Lorem.title
    // => A random title
    
    Lorem.firstName
    // => A random first name
    
    Lorem.lastName
    // => A random last name
    
    Lorem.fullName
    // => A random full name
    
    Lorem.emailAddress
    // => A random email address
    
    Lorem.url
    // => A random URL
    
    Lorem.shortTweet
    // => A random short tweet
    
    Lorem.tweet
    // => A random long tweet
  4. LoremSwiftum Requirements

    master

    To use LoremSwiftum, ensure your environment meets the following requirements:

    • Swift: 4.0+
    • Xcode: 9.2+
    • iOS: 8.0+
    • macOS: 10.10+

    Note: Xcode and OS requirements apply only when integrating the library as a framework or via an Xcode project.