Skip to content

Instantly share code, notes, and snippets.

View GeekTree0101's full-sized avatar
💰

David Ha (小河) GeekTree0101

💰
View GitHub Profile
@GeekTree0101
GeekTree0101 / UIView+TLLayout.h
Created November 21, 2019 01:17 — forked from ericcj/UIView+TLLayout.h
crazy that hiding a uiview doesn't affect its autolayout constraints. here's a category for the rest of the world who uses dynamic interfaces
#import <UIKit/UIKit.h>
@interface UIView (TLLayout)
@property (nonatomic, strong) NSArray *hiddenConstraints;
// set hidden and remove any constraints involving this view from its superview
- (void)hideAndRemoveConstraints;
- (void)showAndRestoreConstraints;