Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukaskubanek/LoremSwiftum
A lightweight lorem ipsum generator for Swift
https://github.com/lukaskubanek/LoremSwiftum
ios lorem-ipsum swift
Last synced: 3 months ago
JSON representation
A lightweight lorem ipsum generator for Swift
- Host: GitHub
- URL: https://github.com/lukaskubanek/LoremSwiftum
- Owner: lukaskubanek
- License: mit
- Created: 2014-10-08T16:21:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T23:23:10.000Z (9 months ago)
- Last Synced: 2024-04-14T13:31:55.755Z (7 months ago)
- Topics: ios, lorem-ipsum, swift
- Language: Swift
- Homepage:
- Size: 92.8 KB
- Stars: 205
- Watchers: 2
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# LoremSwiftum
LoremSwiftum is a lightweight lorem ipsum generator library for Swift. It supports generating random words, sentences, paragraphs, titles, names, email addresses, URLs, and tweets. Initially, this library was created as a Swift port of [LoremIpsum](https://github.com/lukaskubanek/LoremIpsum) written in Objective-C.
## Requirements
- Swift 4.0+
- Xcode 9.2+
- iOS 8.0+ / macOS 10.10+*The Xcode and OS requirements apply only when the library is integrated as a framework or via the Xcode project.*
## Installation
### Swift Package Manager
To install LoremSwiftum using the [Swift Package Manager](https://swift.org/package-manager/), add it as a dependency into your `Package.swift` file:
```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/lukaskubanek/LoremSwiftum.git", from: "2.2.1")
],
...
)
```### Carthage
To install LoremSwiftum using [Carthage](https://github.com/Carthage/Carthage), add it as a dependency into your `Cartfile`:
```plain
github "lukaskubanek/LoremSwiftum"
```Then drag either the `LoremSwiftum.xcodeproj` or the `LoremSwiftum.framework` into your Xcode project/workspace and link your target against the `LoremSwiftum.framework`. Make sure that the framework [gets copied](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to your application bundle.
### Git Submodules
You can also install LoremSwiftum via [Git submodules](http://git-scm.com/book/en/v2/Git-Tools-Submodules) and integrate the project `LoremSwiftum.xcodeproj` from the submodule directly into your Xcode workspace.
## Usage
```swift
import LoremSwiftumLorem.word
// => One random wordLorem.words(3)
// => Three random wordsLorem.sentence
// => One random sentenceLorem.sentences(3)
// => Three random sentencesLorem.paragraph
// => One random paragraphLorem.paragraphs(3)
// => Three random paragraphsLorem.title
// => A random titleLorem.firstName
// => A random first nameLorem.lastName
// => A random last nameLorem.fullName
// => A random full nameLorem.emailAddress
// => A random email addressLorem.url
// => A random URLLorem.shortTweet
// => A random short tweetLorem.tweet
// => A random long tweet
```