Skip to content

Commit

Permalink
refactor(ios): remove deprecated view methods around layout lifecycle
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Removes the updateLayout(), startLayout() and finishLayout() methods on Ti.UI.View
  • Loading branch information
sgtcoolguy committed Dec 9, 2019
1 parent 0b9b913 commit 54e2eeb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
5 changes: 1 addition & 4 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.h
Expand Up @@ -140,7 +140,7 @@ enum {
BOOL viewInitialized;
BOOL repositioning;
BOOL isUsingBarButtonItem;
//This flag is set to true on startLayout() call and false on finishLayout() call
//This flag is set to true on beginning of _initWithProperties() call and false near the end of the method
BOOL updateStarted;
BOOL allowLayoutUpdate;

Expand Down Expand Up @@ -168,9 +168,6 @@ enum {
*/
@property (nonatomic, readonly) NSArray *children;

- (void)startLayout:(id)arg; //Deprecated since 3.0.0
- (void)finishLayout:(id)arg; //Deprecated since 3.0.0
- (void)updateLayout:(id)arg; //Deprecated since 3.0.0
- (void)setTempProperty:(id)propVal forKey:(id)propName;
- (void)processTempProperties:(NSDictionary *)arg;
- (BOOL)_hasListeners:(NSString *)type checkParent:(BOOL)check;
Expand Down
32 changes: 1 addition & 31 deletions iphone/TitaniumKit/TitaniumKit/Sources/API/TiViewProxy.m
Expand Up @@ -91,7 +91,7 @@ - (void)setProxyObserver:(id)arg

- (void)processTempProperties:(NSDictionary *)arg
{
//arg will be non nil when called from updateLayout
// arg will be typically be nil (was non-nil when called from removed updateLayout() method)
if (arg != nil) {
NSEnumerator *enumerator = [arg keyEnumerator];
id key;
Expand Down Expand Up @@ -128,36 +128,6 @@ - (void)setOnLayout:(id)callback
}
#endif

- (void)startLayout:(id)arg
{
DebugLog(@"startLayout() method is deprecated since 3.0.0 .");
updateStarted = YES;
allowLayoutUpdate = NO;
}
- (void)finishLayout:(id)arg
{
DebugLog(@"finishLayout() method is deprecated since 3.0.0 .");
updateStarted = NO;
allowLayoutUpdate = YES;
[self processTempProperties:nil];
allowLayoutUpdate = NO;
}
- (void)updateLayout:(id)arg
{
DebugLog(@"updateLayout() method is deprecated since 3.0.0, use applyProperties() instead.");
id val = nil;
if ([arg isKindOfClass:[NSArray class]]) {
val = [arg objectAtIndex:0];
} else {
val = arg;
}
updateStarted = NO;
allowLayoutUpdate = YES;
ENSURE_TYPE_OR_NIL(val, NSDictionary);
[self processTempProperties:val];
allowLayoutUpdate = NO;
}

- (BOOL)belongsToContext:(id<TiEvaluator>)context
{
id<TiEvaluator> myContext = ([self executionContext] == nil) ? [self pageContext] : [self executionContext];
Expand Down

0 comments on commit 54e2eeb

Please sign in to comment.