SnapKit / SnapKit

A Swift Autolayout DSL for iOS & OS X

Home Page:https://snapkit.github.io/SnapKit/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why removeConstraints wouldn't call translatesAutoresizingMaskIntoConstraints = true

Saafo opened this issue Β· comments

New Issue Checklist

🚫 If this template is not filled out your issue will be closed with no comment. 🚫

  • I have looked at the Documentation
  • I have read the F.A.Q.
  • I have filled out this issue template.

Issue Info

Info Value
Platform ios
Platform Version e.g. 17.0
SnapKit Version e.g. 5.6.0
Integration Method e.g. cocoapods

Issue Description

When we call (re)makeConstraints, SnapKit would automatically set translatesAutoresizingMaskIntoConstraints = false. However, when call removeConstraints, this value wouldn't be reset (to true). Is this behavior by design?

The problem is that I have a view, it is first layout by SnapKit, then layout by frames. After I removeConstraints on the view, the frame layout behaved odd. I spent 2 hours to found that I have to manully set translatesAutoresizingMaskIntoConstraints back to true.