Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented -[TUIViewNSViewContainer sizeToFit] to invoke -sizeToFit …

…on its rootView (if supported), otherwise follow the normal code path
  • Loading branch information...
commit 4df813a4297f2be757e56c6d459fcf8cdd2a7b33 1 parent 585ca4a
@jspahrsummers jspahrsummers authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/UIKit/TUIViewNSViewContainer.m
View
10 lib/UIKit/TUIViewNSViewContainer.m
@@ -279,6 +279,16 @@ - (CGSize)sizeThatFits:(CGSize)constraint {
return cellSize;
}
+- (void)sizeToFit {
+ if ([self.rootView respondsToSelector:@selector(sizeToFit)]) {
+ [self.rootView performSelector:@selector(sizeToFit)];
+
+ self.bounds = self.rootView.bounds;
+ } else {
+ [super sizeToFit];
+ }
+}
+
#pragma mark NSObject overrides
- (NSString *)description {
Please sign in to comment.
Something went wrong with that request. Please try again.