Permalink
Browse files

Added <TUIHostView> protocol

  • Loading branch information...
1 parent c52013a commit f77a605dff35d851ded74378629c8aa5a07f37fe @jspahrsummers jspahrsummers committed Jul 17, 2012
Showing with 46 additions and 4 deletions.
  1. +12 −4 TwUI.xcodeproj/project.pbxproj
  2. +33 −0 lib/UIKit/TUIHostView.h
  3. +1 −0 lib/UIKit/TUIKit.h
@@ -272,6 +272,9 @@
D0C764EB15B611C200E7AC2C /* TUIBridgedView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C764EA15B611C200E7AC2C /* TUIBridgedView.h */; settings = {ATTRIBUTES = (Public, ); }; };
D0C764EC15B611C200E7AC2C /* TUIBridgedView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C764EA15B611C200E7AC2C /* TUIBridgedView.h */; settings = {ATTRIBUTES = (Public, ); }; };
D0C764ED15B611C200E7AC2C /* TUIBridgedView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C764EA15B611C200E7AC2C /* TUIBridgedView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0C7650515B6156A00E7AC2C /* TUIHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7650415B6156A00E7AC2C /* TUIHostView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0C7650615B6156A00E7AC2C /* TUIHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7650415B6156A00E7AC2C /* TUIHostView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0C7650715B6156A00E7AC2C /* TUIHostView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7650415B6156A00E7AC2C /* TUIHostView.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -417,6 +420,7 @@
CBB74C8F13BE6E1900C85CB5 /* TUIViewNSViewContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIViewNSViewContainer.h; sourceTree = "<group>"; };
CBB74C9013BE6E1900C85CB5 /* TUIViewNSViewContainer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TUIViewNSViewContainer.m; sourceTree = "<group>"; };
D0C764EA15B611C200E7AC2C /* TUIBridgedView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIBridgedView.h; sourceTree = "<group>"; };
+ D0C7650415B6156A00E7AC2C /* TUIHostView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIHostView.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -600,6 +604,7 @@
CBB74C5113BE6E1900C85CB5 /* TUIFont.m */,
CBB74C5213BE6E1900C85CB5 /* TUIGeometry.h */,
CBB74C5313BE6E1900C85CB5 /* TUIGeometry.m */,
+ D0C7650415B6156A00E7AC2C /* TUIHostView.h */,
CBB74C5413BE6E1900C85CB5 /* TUIImage+Drawing.h */,
CBB74C5513BE6E1900C85CB5 /* TUIImage+Drawing.m */,
CBB74C5613BE6E1900C85CB5 /* TUIImage.h */,
@@ -618,20 +623,20 @@
CBB74C6213BE6E1900C85CB5 /* TUINSView.m */,
CBB74C6313BE6E1900C85CB5 /* TUINSWindow.h */,
CBB74C6413BE6E1900C85CB5 /* TUINSWindow.m */,
- 30D399C6156D8ADD006ECDAE /* TUIProgressBar.h */,
- 30D399C7156D8ADD006ECDAE /* TUIProgressBar.m */,
884E8F5015387E11000F7A8D /* TUIPopover.h */,
884E8F5115387E11000F7A8D /* TUIPopover.m */,
+ 30D399C6156D8ADD006ECDAE /* TUIProgressBar.h */,
+ 30D399C7156D8ADD006ECDAE /* TUIProgressBar.m */,
CBB74C6513BE6E1900C85CB5 /* TUIResponder.h */,
CBB74C6613BE6E1900C85CB5 /* TUIResponder.m */,
CBB74C6713BE6E1900C85CB5 /* TUIScrollKnob.h */,
CBB74C6813BE6E1900C85CB5 /* TUIScrollKnob.m */,
- 88D81CFD1577EF0D009D453B /* TUIStyledView.h */,
- 88D81CFE1577EF0D009D453B /* TUIStyledView.m */,
CBB74C6913BE6E1900C85CB5 /* TUIScrollView.h */,
CBB74C6A13BE6E1900C85CB5 /* TUIScrollView.m */,
CBB74C6B13BE6E1900C85CB5 /* TUIStringDrawing.h */,
CBB74C6C13BE6E1900C85CB5 /* TUIStringDrawing.m */,
+ 88D81CFD1577EF0D009D453B /* TUIStyledView.h */,
+ 88D81CFE1577EF0D009D453B /* TUIStyledView.m */,
CBB74C6D13BE6E1900C85CB5 /* TUITableView+Additions.h */,
CBB74C6E13BE6E1900C85CB5 /* TUITableView+Additions.m */,
88D25F5313F5D96500CFAAA9 /* TUITableView+Cell.h */,
@@ -701,6 +706,7 @@
884E8F5415387E11000F7A8D /* TUIPopover.h in Headers */,
884E8F5D1538809C000F7A8D /* CAAnimation+TUIExtensions.h in Headers */,
D0C764ED15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
+ D0C7650715B6156A00E7AC2C /* TUIHostView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -763,6 +769,7 @@
88D25F5513F5D96500CFAAA9 /* TUITableView+Cell.h in Headers */,
88A4AFDE145A16CA0071CF22 /* TUITextRenderer+Accessibility.h in Headers */,
D0C764EB15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
+ D0C7650515B6156A00E7AC2C /* TUIHostView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -781,6 +788,7 @@
884E8F5315387E11000F7A8D /* TUIPopover.h in Headers */,
884E8F5C1538809C000F7A8D /* CAAnimation+TUIExtensions.h in Headers */,
D0C764EC15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
+ D0C7650615B6156A00E7AC2C /* TUIHostView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
@@ -0,0 +1,33 @@
+//
+// TUIHostView.h
+// TwUI
+//
+// Created by Justin Spahr-Summers on 17.07.12.
+//
+// Portions of this code were taken from Velvet,
+// which is copyright (c) 2012 Bitswift, Inc.
+// See LICENSE.txt for more information.
+//
+
+#import <Foundation/Foundation.h>
+#import "TUIBridgedView.h"
+
+/**
+ * Represents a view that can host views of other types (i.e., can bridge across
+ * UI frameworks).
+ */
+@protocol TUIHostView <TUIBridgedView>
+@required
+
+/**
+ * The view hosted by the receiver.
+ *
+ * Implementing classes may require that this property be of a more specific
+ * type.
+ *
+ * When this property is set, the given view's [TUIBridgedView hostView]
+ * property should automatically be set to the receiver.
+ */
+@property (nonatomic, strong) id<TUIBridgedView> rootView;
+
+@end
View
@@ -26,6 +26,7 @@
#import "TUIColor.h"
#import "TUIFastIndexPath.h"
#import "TUIFont.h"
+#import "TUIHostView.h"
#import "TUIImage.h"
#import "TUIImageView.h"
#import "TUILabel.h"

0 comments on commit f77a605

Please sign in to comment.