{"id":"da6ee795-7134-4740-9538-c148668d6cf3","shortId":"5drTJa","kind":"skill","title":"Swift Language","tagline":"Swift Ios Skills skill by Dpearson2699","description":"# Swift Language Patterns\n\nCore Swift language features and modern syntax patterns targeting Swift 6.3. Covers language constructs, type system features, Codable,\nstring and collection APIs, formatting, C interop (`@c`), module disambiguation (`ModuleName::symbol`), and performance attributes (`@specialized`, `@inline(always)`). For concurrency (actors, async/await,\nSendable), see the `swift-concurrency` skill. For SwiftUI views and state\nmanagement, see `swiftui-patterns`.\n\n## Contents\n\n- [If/Switch Expressions](#ifswitch-expressions)\n- [Typed Throws](#typed-throws)\n- [Result Builders](#result-builders)\n- [Property Wrappers](#property-wrappers)\n- [Opaque and Existential Types](#opaque-and-existential-types)\n- [Guard Patterns](#guard-patterns)\n- [Never Type](#never-type)\n- [Regex Builders](#regex-builders)\n- [Codable Best Practices](#codable-best-practices)\n- [Modern Collection APIs](#modern-collection-apis)\n- [FormatStyle](#formatstyle)\n- [String Interpolation](#string-interpolation)\n- [Common Mistakes](#common-mistakes)\n- [Review Checklist](#review-checklist)\n- [References](#references)\n\n## If/Switch Expressions\n\nSwift 5.9+ allows `if` and `switch` as expressions that return values. Use them\nto assign, return, or initialize directly.\n\n```swift\n// Assign from if expression\nlet icon = if isComplete { \"checkmark.circle.fill\" } else { \"circle\" }\n\n// Assign from switch expression\nlet label = switch status {\ncase .draft: \"Draft\"\ncase .published: \"Published\"\ncase .archived: \"Archived\"\n}\n\n// Works in return position\nfunc color(for priority: Priority) -> Color {\n    switch priority {\n    case .high: .red\n    case .medium: .orange\n    case .low: .green\n    }\n}\n```\n\n**Rules:**\n- Every branch must produce a value of the same type.\n- Multi-statement branches are not allowed -- each branch is a single expression.\n- Wrap in parentheses when used as a function argument to avoid ambiguity.\n\n## Typed Throws\n\nSwift 6+ allows specifying the error type a function throws.\n\n```swift\nenum ValidationError: Error {\n    case tooShort, invalidCharacters, alreadyTaken\n}\n\nfunc validate(username: String) throws(ValidationError) -> String {\n    guard username.count >= 3 else { throw .tooShort }\n    guard username.allSatisfy(\\.isLetterOrDigit) else { throw .invalidCharacters }\n    return username.lowercased()\n}\n\n// Caller gets typed error -- no cast needed\ndo {\n    let name = try validate(username: input)\n} catch {\n    // error is ValidationError, not any Error\n    switch error {\n    case .tooShort: print(\"Too short\")\n    case .invalidCharacters: print(\"Invalid characters\")\n    case .alreadyTaken: print(\"Taken\")\n    }\n}\n```\n\n**Rules:**\n- Use `throws(SomeError)` only when callers benefit from exhaustive error\n  handling. For mixed error sources, use untyped `throws`.\n- `throws(Never)` marks a function that syntactically throws but never actually\n  does -- useful in generic contexts.\n- Typed throws propagate: a function calling `throws(A)` and `throws(B)` must\n  itself throw a type that covers both (or use untyped `throws`).\n\n## Result Builders\n\n`@resultBuilder` enables DSL-style syntax. SwiftUI's `@ViewBuilder` is the most\ncommon example, but you can create custom builders for any domain.\n\n```swift\n@resultBuilder\nstruct ArrayBuilder<Element> {\n    static func buildBlock(_ components: [Element]...) -> [Element] {\n        components.flatMap { $0 }\n    }\n    static func buildExpression(_ expression: Element) -> [Element] { [expression] }\n    static func buildOptional(_ component: [Element]?) -> [Element] { component ?? [] }\n    static func buildEither(first component: [Element]) -> [Element] { component }\n    static func buildEither(second component: [Element]) -> [Element] { component }\n    static func buildArray(_ components: [[Element]]) -> [Element] { components.flatMap { $0 } }\n}\n\nfunc makeItems(@ArrayBuilder<String> content: () -> [String]) -> [String] { content() }\n\nlet items = makeItems {\n    \"Always included\"\n    if showExtra { \"Conditional\" }\n    for name in names { name.uppercased() }\n}\n```\n\n**Builder methods:** `buildBlock` (combine statements), `buildExpression` (single value), `buildOptional` (`if` without `else`), `buildEither` (`if/else`), `buildArray` (`for..in`), `buildFinalResult` (optional post-processing).\n\n## Property Wrappers\n\nCustom `@propertyWrapper` types encapsulate storage and access patterns.\n\n```swift\n@propertyWrapper\nstruct Clamped<Value: Comparable> {\n    private var value: Value\n    let range: ClosedRange<Value>\n\n    var wrappedValue: Value {\n        get { value }\n        set { value = min(max(newValue, range.lowerBound), range.upperBound) }\n    }\n\n    var projectedValue: ClosedRange<Value> { range }\n\n    init(wrappedValue: Value, _ range: ClosedRange<Value>) {\n        self.range = range\n        self.value = min(max(wrappedValue, range.lowerBound), range.upperBound)\n    }\n}\n\n// Usage\nstruct Volume {\n    @Clamped(0...100) var level: Int = 50\n}\n\nvar v = Volume()\nv.level = 150   // clamped to 100\nprint(v.$level) // projected value: 0...100\n```\n\n**Design rules:**\n- `wrappedValue` is the primary getter/setter.\n- `projectedValue` (accessed via `$property`) provides metadata or bindings.\n- Property wrappers can be composed: `@A @B var x` applies outer wrapper first.\n- Do not use property wrappers when a simple computed property suffices.\n\n## Opaque and Existential Types\n\n### `some Protocol` (Opaque Type)\n\nThe caller does not know the concrete type, but the compiler does. The\nunderlying type is fixed for a given scope.\n\n```swift\nfunc makeCollection() -> some Collection<Int> {\n    [1, 2, 3]  // Always returns Array<Int> -- compiler knows the concrete type\n}\n```\n\nUse `some` for:\n- Return types when you want to hide implementation but preserve type identity.\n- Parameter types (Swift 5.9+): `func process(_ items: some Collection<Int>)` --\n  equivalent to a generic `<C: Collection<Int>>`.\n\n### `any Protocol` (Existential Type)\n\nAn existential box that can hold any conforming type at runtime. Has overhead\nfrom dynamic dispatch and heap allocation.\n\n```swift\nfunc process(items: [any StringProtocol]) {\n    for item in items {\n        print(item.uppercased())\n    }\n}\n```\n\n### When to choose\n\n| Use `some` | Use `any` |\n|---|---|\n| Return type hiding concrete type | Heterogeneous collections |\n| Function parameters (replaces simple generics) | Dynamic type erasure needed |\n| Better performance (static dispatch) | Protocol has `Self` or associated type requirements you need to erase |\n\n**Rule of thumb:** Default to `some`. Use `any` only when you need a\nheterogeneous collection or runtime type flexibility.\n\n## Guard Patterns\n\n`guard` enforces preconditions and enables early exit. It keeps the happy path\nleft-aligned and reduces nesting.\n\n```swift\nfunc processOrder(_ order: Order?) throws -> Receipt {\n    // Unwrap optionals\n    guard let order else { throw OrderError.missing }\n\n    // Validate conditions\n    guard order.items.isEmpty == false else { throw OrderError.empty }\n    guard order.total > 0 else { throw OrderError.invalidTotal }\n\n    // Boolean checks\n    guard order.isPaid else { throw OrderError.unpaid }\n\n    // Pattern matching\n    guard case .confirmed(let date) = order.status else {\n        throw OrderError.notConfirmed\n    }\n\n    return Receipt(order: order, confirmedAt: date)\n}\n```\n\n**Best practices:**\n- Use `guard` for preconditions, `if` for branching logic.\n- Combine related guards: `guard let a, let b else { return }`.\n- The `else` block must exit scope: `return`, `throw`, `continue`, `break`, or\n  `fatalError()`.\n- Use shorthand unwrap: `guard let value else { ... }` (Swift 5.7+).\n\n## Never Type\n\n`Never` indicates a function that never returns. It conforms to all protocols\nsince Swift 5.5+ (bottom type).\n\n```swift\n// Function that terminates the program\nfunc crashWithDiagnostics(_ message: String) -> Never {\n    let diagnostics = gatherDiagnostics()\n    logger.critical(\"\\(message): \\(diagnostics)\")\n    fatalError(message)\n}\n\n// Useful in generic contexts\nenum Result<Success, Failure: Error> {\n    case success(Success)\n    case failure(Failure)\n}\n// Result<String, Never> -- a result that can never fail\n// Result<Never, Error>  -- a result that can never succeed\n\n// Exhaustive switch: no default needed since Never has no cases\nfunc handle(_ result: Result<String, Never>) {\n    switch result {\n    case .success(let value): print(value)\n    // No .failure case needed -- compiler knows it's impossible\n    }\n}\n```\n\n## Regex Builders\n\nSwift 5.7+ Regex builder DSL provides compile-time checked, readable patterns.\n\n```swift\nimport RegexBuilder\n\n// Parse \"2024-03-15\" into components\nlet dateRegex = Regex {\n    Capture { /\\d{4}/ }; \"-\"; Capture { /\\d{2}/ }; \"-\"; Capture { /\\d{2}/ }\n}\n\nif let match = \"2024-03-15\".firstMatch(of: dateRegex) {\n    let (_, year, month, day) = match.output\n}\n\n// TryCapture with transform\nlet priceRegex = Regex {\n    \"$\"\n    TryCapture { OneOrMore(.digit); \".\"; Repeat(.digit, count: 2) }\n        transform: { Decimal(string: String($0)) }\n}\n```\n\n**When to use builder vs. literal:**\n- Builder: complex patterns, reusable components, strong typing on captures.\n- Literal (`/pattern/`): simple patterns, familiarity with regex syntax.\n- Both can be mixed: embed `/.../` literals inside builder blocks.\n\n## Codable Best Practices\n\n### Custom CodingKeys\n\nRename keys without writing a custom decoder:\n\n```swift\nstruct User: Codable {\n    let id: Int\n    let displayName: String\n    let avatarURL: URL\n\n    enum CodingKeys: String, CodingKey {\n        case id\n        case displayName = \"display_name\"\n        case avatarURL = \"avatar_url\"\n    }\n}\n```\n\n### Custom Decoding\n\nHandle mismatched types, defaults, and transformations:\n\n```swift\nstruct Item: Decodable {\n    let name: String\n    let quantity: Int\n    let isActive: Bool\n\n    init(from decoder: Decoder) throws {\n        let container = try decoder.container(keyedBy: CodingKeys.self)\n        name = try container.decode(String.self, forKey: .name)\n        quantity = try container.decodeIfPresent(Int.self, forKey: .quantity) ?? 0\n        if let boolValue = try? container.decode(Bool.self, forKey: .isActive) {\n            isActive = boolValue\n        } else {\n            isActive = (try container.decode(String.self, forKey: .isActive)).lowercased() == \"true\"\n        }\n    }\n    enum CodingKeys: String, CodingKey { case name, quantity; case isActive = \"is_active\" }\n}\n```\n\n### Nested Containers\n\nFlatten nested JSON into a flat Swift struct:\n\n```swift\n// JSON: { \"id\": 1, \"metadata\": { \"created_at\": \"...\", \"tags\": [...] } }\nstruct Record: Decodable {\n    let id: Int\n    let createdAt: String\n    let tags: [String]\n\n    enum CodingKeys: String, CodingKey {\n        case id, metadata\n    }\n\n    enum MetadataKeys: String, CodingKey {\n        case createdAt = \"created_at\"\n        case tags\n    }\n\n    init(from decoder: Decoder) throws {\n        let container = try decoder.container(keyedBy: CodingKeys.self)\n        id = try container.decode(Int.self, forKey: .id)\n        let metadata = try container.nestedContainer(\n            keyedBy: MetadataKeys.self, forKey: .metadata)\n        createdAt = try metadata.decode(String.self, forKey: .createdAt)\n        tags = try metadata.decode([String].self, forKey: .tags)\n    }\n}\n```\n\nSee [references/swift-patterns-extended.md](references/swift-patterns-extended.md) for additional Codable patterns\n(enums with associated values, date strategies, unkeyed containers).\n\n## Modern Collection APIs\n\nPrefer these modern APIs over manual loops:\n\n```swift\nlet numbers = [1, 2, 3, 4, 5, 6, 7, 8]\n\n// count(where:) -- Swift 5.0+, use instead of .filter { }.count\nlet evenCount = numbers.count(where: { $0.isMultiple(of: 2) })\n\n// contains(where:) -- short-circuits on first match\nlet hasNegative = numbers.contains(where: { $0 < 0 })\n\n// first(where:) / last(where:)\nlet firstEven = numbers.first(where: { $0.isMultiple(of: 2) })\n\n// String replacing() -- Swift 5.7+, returns new string\nlet cleaned = rawText.replacing(/\\s+/, with: \" \")\nlet snakeCase = name.replacing(\"_\", with: \" \")\n\n// compactMap -- unwrap optionals from a transform\nlet ids = strings.compactMap { Int($0) }\n\n// flatMap -- flatten nested collections\nlet allTags = articles.flatMap(\\.tags)\n\n// Dictionary(grouping:by:)\nlet byCategory = Dictionary(grouping: items, by: \\.category)\n\n// reduce(into:) -- efficient accumulation\nlet freq = words.reduce(into: [:]) { counts, word in\n    counts[word, default: 0] += 1\n}\n```\n\n## FormatStyle\n\nUse `.formatted()` instead of `DateFormatter`/`NumberFormatter`. It is\ntype-safe, localized, and concise.\n\n```swift\n// Dates\nlet now = Date.now\nnow.formatted()                                       // \"3/15/2024, 2:30 PM\"\nnow.formatted(date: .abbreviated, time: .shortened)   // \"Mar 15, 2024, 2:30 PM\"\nnow.formatted(.dateTime.year().month().day())          // \"Mar 15, 2024\"\nnow.formatted(.relative(presentation: .named))        // \"yesterday\"\n\n// Numbers\nlet price = 42.5\nprice.formatted(.currency(code: \"USD\"))               // \"$42.50\"\nprice.formatted(.percent)                             // \"4,250%\"\n(1_000_000).formatted(.number.notation(.compactName)) // \"1M\"\n\n// Measurements\nlet distance = Measurement(value: 5, unit: UnitLength.kilometers)\ndistance.formatted(.measurement(width: .abbreviated)) // \"5 km\"\n\n// Duration (Swift 5.7+)\nlet duration = Duration.seconds(3661)\nduration.formatted(.time(pattern: .hourMinuteSecond)) // \"1:01:01\"\n\n// Byte counts\nInt64(1_500_000).formatted(.byteCount(style: .file)) // \"1.5 MB\"\n\n// Lists\n[\"Alice\", \"Bob\", \"Carol\"].formatted(.list(type: .and)) // \"Alice, Bob, and Carol\"\n```\n\n**Parsing:** `FormatStyle` also supports parsing:\n```swift\nlet value = try Decimal(\"$42.50\", format: .currency(code: \"USD\"))\nlet date = try Date(\"Mar 15, 2024\", strategy: .dateTime.month().day().year())\n```\n\n## String Interpolation\n\nExtend `DefaultStringInterpolation` for domain-specific formatting. Use `\"\"\"` for multi-line strings (indentation is relative to the closing `\"\"\"`). See [references/swift-patterns-extended.md](references/swift-patterns-extended.md) for custom interpolation examples.\n\n## Common Mistakes\n\n1. **Using `any` when `some` works.** Default to `some` for return types and\n   parameters. `any` has runtime overhead and loses type information.\n2. **Manual loops instead of collection APIs.** Use `count(where:)`,\n   `contains(where:)`, `compactMap`, `flatMap` instead of manual iteration.\n3. **`DateFormatter` instead of FormatStyle.** `.formatted()` is simpler,\n   type-safe, and handles localization automatically.\n4. **Force-unwrapping Codable decodes.** Use `decodeIfPresent` with defaults\n   for optional or missing keys.\n5. **Nested if-let chains.** Use `guard let` for preconditions to keep the\n   happy path at the top level.\n6. **String regex for simple operations.** Use `.replacing()` and\n   `.contains()` before reaching for Regex.\n7. **Ignoring typed throws.** When a function has a single, clear error type,\n   typed throws give callers exhaustive switch without casting.\n8. **Overusing property wrappers.** A computed property is simpler when there\n   is no reuse or projected value needed.\n9. **Building collections with `var` + `append` in a loop.** Prefer `map`,\n   `filter`, `compactMap`, or `reduce(into:)`.\n10. **Not using if/switch expressions.** When assigning from a condition, use\n    an expression instead of declaring `var` and mutating it.\n\n## Review Checklist\n\n- [ ] `some` used over `any` where possible\n- [ ] `guard` for preconditions; collection APIs instead of manual loops\n- [ ] `.formatted()` used instead of `DateFormatter`/`NumberFormatter`\n- [ ] Codable types use `CodingKeys` for API mapping; `decodeIfPresent` with defaults for optional fields\n- [ ] if/switch expressions for conditional assignment; property wrappers have clear reuse justification\n- [ ] Regex builder used for complex patterns (literal OK for simple ones)\n- [ ] String interpolation is clean; no unnecessary `String(describing:)`\n- [ ] Typed throws used when callers benefit from exhaustive error handling\n- [ ] `Never` used appropriately in generic contexts\n\n## References\n\n- Extended patterns and Codable examples: [references/swift-patterns-extended.md](references/swift-patterns-extended.md)\n- Attributes and C interop (`@c`, `@specialized`, `@inline(always)`, `@export`, `ModuleName::symbol`): [references/swift-attributes-interop.md](references/swift-attributes-interop.md)","tags":["swift","language","ios","skills","dpearson2699"],"capabilities":["skill","source-dpearson2699","category-swift-ios-skills"],"categories":["swift-ios-skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/dpearson2699/swift-ios-skills/swift-language","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"install_from":"skills.sh"}},"qualityScore":"0.300","qualityRationale":"deterministic score 0.30 from registry signals: · indexed on skills.sh · published under dpearson2699/swift-ios-skills","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T05:40:39.540Z","embedding":null,"createdAt":"2026-04-18T20:34:04.928Z","updatedAt":"2026-04-22T05:40:39.540Z","lastSeenAt":"2026-04-22T05:40:39.540Z","tsv":"'-03':1025,1045 '-15':1026,1046 '/pattern':1089 '0':426,464,561,580,833,1072,1188,1368,1369,1407,1440 '0.ismultiple':1353,1378 '000':1504,1505,1543 '01':1536,1537 '1':655,1232,1332,1441,1503,1535,1541,1618 '1.5':1548 '10':1777 '100':562,574,581 '15':1473,1483,1582 '150':571 '1m':1509 '2':656,1037,1040,1067,1333,1355,1380,1464,1475,1640 '2024':1024,1044,1474,1484,1583 '250':1502 '3':283,657,1334,1658 '3/15/2024':1463 '30':1465,1476 '3661':1530 '4':1034,1335,1501,1673 '42.5':1493 '42.50':1498,1572 '5':1336,1515,1522,1688 '5.0':1343 '5.5':918 '5.7':901,1009,1384,1526 '5.9':150,684 '50':566 '500':1542 '6':257,1337,1708 '6.3':22 '7':1338,1722 '8':1339,1743 '9':1761 'abbrevi':1469,1521 'access':515,590 'accumul':1429 'activ':1218 'actor':50 'actual':361 'addit':1308 'alic':1551,1558 'align':804 'alloc':718 'allow':151,235,258 'alltag':1413 'alreadytaken':273,329 'also':1564 'alway':47,475,658,1894 'ambigu':253 'api':33,123,127,1321,1325,1646,1809,1825 'append':1766 'appli':606 'appropri':1875 'archiv':195,196 'argument':250 'array':660 'arraybuild':418,467 'articles.flatmap':1414 'assign':163,169,180,1783,1837 'associ':762,1313 'async/await':51 'attribut':44,1887 'automat':1672 'avatar':1142 'avatarurl':1128,1141 'avoid':252 'b':377,603,878 'benefit':339,1868 'best':115,119,861,1106 'better':754 'bind':596 'block':883,1104 'bob':1552,1559 'bool':1164 'bool.self':1194 'boolean':837 'boolvalu':1191,1198 'bottom':919 'box':702 'branch':220,232,237,869 'break':890 'build':1762 'buildarray':459,499 'buildblock':421,487 'buildeith':443,451,497 'builder':81,84,110,113,391,411,485,1007,1011,1076,1079,1103,1845 'buildexpress':429,490 'buildfinalresult':502 'buildopt':436,493 'bycategori':1420 'byte':1538 'bytecount':1545 'c':35,37,694,1889,1891 'call':372 'caller':295,338,630,1738,1867 'captur':1032,1035,1038,1087 'carol':1553,1561 'case':188,191,194,209,212,215,270,318,323,328,847,949,952,982,991,999,1134,1136,1140,1212,1215,1253,1260,1264 'cast':300,1742 'catch':309 'categori':1425 'category-swift-ios-skills' 'chain':1693 'charact':327 'check':838,1017 'checklist':141,144,1798 'checkmark.circle.fill':177 'choos':733 'circl':179 'circuit':1360 'clamp':520,560,572 'clean':1389,1858 'clear':1732,1841 'close':1608 'closedrang':527,542,548 'codabl':29,114,118,1105,1120,1309,1677,1820,1883 'codable-best-practic':117 'code':1496,1575 'codingkey':1109,1131,1133,1209,1211,1250,1252,1259,1823 'codingkeys.self':1175,1276 'collect':32,122,126,654,689,695,744,783,1320,1411,1645,1763,1808 'color':202,206 'combin':488,871 'common':135,138,404,1616 'common-mistak':137 'compactmap':1397,1652,1773 'compactnam':1508 'compil':639,661,1001,1015 'compile-tim':1014 'complex':1080,1848 'compon':422,437,440,445,448,453,456,460,1028,1083 'components.flatmap':425,463 'compos':601 'comput':618,1748 'concis':1456 'concret':635,664,741 'concurr':49,57 'condit':479,824,1786,1836 'confirm':848 'confirmedat':859 'conform':707,912 'construct':25 'contain':1171,1220,1272,1318,1356,1650,1717 'container.decode':1178,1193,1202,1279 'container.decodeifpresent':1184 'container.nestedcontainer':1286 'content':69,468,471 'context':366,943,1878 'continu':889 'core':12 'count':1066,1340,1348,1434,1437,1539,1648 'cover':23,384 'crashwithdiagnost':928 'creat':409,1234,1262 'createdat':1244,1261,1291,1296 'currenc':1495,1574 'custom':410,509,1108,1115,1144,1613 'd':1033,1036,1039 'date':850,860,1315,1458,1468,1578,1580 'date.now':1461 'dateformatt':1447,1659,1818 'dateregex':1030,1049 'datetime.month':1585 'datetime.year':1479 'day':1053,1481,1586 'decim':1069,1571 'declar':1792 'decod':1116,1145,1155,1167,1168,1239,1268,1269,1678 'decodeifpres':1680,1827 'decoder.container':1173,1274 'default':772,976,1149,1439,1624,1682,1829 'defaultstringinterpol':1591 'describ':1862 'design':582 'diagnost':933,937 'dictionari':1416,1421 'digit':1063,1065 'direct':167 'disambigu':39 'dispatch':715,757 'display':1138 'displaynam':1125,1137 'distanc':1512 'distance.formatted':1518 'domain':414,1594 'domain-specif':1593 'dpearson2699':8 'draft':189,190 'dsl':395,1012 'dsl-style':394 'durat':1524,1528 'duration.formatted':1531 'duration.seconds':1529 'dynam':714,750 'earli':795 'effici':1428 'element':423,424,431,432,438,439,446,447,454,455,461,462 'els':178,284,290,496,820,828,834,841,852,879,882,899,1199 'emb':1100 'enabl':393,794 'encapsul':512 'enforc':791 'enum':267,944,1130,1208,1249,1256,1311 'equival':690 'eras':768 'erasur':752 'error':261,269,298,310,315,317,342,346,948,966,1733,1871 'evencount':1350 'everi':219 'exampl':405,1615,1884 'exhaust':341,973,1739,1870 'existenti':92,97,623,698,701 'exit':796,885 'export':1895 'express':71,74,148,156,172,183,241,430,433,1781,1789,1834 'extend':1590,1880 'fail':963 'failur':947,953,954,998 'fals':827 'familiar':1092 'fatalerror':892,938 'featur':15,28 'field':1832 'file':1547 'filter':1347,1772 'first':444,609,1362,1370 'firsteven':1375 'firstmatch':1047 'fix':645 'flat':1226 'flatmap':1408,1653 'flatten':1221,1409 'flexibl':787 'forc':1675 'force-unwrap':1674 'forkey':1180,1186,1195,1204,1281,1289,1295,1302 'format':34,1444,1506,1544,1554,1573,1596,1663,1814 'formatstyl':128,129,1442,1563,1662 'freq':1431 'func':201,274,420,428,435,442,450,458,465,651,685,720,809,927,983 'function':249,264,355,371,745,907,922,1728 'gatherdiagnost':934 'generic':365,693,749,942,1877 'get':296,531 'getter/setter':588 'give':1737 'given':648 'green':217 'group':1417,1422 'guard':99,102,281,287,788,790,817,825,831,839,846,864,873,874,896,1695,1805 'guard-pattern':101 'handl':343,984,1146,1670,1872 'happi':800,1702 'hasneg':1365 'heap':717 'heterogen':743,782 'hide':675,740 'high':210 'hold':705 'hourminutesecond':1534 'icon':174 'id':1122,1135,1231,1241,1254,1277,1282,1404 'ident':680 'if-let':1690 'if/else':498 'if/switch':70,147,1780,1833 'ifswitch':73 'ifswitch-express':72 'ignor':1723 'implement':676 'import':1021 'imposs':1005 'includ':476 'indent':1603 'indic':905 'inform':1639 'init':544,1165,1266 'initi':166 'inlin':46,1893 'input':308 'insid':1102 'instead':1345,1445,1643,1654,1660,1790,1810,1816 'int':565,1123,1161,1242,1406 'int.self':1185,1280 'int64':1540 'interop':36,1890 'interpol':131,134,1589,1614,1856 'invalid':326 'invalidcharact':272,292,324 'io':4 'isact':1163,1196,1197,1200,1205,1216 'iscomplet':176 'isletterordigit':289 'item':473,687,722,726,728,1154,1423 'item.uppercased':730 'iter':1657 'json':1223,1230 'justif':1843 'keep':798,1700 'key':1111,1687 'keyedbi':1174,1275,1287 'km':1523 'know':633,662,1002 'label':185 'languag':2,10,14,24 'last':1372 'left':803 'left-align':802 'let':173,184,303,472,525,818,849,875,877,897,932,993,1029,1042,1050,1058,1121,1124,1127,1156,1159,1162,1170,1190,1240,1243,1246,1271,1283,1330,1349,1364,1374,1388,1393,1403,1412,1419,1430,1459,1491,1511,1527,1568,1577,1692,1696 'level':564,577,1707 'line':1601 'list':1550,1555 'liter':1078,1088,1101,1850 'local':1454,1671 'logger.critical':935 'logic':870 'loop':1328,1642,1769,1813 'lose':1637 'low':216 'lowercas':1206 'makecollect':652 'makeitem':466,474 'manag':64 'manual':1327,1641,1656,1812 'map':1771,1826 'mar':1472,1482,1581 'mark':353 'match':845,1043,1363 'match.output':1054 'max':536,553 'mb':1549 'measur':1510,1513,1519 'medium':213 'messag':929,936,939 'metadata':594,1233,1255,1284,1290 'metadata.decode':1293,1299 'metadatakey':1257 'metadatakeys.self':1288 'method':486 'min':535,552 'mismatch':1147 'miss':1686 'mistak':136,139,1617 'mix':345,1099 'modern':17,121,125,1319,1324 'modern-collection-api':124 'modul':38 'modulenam':40,1896 'month':1052,1480 'multi':230,1600 'multi-lin':1599 'multi-stat':229 'must':221,378,884 'mutat':1795 'name':304,481,483,1139,1157,1176,1181,1213,1488 'name.replacing':1395 'name.uppercased':484 'need':301,753,766,780,977,1000,1760 'nest':807,1219,1222,1410,1689 'never':104,107,352,360,902,904,909,931,957,962,965,971,979,988,1873 'never-typ':106 'new':1386 'newvalu':537 'now.formatted':1462,1467,1478,1485 'number':1331,1490 'number.notation':1507 'numberformatt':1448,1819 'numbers.contains':1366 'numbers.count':1351 'numbers.first':1376 'ok':1851 'one':1854 'oneormor':1062 'opaqu':90,95,621,627 'opaque-and-existential-typ':94 'oper':1713 'option':503,816,1399,1684,1831 'orang':214 'order':811,812,819,857,858 'order.ispaid':840 'order.items.isempty':826 'order.status':851 'order.total':832 'ordererror.empty':830 'ordererror.invalidtotal':836 'ordererror.missing':822 'ordererror.notconfirmed':854 'ordererror.unpaid':843 'outer':607 'overhead':712,1635 'overus':1744 'paramet':681,746,1631 'parenthes':244 'pars':1023,1562,1566 'path':801,1703 'pattern':11,19,68,100,103,516,789,844,1019,1081,1091,1310,1533,1849,1881 'percent':1500 'perform':43,755 'pm':1466,1477 'posit':200 'possibl':1804 'post':505 'post-process':504 'practic':116,120,862,1107 'precondit':792,866,1698,1807 'prefer':1322,1770 'present':1487 'preserv':678 'price':1492 'price.formatted':1494,1499 'priceregex':1059 'primari':587 'print':320,325,330,575,729,995 'prioriti':204,205,208 'privat':521 'process':506,686,721 'processord':810 'produc':222 'program':926 'project':578,1758 'projectedvalu':541,589 'propag':369 'properti':85,88,507,592,597,613,619,1745,1749,1838 'property-wrapp':87 'propertywrapp':510,518 'protocol':626,697,758,915 'provid':593,1013 'publish':192,193 'quantiti':1160,1182,1187,1214 'rang':526,543,547,550 'range.lowerbound':538,555 'range.upperbound':539,556 'rawtext.replacing':1390 'reach':1719 'readabl':1018 'receipt':814,856 'record':1238 'red':211 'reduc':806,1426,1775 'refer':145,146,1879 'references/swift-attributes-interop.md':1898,1899 'references/swift-patterns-extended.md':1305,1306,1610,1611,1885,1886 'regex':109,112,1006,1010,1031,1060,1094,1710,1721,1844 'regex-build':111 'regexbuild':1022 'relat':872,1486,1605 'renam':1110 'repeat':1064 'replac':747,1382,1715 'requir':764 'result':80,83,390,945,955,959,964,968,985,986,990 'result-build':82 'resultbuild':392,416 'return':158,164,199,293,659,669,738,855,880,887,910,1385,1628 'reus':1756,1842 'reusabl':1082 'review':140,143,1797 'review-checklist':142 'rule':218,332,583,769 'runtim':710,785,1634 'safe':1453,1668 'scope':649,886 'second':452 'see':53,65,1304,1609 'self':760,1301 'self.range':549 'self.value':551 'sendabl':52 'set':533 'short':322,1359 'short-circuit':1358 'shorten':1471 'shorthand':894 'showextra':478 'simpl':617,748,1090,1712,1853 'simpler':1665,1751 'sinc':916,978 'singl':240,491,1731 'skill':5,6,58 'snakecas':1394 'someerror':335 'sourc':347 'source-dpearson2699' 'special':45,1892 'specif':1595 'specifi':259 'state':63 'statement':231,489 'static':419,427,434,441,449,457,756 'status':187 'storag':513 'strategi':1316,1584 'string':30,130,133,277,280,469,470,930,956,987,1070,1071,1126,1132,1158,1210,1245,1248,1251,1258,1300,1381,1387,1588,1602,1709,1855,1861 'string-interpol':132 'string.self':1179,1203,1294 'stringprotocol':724 'strings.compactmap':1405 'strong':1084 'struct':417,519,558,1118,1153,1228,1237 'style':396,1546 'succeed':972 'success':946,950,951,992 'suffic':620 'support':1565 'swift':1,3,9,13,21,56,149,168,256,266,415,517,650,683,719,808,900,917,921,1008,1020,1117,1152,1227,1229,1329,1342,1383,1457,1525,1567 'swift-concurr':55 'swiftui':60,67,398 'swiftui-pattern':66 'switch':154,182,186,207,316,974,989,1740 'symbol':41,1897 'syntact':357 'syntax':18,397,1095 'system':27 'tag':1236,1247,1265,1297,1303,1415 'taken':331 'target':20 'termin':924 'throw':76,79,255,265,278,285,291,334,350,351,358,368,373,376,380,389,813,821,829,835,842,853,888,1169,1270,1725,1736,1864 'thumb':771 'time':1016,1470,1532 'tooshort':271,286,319 'top':1706 'transform':1057,1068,1151,1402 'tri':305,1172,1177,1183,1192,1201,1273,1278,1285,1292,1298,1570,1579 'true':1207 'trycaptur':1055,1061 'type':26,75,78,93,98,105,108,228,254,262,297,367,382,511,624,628,636,643,665,670,679,682,699,708,739,742,751,763,786,903,920,1085,1148,1452,1556,1629,1638,1667,1724,1734,1735,1821,1863 'type-saf':1451,1666 'typed-throw':77 'under':642 'unit':1516 'unitlength.kilometers':1517 'unkey':1317 'unnecessari':1860 'untyp':349,388 'unwrap':815,895,1398,1676 'url':1129,1143 'usag':557 'usd':1497,1576 'use':160,246,333,348,363,387,612,666,734,736,775,863,893,940,1075,1344,1443,1597,1619,1647,1679,1694,1714,1779,1787,1800,1815,1822,1846,1865,1874 'user':1119 'usernam':276,307 'username.allsatisfy':288 'username.count':282 'username.lowercased':294 'v':568,576 'v.level':570 'valid':275,306,823 'validationerror':268,279,312 'valu':159,224,492,523,524,530,532,534,546,579,898,994,996,1314,1514,1569,1759 'var':522,528,540,563,567,604,1765,1793 'via':591 'view':61 'viewbuild':400 'volum':559,569 'vs':1077 'want':673 'width':1520 'without':495,1112,1741 'word':1435,1438 'words.reduce':1432 'work':197,1623 'wrap':242 'wrappedvalu':529,545,554,584 'wrapper':86,89,508,598,608,614,1746,1839 'write':1113 'x':605 'year':1051,1587 'yesterday':1489","prices":[{"id":"72433a34-ad2a-452e-a639-9d33fc86943a","listingId":"da6ee795-7134-4740-9538-c148668d6cf3","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"dpearson2699","category":"swift-ios-skills","install_from":"skills.sh"},"createdAt":"2026-04-18T20:34:04.928Z"}],"sources":[{"listingId":"da6ee795-7134-4740-9538-c148668d6cf3","source":"github","sourceId":"dpearson2699/swift-ios-skills/swift-language","sourceUrl":"https://github.com/dpearson2699/swift-ios-skills/tree/main/skills/swift-language","isPrimary":false,"firstSeenAt":"2026-04-18T22:01:21.316Z","lastSeenAt":"2026-04-22T00:53:44.995Z"},{"listingId":"da6ee795-7134-4740-9538-c148668d6cf3","source":"skills_sh","sourceId":"dpearson2699/swift-ios-skills/swift-language","sourceUrl":"https://skills.sh/dpearson2699/swift-ios-skills/swift-language","isPrimary":true,"firstSeenAt":"2026-04-18T20:34:04.928Z","lastSeenAt":"2026-04-22T05:40:39.540Z"}],"details":{"listingId":"da6ee795-7134-4740-9538-c148668d6cf3","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"dpearson2699","slug":"swift-language","source":"skills_sh","category":"swift-ios-skills","skills_sh_url":"https://skills.sh/dpearson2699/swift-ios-skills/swift-language"},"updatedAt":"2026-04-22T05:40:39.540Z"}}