{"id":18389310,"url":"https://github.com/rightpoint/eject","last_synced_at":"2025-04-05T14:08:11.020Z","repository":{"id":45876319,"uuid":"71417069","full_name":"Rightpoint/Eject","owner":"Rightpoint","description":"An eject button for Interface Builder to generate swift code","archived":false,"fork":false,"pushed_at":"2021-11-30T14:53:07.000Z","size":266,"stargazers_count":523,"open_issues_count":17,"forks_count":24,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-29T13:09:45.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rightpoint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-20T02:15:24.000Z","updated_at":"2024-12-23T03:01:14.000Z","dependencies_parsed_at":"2022-09-05T17:22:09.311Z","dependency_job_id":null,"html_url":"https://github.com/Rightpoint/Eject","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FEject","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FEject/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FEject/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rightpoint%2FEject/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rightpoint","download_url":"https://codeload.github.com/Rightpoint/Eject/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345853,"owners_count":20924102,"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","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-06T01:42:30.450Z","updated_at":"2025-04-05T14:08:10.981Z","avatar_url":"https://github.com/Rightpoint.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Eject\n\nEject is a utility to transition from Interface Builder to programatic view layout. This is done by using code generation to create a `.swift` file to replace the view hierarchy managed by the `.xib` file.\n\n## Why?\nOne common pain point with Interface Builder is that as a view becomes more dynamic and is managed more programatically, Interface Builder becomes less helpful. This tool lets developers use Interface Builder without that concern, giving them an Eject button to hit when Interace Builder starts getting in the way, and provides an easy path to transition to full programatic view layout.\n\n### But But\nYes, I understand that this is probably a bad idea. But it might not be.\n\n### Usage\n\nInstall with [homebrew](http://brew.sh):\n\n```shell\nbrew install eject\n```\n\nUse on the command line:\n\n```shell\neject --file /path/to/MassiveViewController.xib\n```\n\nCopy and paste code into .swift file, and remove the .xib:\n\n```shell\nrm /path/to/MassiveViewController.xib\n```\n\nOr to see what changed in a xib file by looking at the changes in generated code:\n\n```shell\nTMP=`mktemp` \u0026\u0026 git show HEAD:$XIB \u003e $TMP \u0026\u0026 diff \u003c(eject --file $XIB ) \u003c(eject --file $TMP)\n```\n\n`eject` will generate code for everything it can in the `.xib` file. If there is any XML that `eject` does not understand, it will print out a warning message. Open an [Issue](https://github.com/Raizlabs/Eject/issues) with any warnings, bugs or ideas you may have.\n\n\n### Features\n\n - UIKit `.xib` support\n - Constraints (using [Anchorage](https://github.com/Raizlabs/Anchorage/))\n - Outlet and OutletCollection support\n - Good variable names\n   - Use the user entered \"user label\" if present\n   - Snake case of the className with the namespace removed\n   - Constraint variable names are long, but descriptive, (labelBottomEqualToButtonTop)\n - Code that compiles out of the box is a non-goal\n   - Will not generate `view1`, `view2` variable names to avoid compile errors. Supply user labels and re-generate.\n\n### Does it work?\nThe [Unit Tests](EjectKitTests/EjectKitTests.swift#L136###testCollectionView) show how much work is done. UIKit coverage is configured by the [CocoaTouchBuilder](EjectKit/Builder/CocoaTouchBuilder.swift) using various [Builders](EjectKit/Builder). Some configuration is [generated](EjectKitTests/InspectorPropertyConfigurationTests.swift#34) from Interface Builder `.inspector` files.\n\nThis should still be considered an Alpha quality tool.\n\n\n### Todo\n\n- Enhance code generation approaches\n- AppKit support\n- Storyboard support?\n- Use default values to remove un-needed code\n- Better error reporting of un-interpreted flags\n- Explore generating code as a method of diffing `.xib` files\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frightpoint%2Feject","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frightpoint%2Feject","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frightpoint%2Feject/lists"}