diff --git a/Source/UIView+AutoLayout.h b/Source/UIView+AutoLayout.h index 72038d9..21f7a5c 100755 --- a/Source/UIView+AutoLayout.h +++ b/Source/UIView+AutoLayout.h @@ -60,19 +60,23 @@ typedef void(^ALConstraintsBlock)(void); // a block of method calls to the UI + (void)removeConstraints:(NSArray *)constraints; /** Removes all explicit constraints that affect the view. + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ - (void)removeConstraintsAffectingView; /** Removes all constraints that affect the view, optionally including implicit constraints. - WARNING: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + NOTE: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ - (void)removeConstraintsAffectingViewIncludingImplicitConstraints:(BOOL)shouldRemoveImplicitConstraints; /** Recursively removes all explicit constraints that affect the view and its subviews. + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ - (void)removeConstraintsAffectingViewAndSubviews; /** Recursively removes all constraints from the view and its subviews, optionally including implicit constraints. - WARNING: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + NOTE: Implicit constraints are auto-generated lower priority constraints, and you usually do not want to remove these. */ - (void)removeConstraintsAffectingViewAndSubviewsIncludingImplicitConstraints:(BOOL)shouldRemoveImplicitConstraints; diff --git a/Source/UIView+AutoLayout.m b/Source/UIView+AutoLayout.m index 3e4f3dd..933f193 100755 --- a/Source/UIView+AutoLayout.m +++ b/Source/UIView+AutoLayout.m @@ -106,6 +106,8 @@ + (void)removeConstraints:(NSArray *)constraints /** Removes all explicit constraints that affect the view. + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + It is not recommended to use this method to "reset" a view for reuse in a different way with new constraints. Create a new view instead. NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ - (void)removeConstraintsAffectingView @@ -115,7 +117,9 @@ - (void)removeConstraintsAffectingView /** Removes all constraints that affect the view, optionally including implicit constraints. - WARNING: Implicit constraints are auto-generated lower priority constraints (such as those that attempt to keep a view at + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + It is not recommended to use this method to "reset" a view for reuse in a different way with new constraints. Create a new view instead. + NOTE: Implicit constraints are auto-generated lower priority constraints (such as those that attempt to keep a view at its intrinsic content size by hugging its content & resisting compression), and you usually do not want to remove these. @param shouldRemoveImplicitConstraints Whether implicit constraints should be removed or skipped. @@ -140,6 +144,8 @@ - (void)removeConstraintsAffectingViewIncludingImplicitConstraints:(BOOL)shouldR /** Recursively removes all explicit constraints that affect the view and its subviews. + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + It is not recommended to use this method to "reset" views for reuse in a different way with new constraints. Create a new view instead. NOTE: This method preserves implicit constraints, such as intrinsic content size constraints, which you usually do not want to remove. */ - (void)removeConstraintsAffectingViewAndSubviews @@ -149,7 +155,9 @@ - (void)removeConstraintsAffectingViewAndSubviews /** Recursively removes all constraints that affect the view and its subviews, optionally including implicit constraints. - WARNING: Implicit constraints are auto-generated lower priority constraints (such as those that attempt to keep a view at + WARNING: Apple's constraint solver is not optimized for large-scale constraint changes; you may encounter major performance issues after using this method. + It is not recommended to use this method to "reset" views for reuse in a different way with new constraints. Create a new view instead. + NOTE: Implicit constraints are auto-generated lower priority constraints (such as those that attempt to keep a view at its intrinsic content size by hugging its content & resisting compression), and you usually do not want to remove these. @param shouldRemoveImplicitConstraints Whether implicit constraints should be removed or skipped.