{"id":18952526,"url":"https://github.com/simonwhitaker/autolayoutmodalbug","last_synced_at":"2026-03-29T11:30:17.309Z","repository":{"id":10700138,"uuid":"12944233","full_name":"simonwhitaker/AutoLayoutModalBug","owner":"simonwhitaker","description":null,"archived":false,"fork":false,"pushed_at":"2013-09-19T08:53:18.000Z","size":124,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-01T02:41:28.341Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/simonwhitaker.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}},"created_at":"2013-09-19T08:40:47.000Z","updated_at":"2015-02-26T15:05:20.000Z","dependencies_parsed_at":"2022-09-14T03:01:48.821Z","dependency_job_id":null,"html_url":"https://github.com/simonwhitaker/AutoLayoutModalBug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwhitaker%2FAutoLayoutModalBug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwhitaker%2FAutoLayoutModalBug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwhitaker%2FAutoLayoutModalBug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonwhitaker%2FAutoLayoutModalBug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonwhitaker","download_url":"https://codeload.github.com/simonwhitaker/AutoLayoutModalBug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952598,"owners_count":19723922,"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-08T13:33:51.155Z","updated_at":"2026-03-29T11:30:17.251Z","avatar_url":"https://github.com/simonwhitaker.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AutoLayoutModalBug\n\nThis project demonstrates a bug with a common UI workflow, related to Autolayout on iOS 6.\n\n## The essence of the bug\n\nYour app will crash if you perform the following workflow:\n\n1. Add a subview to your current main view, positioned using Autolayout\n2. Present a modal view on top of the current main view\n3. Remove the subview from the main view while the modal view is visible\n4. Dismiss the modal view\n\nYou can see this bug in action by compiling this project with the iOS 6.1 SDK (Xcode 4.6.3) and running on an iOS 6 device or simulator.\n\n## The fix\n\nThe fix is to explicitly remove any constraints referencing the subview when you remove it from its superview.\n\nTo see the fix in action, set `shouldPreventCrash` in `SWViewController.m` to YES.\n\n## Where it happens\n\nIn my experience, this only happens on apps linked against the iOS 6 SDK and run on iOS 6 devices.\n\nI cannot reproduce the bug in iOS 7. Interestingly, I also cannot reproduce the bug on code linked against the iOS 6 SDK but running on an iOS 7 device.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwhitaker%2Fautolayoutmodalbug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonwhitaker%2Fautolayoutmodalbug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwhitaker%2Fautolayoutmodalbug/lists"}