Github user kfeagle commented on a diff in the pull request:
https://github.com/apache/incubator-weex/pull/35#discussion_r104340578
--- Diff: ios/sdk/WeexSDK/Sources/Component/WXHeaderComponent.m ---
@@ -0,0 +1,76 @@
+/**
+ * Created by Weex.
+ * Copyright (c) 2016, Alibaba, Inc. All rights reserved.
+ *
+ * This source code is licensed under the Apache Licence 2.0.
+ * For the full copyright and license information,please view the LICENSE
file in the root directory of this source tree.
+ */
+
+#import "WXHeaderComponent.h"
+#import "WXComponent_internal.h"
+
+@implementation WXHeaderComponent
+{
+ BOOL _isUseContainerWidth;
+}
+
+- (instancetype)initWithRef:(NSString *)ref type:(NSString *)type
styles:(NSDictionary *)styles attributes:(NSDictionary *)attributes
events:(NSArray *)events weexInstance:(WXSDKInstance *)weexInstance
+{
+ self = [super initWithRef:ref type:type styles:styles
attributes:attributes events:events weexInstance:weexInstance];
+
+ if (self) {
+ _async = YES;
+ _isNeedJoinLayoutSystem = NO;
+ _keepScrollPosition = attributes[@"keepScrollPosition"] ?
[WXConvert BOOL:attributes[@"keepScrollPosition"]] : NO;
+ }
+
+ return self;
+}
+
+- (void)updateAttributes:(NSDictionary *)attributes
+{
+ if (attributes[@"keepScrollPosition"]) {
+ _keepScrollPosition = [WXConvert
BOOL:attributes[@"keepScrollPosition"]];
+ }
+}
+
+- (BOOL)isSticky
+{
+ return _positionType == WXPositionTypeSticky;
+}
+
+- (void)_frameDidCalculated:(BOOL)isChanged
+{
+ [super _frameDidCalculated:isChanged];
+
+ if (isChanged) {
+ [self.delegate headerDidLayout:self];
+ }
+}
+
+- (void)_removeFromSupercomponent
+{
+ [super _removeFromSupercomponent];
+
+ [self.delegate headerDidRemove:self];
--- End diff --
add respondsToSelector ?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---