{"id":28848862,"url":"https://github.com/alemohamad/swift-playground-app-structure","last_synced_at":"2026-04-24T23:31:38.483Z","repository":{"id":210320807,"uuid":"726163915","full_name":"alemohamad/swift-playground-app-structure","owner":"alemohamad","description":"Package App Structure in Swift Playgrounds","archived":false,"fork":false,"pushed_at":"2024-06-10T16:03:04.000Z","size":992,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-19T20:39:13.937Z","etag":null,"topics":["ipados","macos","package","playgrounds","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alemohamad.png","metadata":{"files":{"readme":"README.es.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-01T17:08:22.000Z","updated_at":"2025-04-23T08:29:55.000Z","dependencies_parsed_at":"2023-12-19T01:52:48.889Z","dependency_job_id":"c089b868-9ca0-4b8e-a12a-173789271826","html_url":"https://github.com/alemohamad/swift-playground-app-structure","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"38c6c6af3b2d2618efc6d4e5dad56643b0fcffc5"},"previous_names":["alemohamad/swift-playground-app-structure"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alemohamad/swift-playground-app-structure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemohamad%2Fswift-playground-app-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemohamad%2Fswift-playground-app-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemohamad%2Fswift-playground-app-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemohamad%2Fswift-playground-app-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alemohamad","download_url":"https://codeload.github.com/alemohamad/swift-playground-app-structure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alemohamad%2Fswift-playground-app-structure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32245003,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipados","macos","package","playgrounds","swift","xcode"],"created_at":"2025-06-19T20:30:39.333Z","updated_at":"2026-04-24T23:31:38.476Z","avatar_url":"https://github.com/alemohamad.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Echando un Vistazo al Interior de una App Playground en Swift Playgrounds\n\n¡Hola!\n\n¿Alguna vez te has preguntado qué hay dentro de una App Playground en **Swift Playgrounds**? Bueno, tengo algo genial para ti. En este [video](https://youtu.be/Q7f3Y34TvbI), te muestro cómo configurar todo desde cero: desde el archivo `Package.swift` hasta agregar tus propios módulos, e incluso cómo hacer pruebas unitarias (que, por ahora, solo funcionan en Xcode, ¡pero crucemos los dedos para Swift Playgrounds también! 🤞).\n\nEn este repositorio, expuse todo lo que necesitas saber sobre `Package.swift` y muchas otras cosas. También hay un proyecto de muestra y algunos enlaces que podrían resultar realmente útiles.\n\n¡Espero que te ayude y te diviertas tanto como yo!\n\n## Versión final de Package.swift\n\n```swift\n// swift-tools-version: 5.9\n\n// WARNING:\n// This file is automatically generated.\n// Do not edit it by hand because the contents will be replaced.\n\nimport PackageDescription\nimport AppleProductTypes\n\nlet package = Package(\n    name: \"YouTube\",\n    defaultLocalization: \"en\",\n    platforms: [\n        .iOS(\"17.0\")\n    ],\n    products: [\n        .library(\n            name: \"ExampleKit\",\n            targets: [\"ExampleKit\"]\n        ),\n        .iOSApplication(\n            name: \"YouTube\",\n            targets: [\"AppModule\"],\n            bundleIdentifier: \"com.alemohamad.YouTube\",\n            teamIdentifier: \"YOUR-TEAM-IDENTIFIER\",\n            displayVersion: \"1.0\",\n            bundleVersion: \"1\",\n            appIcon: .asset(\"AppIcon\"),\n            accentColor: .asset(\"AccentColor\"),\n            supportedDeviceFamilies: [\n                .pad,\n                .phone\n            ],\n            supportedInterfaceOrientations: [\n                .portrait,\n                .landscapeRight,\n                .landscapeLeft,\n                .portraitUpsideDown(.when(deviceFamilies: [.pad]))\n            ],\n            appCategory: .education,\n            additionalInfoPlistContentFilePath: \"AppInfo.plist\"\n        )\n    ],\n    targets: [\n        .executableTarget(\n            name: \"AppModule\",\n            dependencies: [\n                \"ExampleKit\"\n            ]\n        ),\n        .target(\n            name: \"ExampleKit\"\n        ),\n        .testTarget(\n            name: \"AppModuleTest\",\n            dependencies: [\n                \"ExampleKit\"\n            ]\n        )\n    ]\n)\n```\n\n**Note Importante:** Después de completar el proyecto, descubrí un problema crítico: si `AppModule` incluye la carpeta `Assets.xcassets`, hace que `testTarget` falle, rompiendo todo el proyecto en Xcode. Para resolver esto y garantizar que el proyecto funcione correctamente, tuve que modificar la dependencia de `testTarget` de `AppModule` a `ExampleKit`. Y funciona porque `ExampleKit` contiene la lógica que pretendo probar. Todo lo demás queda como se demuestra en el vídeo.\n\n## Swift Package Manager\n\n- [Swift.org](https://docs.swift.org/package-manager/)\n- [Apple Developer](https://developer.apple.com/documentation/packagedescription)\n- [GitHub](https://github.com/apple/swift-package-manager/)\n\n## [Platform](https://developer.apple.com/documentation/packagedescription/platform)\n\n### [SupportedPlatform](https://developer.apple.com/documentation/packagedescription/supportedplatform)\n\n```swift\nplatforms: [\n    .iOS(\"17.0\"),\n    .macOS(\"14.0\"),\n    .watchOS(\"10.0\"),\n    .tvOS(\"17.0\"),\n    .visionOS(\"1.0\"),\n    .macCatalyst(\"17.0\"),\n    .driverKit(\"23.0\"),\n    .linux(\"\"),\n    .openbsd(\"\"),\n    .wasi(\"\"), // WebAssembly System Interafce\n    .android(\"\"),\n    .windows(\"\"),\n    .custom(\"\")\n],\n```\n\n### [iOSVersion](https://developer.apple.com/documentation/packagedescription/supportedplatform/iosversion)\n\n```swift\n.iOS(\"17.0\")\n.iOS(.v17)\n.iOS(\"16.1\")\n.iOS(.v16_1) // la constante no funciona en versiones menores, debes usar solo la principal\n```\n\n```swift\n// Swift Playgrounds soporta estas versiones de iOS:\n// 17.0\n// 16.0, 16.1, 16.2, 16.3, 16.4, 16.5, 16.6\n// 15.2, 15.3, 15.4, 15.5, 15.6\n```\n\n## [Product](https://developer.apple.com/documentation/packagedescription/product)\n\n```swift\nproducts: [\n    .library(name: \"\", type: .dynamic, targets: []), // .static\n    .executable(name: \"\", targets: []),\n    .plugin(name: \"\", targets: []),\n    .iOSApplication(name: \"\", targets: []) // sólo en el framework AppleProductTypes\n],\n```\n\n### [UIUserInterfaceIdiom](https://developer.apple.com/documentation/uikit/uiuserinterfaceidiom)\n\n```swift\nsupportedDeviceFamilies: [\n    .phone,\n    .pad,\n    .tv, // ?\n    .carPlay, // ?\n    .mac, // ?\n    .vision, // ?\n    .unspecified // ?\n]\n```\n\n### [UIDeviceOrientation](https://developer.apple.com/documentation/uikit/uideviceorientation)\n\n```swift\nsupportedInterfaceOrientations: [\n    .portrait,\n    .portraitUpsideDown,\n    .landscapeRight,\n    .landscapeLeft,\n    .faceUp,\n    .faceDown,\n    .unknown\n]\n```\n\n### App Icon\n\n```swift\nappIcon: .placeholder(icon: .coffee),\nappIcon: .asset(\"AppIcon\"),\n\n// 54 iconos:\n// .bird         .bunny      .cat         .dog            .butterfly\n// .flower       .leaf       .carrot      .bowl           .coffee\n// .sandwich     .twoPeople  .running     .calendar       .camera\n// .clock        .gamepad    .map         .movieReel      .palette\n// .pencil       .openBook   .calculator  .images         .mic\n// .box          .coins      .weights     .paper          .tv\n// .binoculars   .bandage    .magicWand   .gift           .rocket\n// .earth        .beachball  .barChart    .heart          .note\n// .smiley       .star       .location    .lightningBolt  .checkmark\n// .chatMessage  .sparkle    .bicycle     .boat           .car\n// .plane        .moon       .sun         .cloud\n```\n\n### Accent Color\n\n```swift\naccentColor: .presetColor(.orange),\naccentColor: .asset(\"AccentColor\"),\n\n// 12 colores:\n// .red     .orange  .yellow\n// .green   .mint    .teal\n// .cyan    .blue    .indigo\n// .purple  .pink    .brown\n```\n\n### App Category\n\n```swift\n.books                    // Books\n.business                 // Business\n.developerTools           // Developer Tools\n.education                // Education\n.entertainment            // Entertainment\n.finance                  // Finance\n.food-and-drink           // Food \u0026 Drink\n.games                    // Games\n.actionGames              // Games - Action Games\n.adventureGames           // Games - Adventure Games\n.boardGames               // Games - Board Games\n.cardGames                // Games - Card Games\n.casinoGames              // Games - Casino Games\n.arcadeGames              // Games - Casual Games\n.familyGames              // Games - Family Games\n.kidsGames                // Games - Kids Games\n.musicGames               // Games - Music Games\n.puzzleGames              // Games - Puzzle Games\n.racingGames              // Games - Racing Games\n.rolePlayingGames         // Games - Role Playing Games\n.simulationGames          // Games - Simulation Games\n.sportsGames              // Games - Sports Games\n.strategyGames            // Games - Strategy Games\n.triviaGames              // Games - Trivia Games\n.wordGames                // Games - Word Games\n.graphicsDesign           // Graphics \u0026 Design\n.healthcareFitness        // Health \u0026 Fitness\n.lifestyle                // Lifestyle\n.magazines-and-newspapers // Magazines \u0026 Newspapers\n.medical                  // Medical\n.music                    // Music\n.navigation               // Navigation\n.news                     // News\n.photography              // Photography\n.productivity             // Productivity\n.reference                // Reference\n.shopping                 // Shopping\n.socialNetworking         // Social Networking\n.sports                   // Sports\n.travel                   // Travel\n.utilities                // Utilities\n.video                    // Video\n.weather                  // Weather\n```\n\n## [Target](https://developer.apple.com/documentation/packagedescription/target)\n\n```swift\n.target(name: \"\")\n.executableTarget(name: \"\")\n.testTarget(name: \"\")\n.systemLibrary(name: \"\")\n.binaryTarget(name: \"\", path: \"\")\n.plugin(name: \"\")\n```\n\n## Reference links\n\n- [\"Swift Playgrounds App Projects\" by Aaron Sky (Nov 6, 2021)](https://skyaaron.com/posts/swiftpm-app-projects/)\n- [\"A document-based app in Swift Playgrounds for iPad\" by Guilherme Rambo (Dec 28, 2021)](https://rambo.codes/posts/2021-12-28-a-document-based-app-in-swift-playgrounds-for-ipad)\n- [\"Lessons from Developing an App on the iPad in Swift Playgrounds from Start to Finish (Including Publishing on the App Store)\" by Matt Waller (Jan 4, 2022)](https://www.cephalopod.studio/blog/lessons-from-developing-an-app-on-the-ipad-from-start-to-finish-on-the-app-store)\n- [\"Changing the Thumbnail of an App in Swift Playgrounds\" by Tiago Gomes Pereira (Apr 7, 2022)](https://www.createwithswift.com/changing-the-thumbnail-of-an-app-in-swift-playgrounds/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falemohamad%2Fswift-playground-app-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falemohamad%2Fswift-playground-app-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falemohamad%2Fswift-playground-app-structure/lists"}