{"action":"created","issue":{"url":"https://api.github.com/repos/SnapKit/SnapKit/issues/331","repository_url":"https://api.github.com/repos/SnapKit/SnapKit","labels_url":"https://api.github.com/repos/SnapKit/SnapKit/issues/331/labels{/name}","comments_url":"https://api.github.com/repos/SnapKit/SnapKit/issues/331/comments","events_url":"https://api.github.com/repos/SnapKit/SnapKit/issues/331/events","html_url":"https://github.com/SnapKit/SnapKit/issues/331","id":178617109,"number":331,"title":"Crash when removing constraints on iOS 9","user":{"login":"SlayterDev","id":1760134,"avatar_url":"https://avatars2.githubusercontent.com/u/1760134?v=4","gravatar_id":"","url":"https://api.github.com/users/SlayterDev","html_url":"https://github.com/SlayterDev","followers_url":"https://api.github.com/users/SlayterDev/followers","following_url":"https://api.github.com/users/SlayterDev/following{/other_user}","gists_url":"https://api.github.com/users/SlayterDev/gists{/gist_id}","starred_url":"https://api.github.com/users/SlayterDev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SlayterDev/subscriptions","organizations_url":"https://api.github.com/users/SlayterDev/orgs","repos_url":"https://api.github.com/users/SlayterDev/repos","events_url":"https://api.github.com/users/SlayterDev/events{/privacy}","received_events_url":"https://api.github.com/users/SlayterDev/received_events","type":"User","site_admin":false},"labels":[{"id":175983470,"url":"https://api.github.com/repos/SnapKit/SnapKit/labels/need%20info","name":"need info","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-09-22T13:56:48Z","updated_at":"2017-12-05T09:13:16Z","closed_at":"2016-10-15T06:37:15Z","author_association":"NONE","body":"### New Issue Checklist\n\n🚫 If this template is not filled out your issue **will** be closed with no comment. 🚫\n- [X] I have looked at the [Documentation](http://snapkit.io/docs)\n- [X] I have read the [F.A.Q.](http://snapkit.io/faq)\n- [X] I have filled out this issue template.\n### Issue Info\n\n| Info | Value |\n| --- | --- |\n| Platform | iOS |\n| Platform Version | 9.3 |\n| SnapKit Version | 0.22.0 |\n| Integration Method | cocoapods |\n### Issue Description\n\nSince updating to Xcode 8, Swift 2.3, and SnapKit 0.22.0 we've been having an issue with removing constraints. We have a UIView that we need to change constraints for. Regardless if we are using:\n\n``` Swift\nview.snp_removeConstraints()\n view.snp_makeConstraints { (make) in\n    ...\n}\n```\n\nor:\n\n``` Swift\nview.snp_remakeConstraints { (make) in\n    ...\n}\n```\n\nIt always crashes when trying to remove the constraints. The crash happens in `Constraint.swift` in `uninstallFromView()`. The crash occurs in the following block of code:\n\n``` Swift\n// remove the constraints from the UIView's storage\n#if SNAPKIT_DEPLOYMENT_LEGACY && !os(OSX)\nif #available(iOS 8.0, *) {\n    NSLayoutConstraint.deactivateConstraints(installedLayoutConstraints)\n} else if let installedOnView = installInfo.view {\n    installedOnView.removeConstraints(installedLayoutConstraints)\n}\n#else\n    NSLayoutConstraint.deactivateConstraints(installedLayoutConstraints) // < -- *** This line ***\n#endif\n```\n\nIs this an issue in the iOS SDK or perhaps an issue in SnapKit? Any help would be appreciated.\n"},"comment":{"url":"https://api.github.com/repos/SnapKit/SnapKit/issues/comments/349242184","html_url":"https://github.com/SnapKit/SnapKit/issues/331#issuecomment-349242184","issue_url":"https://api.github.com/repos/SnapKit/SnapKit/issues/331","id":349242184,"user":{"login":"xiaohongjun0509","id":8232803,"avatar_url":"https://avatars0.githubusercontent.com/u/8232803?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaohongjun0509","html_url":"https://github.com/xiaohongjun0509","followers_url":"https://api.github.com/users/xiaohongjun0509/followers","following_url":"https://api.github.com/users/xiaohongjun0509/following{/other_user}","gists_url":"https://api.github.com/users/xiaohongjun0509/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaohongjun0509/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaohongjun0509/subscriptions","organizations_url":"https://api.github.com/users/xiaohongjun0509/orgs","repos_url":"https://api.github.com/users/xiaohongjun0509/repos","events_url":"https://api.github.com/users/xiaohongjun0509/events{/privacy}","received_events_url":"https://api.github.com/users/xiaohongjun0509/received_events","type":"User","site_admin":false},"created_at":"2017-12-05T09:13:16Z","updated_at":"2017-12-05T09:13:16Z","author_association":"NONE","body":"@robertjpayne hi robertjpayne, in our project I‘ve meet this crash. Also this crash only occur on iOS9.\r\nthis occurs due to removeConstraints has passed a dealloc obj.\r\n\r\n\r\n\r\n---<UIView: 0x7fcc51cd29d0; frame = (-1 -1; 377 377); layer = <CALayer: 0x7fcc51dec2a0>>\r\n---[<NSAutoresizingMaskLayoutConstraint:0x7fcc5440c610 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc54471170 NewsMaster.GIFPlayer:0x7fcc54395e80.width == UIView:0x7fcc51cd29d0.width>, <NSAutoresizingMaskLayoutConstraint:0x7fcc540f0430 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc544e8fc0 NewsMaster.GIFPlayer:0x7fcc54395e80.height == UIView:0x7fcc51cd29d0.height>]\r\n---bgImageView------><Hermes.NewsImageView: 0x7fcc5480c570; baseClass = UIImageView; frame = (0 0; 0 0); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7fcc5480cba0>>\r\n---<UIView: 0x7fcc51cd29d0; frame = (-1 -1; 377 377); layer = <CALayer: 0x7fcc51dec2a0>>\r\n---[<NSAutoresizingMaskLayoutConstraint:0x7fcc5440c610 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc54471170 NewsMaster.GIFPlayer:0x7fcc54395e80.width == UIView:0x7fcc51cd29d0.width>, <NSAutoresizingMaskLayoutConstraint:0x7fcc540f0430 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc544e8fc0 NewsMaster.GIFPlayer:0x7fcc54395e80.height == UIView:0x7fcc51cd29d0.height>]\r\n---bgImageView------><Hermes.NewsImageView: 0x7fcc5480c570; baseClass = UIImageView; frame = (0 0; 0 0); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7fcc5480cba0>>\r\nNewsImageView dealloc --->  <Hermes.NewsImageView: 0x7fcc54689470; baseClass = UIImageView; frame = (0 0; 0 0); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7fcc54689960>>\r\nNewsImageView dealloc --->  <Hermes.NewsImageView: 0x7fcc5480c570; baseClass = UIImageView; frame = (0 18; 375 375); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x7fcc5480cba0>>\r\n\r\n---<UIView: 0x7fcc51cd29d0; frame = (-1 -1; 377 377); layer = <CALayer: 0x7fcc51dec2a0>>\r\n---[<NSAutoresizingMaskLayoutConstraint:0x7fcc5418b870 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc545751e0 NewsMaster.GIFPlayer:0x7fcc54395e80.width == UIView:0x7fcc51cd29d0.width>, <NSAutoresizingMaskLayoutConstraint:0x7fcc545884a0 NewsMaster.GIFPlayer:0x7fcc54395e80.(null) == UIView:0x7fcc51cd29d0.(null)>, <NSAutoresizingMaskLayoutConstraint:0x7fcc545e3a00 NewsMaster.GIFPlayer:0x7fcc54395e80.height == UIView:0x7fcc51cd29d0.height>]\r\n\r\n2017-12-05 16:34:27.082 [41765:977382] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WKWebsiteDataStore nsli_layoutEngine]: unrecognized selector sent to instance 0x7fcc5480c570'\r\n*** First throw call stack:\r\n"}}
{"actor":{"display_login":"xiaohongjun0509"}}