### Install LoremSwiftum via Swift Package Manager Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Add LoremSwiftum as a dependency in your Package.swift file and import it into your Swift files. ```swift import PackageDescription let package = Package( name: "MyApp", dependencies: [ .package(url: "https://github.com/lukaskubanek/LoremSwiftum.git", from: "2.2.1") ], targets: [ .target(name: "MyApp", dependencies: ["LoremSwiftum"]) ] ) ``` -------------------------------- ### Populating SwiftUI Views with Placeholder Data Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Integrate LoremSwiftum into SwiftUI previews to replace hardcoded strings with realistic placeholder content across the UI. This example shows populating an `ArticleCard` view. ```swift import SwiftUI import LoremSwiftum struct ArticleCard: View { let title: String let body: String let author: String let email: String var body: some View { VStack(alignment: .leading, spacing: 8) { Text(title).font(.headline) Text(body).font(.body).lineLimit(3) Label("\(author) — \(email)", systemImage: "person") .font(.caption) .foregroundColor(.secondary) } .padding() } } struct ArticleCard_Previews: PreviewProvider { static var previews: some View { ArticleCard( title: Lorem.title, body: Lorem.paragraph, author: Lorem.fullName, email: Lorem.emailAddress ) .previewLayout(.sizeThatFits) } } ``` -------------------------------- ### Generating Collections of Placeholder Model Objects Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use LoremSwiftum to seed data layers (Core Data, JSON, in-memory stores) with varied, realistic test records. This example demonstrates creating an array of `UserProfile` objects. ```swift import Foundation import LoremSwiftum struct UserProfile { let id: UUID let name: String let email: String let bio: String let profileURL: String } func makeSampleProfiles(count: Int) -> [UserProfile] { return (0.. Vanessa Holloway | vanessa.holloway@gmail.com // Bio: Dolores eos qui ratione voluptatem. Neque dolorem ipsum quia dolor sit amet. // URL: https://wikipedia.org ``` -------------------------------- ### Generate a single random word Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.word to get a single random lorem ipsum word as a String. Ensure LoremSwiftum is imported. ```swift import LoremSwiftum let word = Lorem.word print(word) // => "consequatur" ``` -------------------------------- ### Lorem.sentences(_:) Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates multiple sentences joined by a space. Supports exact Int, Range, and ClosedRange arguments. ```APIDOC ## Lorem.sentences(_:) — Multiple sentences (fixed count or range) ### Description Generates multiple sentences joined by a space. Supports exact `Int`, `Range`, and `ClosedRange` arguments. ### Usage ```swift import LoremSwiftum // Exact count let twoSentences = Lorem.sentences(2) print(twoSentences) // => "Quia dolor sit amet consectetur. Ut enim ad minima veniam quis." // Range let rangeSentences = Lorem.sentences(1..<4) print(rangeSentences) // => "Sed quia non numquam eius modi." // Closed range let closedSentences = Lorem.sentences(1...3) print(closedSentences) // => "Nemo enim ipsam voluptatem. Quia voluptas sit suscipit laboriosam nisi." ``` ``` -------------------------------- ### Lorem.words(_:) Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates a space-joined string of lorem-ipsum words. Accepts an exact Int count, a half-open Range, or a ClosedRange for a random count within the range. ```APIDOC ## Lorem.words(_:) — Multiple words (fixed count or range) ### Description Generates a space-joined string of lorem-ipsum words. Accepts an exact `Int` count, a half-open `Range`, or a `ClosedRange` for a random count within the range. ### Usage ```swift import LoremSwiftum // Exact count let threeWords = Lorem.words(3) print(threeWords) // => "dolorem ipsum quia" // Half-open range: randomly picks 2, 3, or 4 words let rangeWords = Lorem.words(2..<5) print(rangeWords) // => "sit amet" // Closed range: randomly picks 2, 3, or 4 words let closedRangeWords = Lorem.words(2...4) print(closedRangeWords) // => "dolor sit amet consectetur" ``` ``` -------------------------------- ### Lorem.word Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Returns one random lorem-ipsum word from the built-in vocabulary as a String. ```APIDOC ## Lorem.word — Single random word ### Description Returns one random lorem-ipsum word from the built-in vocabulary as a `String`. ### Usage ```swift import LoremSwiftum let word = Lorem.word print(word) // => "consequatur" ``` ``` -------------------------------- ### Lorem.paragraphs(_:) Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates multiple paragraphs separated by double newlines (\n\n). Supports exact Int, Range, and ClosedRange arguments. ```APIDOC ## Lorem.paragraphs(_:) — Multiple paragraphs (fixed count or range) ### Description Generates multiple paragraphs separated by double newlines (`\n\n`). Supports exact `Int`, `Range`, and `ClosedRange` arguments. ### Usage ```swift import LoremSwiftum // Exact count let twoParagraphs = Lorem.paragraphs(2) print(twoParagraphs) // => "Dolores eos qui ratione... amet.\n\nUt enim ad minima..." // Range let rangeParagraphs = Lorem.paragraphs(1..<4) print(rangeParagraphs) // => (1, 2, or 3 paragraphs separated by \n\n) // Closed range let closedParagraphs = Lorem.paragraphs(2...4) print(closedParagraphs) // => (2, 3, or 4 paragraphs separated by \n\n) ``` ``` -------------------------------- ### Generate multiple words Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.words() to generate a space-joined string of lorem ipsum words. Accepts an exact Int count, a half-open Range, or a ClosedRange for a random count. ```swift import LoremSwiftum // Exact count let threeWords = Lorem.words(3) print(threeWords) // => "dolorem ipsum quia" // Half-open range: randomly picks 2, 3, or 4 words let rangeWords = Lorem.words(2..<5) print(rangeWords) // => "sit amet" // Closed range: randomly picks 2, 3, or 4 words let closedRangeWords = Lorem.words(2...4) print(closedRangeWords) // => "dolor sit amet consectetur" ``` -------------------------------- ### Add LoremSwiftum Dependency with Swift Package Manager Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Integrate LoremSwiftum into your project by adding its Git repository URL to your Package.swift file's dependencies. ```swift let package = Package( ... dependencies: [ .package(url: "https://github.com/lukaskubanek/LoremSwiftum.git", from: "2.2.1") ], ... ) ``` -------------------------------- ### Generate multiple sentences Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.sentences() to generate multiple sentences joined by a space. Supports exact Int, Range, and ClosedRange arguments. ```swift import LoremSwiftum // Exact count let twoSentences = Lorem.sentences(2) print(twoSentences) // => "Quia dolor sit amet consectetur. Ut enim ad minima veniam quis." // Range let rangeSentences = Lorem.sentences(1..<4) print(rangeSentences) // => "Sed quia non numquam eius modi." // Closed range let closedSentences = Lorem.sentences(1...3) print(closedSentences) // => "Nemo enim ipsam voluptatem. Quia voluptas sit suscipit laboriosam nisi." ``` -------------------------------- ### Generate a random title Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.title to generate a title-cased string of 2-7 random lorem ipsum words, suitable for headings. ```swift import LoremSwiftum let title = Lorem.title print(title) // => "Quaerat Voluptatem Ut Enim" ``` -------------------------------- ### Lorem.sentence Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates one sentence: a randomly-selected number of words (4–16), joined by spaces, with the first letter capitalized and terminated with a period. ```APIDOC ## Lorem.sentence — Single random sentence ### Description Generates one sentence: a randomly-selected number of words (4–16), joined by spaces, with the first letter capitalized and terminated with a period. ### Usage ```swift import LoremSwiftum let sentence = Lorem.sentence print(sentence) // => "Dolores eos qui ratione voluptatem sequi nesciunt." ``` ``` -------------------------------- ### Add LoremSwiftum Dependency with Carthage Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Specify LoremSwiftum as a dependency in your Cartfile for integration using Carthage. ```plaintext github "lukaskubanek/LoremSwiftum" ``` -------------------------------- ### Lorem.paragraph Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates one paragraph consisting of 3–9 randomly-generated sentences, joined by spaces. ```APIDOC ## Lorem.paragraph — Single random paragraph ### Description Generates one paragraph consisting of 3–9 randomly-generated sentences, joined by spaces. ### Usage ```swift import LoremSwiftum let paragraph = Lorem.paragraph print(paragraph) // => "Dolores eos qui ratione voluptatem sequi nesciunt. Neque dolorem ipsum quia dolor sit. Ut labore et dolore magnam aliquam quaerat." ``` ``` -------------------------------- ### Lorem.title Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Generates a title-cased string of 2–7 random lorem-ipsum words suitable for use as a section heading or document title. ```APIDOC ## Lorem.title — Random capitalized title ### Description Generates a title-cased string of 2–7 random lorem-ipsum words suitable for use as a section heading or document title. ### Usage ```swift import LoremSwiftum let title = Lorem.title print(title) // => "Quaerat Voluptatem Ut Enim" ``` ``` -------------------------------- ### Generate Random Names with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a random first name using `Lorem.firstName`, a last name using `Lorem.lastName`, or a full name using `Lorem.fullName`. ```swift Lorem.firstName // => A random first name ``` ```swift Lorem.lastName // => A random last name ``` ```swift Lorem.fullName // => A random full name ``` -------------------------------- ### Generate Random Tweet-Length Strings with LoremSwiftum Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use `Lorem.shortTweet` for strings under 140 characters and `Lorem.tweet` for strings under 280 characters. Both are composed of 1-4 sentences and are useful for simulating social media content. ```swift import LoremSwiftum let short = Lorem.shortTweet print(short) print("Length: \(short.count)") // Length < 140 let long = Lorem.tweet print(long) print("Length: \(long.count)") // Length < 280 ``` -------------------------------- ### Generate Random URL with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a random URL using the `Lorem.url` property. ```swift Lorem.url // => A random URL ``` -------------------------------- ### Generate a single random paragraph Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.paragraph to generate a paragraph consisting of 3-9 randomly generated sentences, joined by spaces. ```swift import LoremSwiftum let paragraph = Lorem.paragraph print(paragraph) // => "Dolores eos qui ratione voluptatem sequi nesciunt. Neque dolorem ipsum quia dolor sit. Ut labore et dolore magnam aliquam quaerat." ``` -------------------------------- ### Generate multiple paragraphs Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.paragraphs() to generate multiple paragraphs separated by double newlines (\n\n). Supports exact Int, Range, and ClosedRange arguments. ```swift import LoremSwiftum // Exact count let twoParagraphs = Lorem.paragraphs(2) print(twoParagraphs) // => "Dolores eos qui ratione... amet.\n\nUt enim ad minima..." // Range let rangeParagraphs = Lorem.paragraphs(1..<4) print(rangeParagraphs) // => (1, 2, or 3 paragraphs separated by \n\n) // Closed range let closedParagraphs = Lorem.paragraphs(2...4) print(closedParagraphs) // => (2, 3, or 4 paragraphs separated by \n\n) ``` -------------------------------- ### Generate a single random sentence Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Use Lorem.sentence to generate a single sentence. The sentence will have a random number of words (4-16), with the first letter capitalized and a period at the end. ```swift import LoremSwiftum let sentence = Lorem.sentence print(sentence) // => "Dolores eos qui ratione voluptatem sequi nesciunt." ``` -------------------------------- ### Generate Random Email Address with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a random email address using the `Lorem.emailAddress` property. ```swift Lorem.emailAddress // => A random email address ``` -------------------------------- ### Generate Random Sentences with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a single random sentence using `Lorem.sentence` or multiple sentences with `Lorem.sentences(count)`. ```swift Lorem.sentence // => One random sentence ``` ```swift Lorem.sentences(3) // => Three random sentences ``` -------------------------------- ### Generate Random Paragraphs with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a single random paragraph using `Lorem.paragraph` or multiple paragraphs with `Lorem.paragraphs(count)`. ```swift Lorem.paragraph // => One random paragraph ``` ```swift Lorem.paragraphs(3) // => Three random paragraphs ``` -------------------------------- ### Lorem.firstName / Lorem.lastName / Lorem.fullName Source: https://context7.com/lukaskubanek/loremswiftum/llms.txt Returns a random first name, last name, or combined full name drawn from built-in lists of common English names. ```APIDOC ## Lorem.firstName / Lorem.lastName / Lorem.fullName — Random names ### Description Returns a random first name, last name, or combined full name drawn from built-in lists of common English names. ### Usage ```swift import LoremSwiftum print(Lorem.firstName) // => "Vanessa" print(Lorem.lastName) // => "Holloway" print(Lorem.fullName) // => "Brayden Sutton" ``` ``` -------------------------------- ### Generate Random Title with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Use `Lorem.title` to generate a random title. ```swift Lorem.title // => A random title ``` -------------------------------- ### Generate Random Words with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Use the `Lorem.word` property to generate a single random word or `Lorem.words(count)` to generate multiple words. ```swift Lorem.word // => One random word ``` ```swift Lorem.words(3) // => Three random words ``` -------------------------------- ### Generate Random Tweets with LoremSwiftum Source: https://github.com/lukaskubanek/loremswiftum/blob/master/README.md Generate a random short tweet using `Lorem.shortTweet` or a longer tweet using `Lorem.tweet`. ```swift Lorem.shortTweet // => A random short tweet ``` ```swift Lorem.tweet // => A random long tweet ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.