Skip to content
Browse files

Added <TUIBridgedScrollView> protocol

  • Loading branch information...
1 parent f77a605 commit fd2ea4b92b44e7905ee5082725fc638dc9176bf9 @jspahrsummers jspahrsummers committed Jul 17, 2012
Showing with 59 additions and 0 deletions.
  1. +8 −0 TwUI.xcodeproj/project.pbxproj
  2. +50 −0 lib/UIKit/TUIBridgedScrollView.h
  3. +1 −0 lib/UIKit/TUIKit.h
View
8 TwUI.xcodeproj/project.pbxproj
@@ -275,6 +275,9 @@
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, ); }; };
+ D0C7651615B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7651515B61E5900E7AC2C /* TUIBridgedScrollView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0C7651715B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7651515B61E5900E7AC2C /* TUIBridgedScrollView.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ D0C7651815B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = D0C7651515B61E5900E7AC2C /* TUIBridgedScrollView.h */; settings = {ATTRIBUTES = (Public, ); }; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -421,6 +424,7 @@
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>"; };
+ D0C7651515B61E5900E7AC2C /* TUIBridgedScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TUIBridgedScrollView.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -581,6 +585,7 @@
CBB74C4113BE6E1900C85CB5 /* TUIActivityIndicatorView.m */,
CBB74C4213BE6E1900C85CB5 /* TUIAttributedString.h */,
CBB74C4313BE6E1900C85CB5 /* TUIAttributedString.m */,
+ D0C7651515B61E5900E7AC2C /* TUIBridgedScrollView.h */,
D0C764EA15B611C200E7AC2C /* TUIBridgedView.h */,
88CC1F3513E3684400827793 /* TUIButton+Accessibility.h */,
88CC1F3613E3684600827793 /* TUIButton+Accessibility.m */,
@@ -707,6 +712,7 @@
884E8F5D1538809C000F7A8D /* CAAnimation+TUIExtensions.h in Headers */,
D0C764ED15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
D0C7650715B6156A00E7AC2C /* TUIHostView.h in Headers */,
+ D0C7651815B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -770,6 +776,7 @@
88A4AFDE145A16CA0071CF22 /* TUITextRenderer+Accessibility.h in Headers */,
D0C764EB15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
D0C7650515B6156A00E7AC2C /* TUIHostView.h in Headers */,
+ D0C7651615B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -789,6 +796,7 @@
884E8F5C1538809C000F7A8D /* CAAnimation+TUIExtensions.h in Headers */,
D0C764EC15B611C200E7AC2C /* TUIBridgedView.h in Headers */,
D0C7650615B6156A00E7AC2C /* TUIHostView.h in Headers */,
+ D0C7651715B61E5A00E7AC2C /* TUIBridgedScrollView.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
50 lib/UIKit/TUIBridgedScrollView.h
@@ -0,0 +1,50 @@
+//
+// TUIBridgedScrollView.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 any kind of bridged scroll view.
+ */
+@protocol TUIBridgedScrollView <TUIBridgedView>
+@required
+
+/**
+ * @name Scrolling
+ */
+
+/**
+ * Scrolls the receiver such that the visible rectangle originates at the given
+ * point in the receiver's coordinate system. This method should enable any
+ * applicable animations.
+ *
+ * If scrolling to the given point would result in a rectangle extending past
+ * the scroll view's content, the behavior is unspecified; however, the
+ * resulting visible rectangle should still include the given point.
+ */
+- (void)scrollToPoint:(CGPoint)point;
+
+/**
+ * Scrolls the receiver the minimum distance required to ensure that the given
+ * rectangle is made visible. This method should enable any applicable
+ * animations.
+ *
+ * If the given rectangle is already visible in the scroll view, nothing
+ * happens. If the rectangle is larger than the size of the scroll view, as much
+ * of the rectangle as possible should be made visible; however, it is
+ * unspecified which part of the rectangle will be used.
+ *
+ * This method is named to avoid method signature conflicts with AppKit.
+ */
+- (void)scrollToIncludeRect:(CGRect)rect;
+
+@end
View
1 lib/UIKit/TUIKit.h
@@ -20,6 +20,7 @@
#import "CoreText+Additions.h"
#import "TUIActivityIndicatorView.h"
#import "TUIAttributedString.h"
+#import "TUIBridgedScrollView.h"
#import "TUIBridgedView.h"
#import "TUIButton.h"
#import "TUICGAdditions.h"

0 comments on commit fd2ea4b

Please sign in to comment.
Something went wrong with that request. Please try again.