{"id":20067562,"url":"https://github.com/asaday/sketch2xcassets","last_synced_at":"2025-08-31T21:40:07.380Z","repository":{"id":152194524,"uuid":"59944559","full_name":"asaday/sketch2xcassets","owner":"asaday","description":"make xcassets from sketch","archived":false,"fork":false,"pushed_at":"2016-05-29T15:47:25.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-02T11:17:50.366Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/asaday.png","metadata":{"files":{"readme":"readme.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}},"created_at":"2016-05-29T13:32:03.000Z","updated_at":"2019-05-08T18:07:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"859e4892-c95d-429c-a161-6cb0c7bd2e6a","html_url":"https://github.com/asaday/sketch2xcassets","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"d2d93e85779010374cb3a1ab8b81501e8012fd07"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/asaday/sketch2xcassets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2Fsketch2xcassets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2Fsketch2xcassets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2Fsketch2xcassets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2Fsketch2xcassets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/asaday","download_url":"https://codeload.github.com/asaday/sketch2xcassets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/asaday%2Fsketch2xcassets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273046456,"owners_count":25036179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-13T14:02:02.246Z","updated_at":"2025-08-31T21:40:07.352Z","avatar_url":"https://github.com/asaday.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## sketch2xcassets\n\nthis script make xcassets from sketch\n\n### Playground\n\nandway, download this repo.\n\nopen sketch file and change something.  \nsave ⌘S  \nopen xcode and build ⌘B  \nmodefied sketch data is converted in xcassets!\n\n\n### Prepare\n\n1. install sketchtool.\n\t`/Applications/Sketch.app/Contents/Resources/sketchtool/install.sh`\n\n2. copy sketch2xcassets.php to project folder.\n\n\tonly you need file from this repo ,'sketch2xcassets.php'  \n\tother files is for demo.\n\n3. prepare sketch file\n\n\tanyway run sketch and save it.\n\n4. make xcassets to output\n\n\tNew File -\u003e Asset catalog, and enter name to output.  \n\tXcode generate folder 'name.xcassets'\n\n5. add runscript \n\n\t```\n\tcd ${SRCROOT}\n\tphp sketch2xcassets.php -gitignore Sample.sketch Sketch.xcassets Sketch.swift\n\t```\n\tadd runscript TARGETS -\u003e Build Phases  \n\tand move to under Target Depencies\n\n6. build Xcode\n\n\n### Script \n\n`sketch2xcassets.php [option] xxx.sketch xxx.xcassets`\n\n#### xxx.sketch \n\nsource sketch file.  \nthis script output slices.\n\n\n#### xxx.xcassets\n\noutput folder.  \nbefore run script, add xcassets in Xcode.\n\n#### option\n\noption|description\n---|----\n-pdf | generate PDF (default)\n-png | generate PNG x1,x2,x3\n-jpg | generate JPG x1,x2,x3\n-gitignore | add gitignore in xcassets\n-force | force convert\n\n\n#### genetate swift code\n\n`sketch2xcassets.php [option] xxx.sketch xxx.xcassets Sketch.swift`\n\nSketch.swift generated to easy access xcassets \n\n\n```\nimport UIKit\n\nstruct Sketch {\n\tstatic var Oval: UIImage { return UIImage(named: \"Oval\") ?? UIImage() }\n\tstatic var Polygon: UIImage { return UIImage(named: \"Polygon\") ?? UIImage() }\n\tstatic var Star: UIImage { return UIImage(named: \"Star\") ?? UIImage() }\n}\n```\n\nyou can use like this\n\n```\nview.addSubview(UIImageView(image: Sketch.Polygon))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaday%2Fsketch2xcassets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasaday%2Fsketch2xcassets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasaday%2Fsketch2xcassets/lists"}