@@ -323,46 +323,30 @@ YTMainAppControlsOverlayView *controlsOverlayView;
323
323
}
324
324
%end
325
325
NSString *getAdString (NSString *description) {
326
- if ([description containsString: @" brand_promo" ])
327
- return @" brand_promo" ;
328
- if ([description containsString: @" carousel_footered_layout" ])
329
- return @" carousel_footered_layout" ;
330
- if ([description containsString: @" carousel_headered_layout" ])
331
- return @" carousel_headered_layout" ;
332
- if ([description containsString: @" eml.expandable_metadata" ])
333
- return @" eml.expandable_metadata" ;
334
- if ([description containsString: @" feed_ad_metadata" ])
335
- return @" feed_ad_metadata" ;
336
- if ([description containsString: @" full_width_portrait_image_layout" ])
337
- return @" full_width_portrait_image_layout" ;
338
- if ([description containsString: @" full_width_square_image_layout" ])
339
- return @" full_width_square_image_layout" ;
340
- if ([description containsString: @" landscape_image_wide_button_layout" ])
341
- return @" landscape_image_wide_button_layout" ;
342
- if ([description containsString: @" post_shelf" ])
343
- return @" post_shelf" ;
344
- if ([description containsString: @" product_carousel" ])
345
- return @" product_carousel" ;
346
- if ([description containsString: @" product_engagement_panel" ])
347
- return @" product_engagement_panel" ;
348
- if ([description containsString: @" product_item" ])
349
- return @" product_item" ;
350
- if ([description containsString: @" shopping_carousel" ])
351
- return @" shopping_carousel" ;
352
- if ([description containsString: @" shopping_item_card_list" ])
353
- return @" shopping_item_card_list" ;
354
- if ([description containsString: @" statement_banner" ])
355
- return @" statement_banner" ;
356
- if ([description containsString: @" square_image_layout" ])
357
- return @" square_image_layout" ;
358
- if ([description containsString: @" text_image_button_layout" ])
359
- return @" text_image_button_layout" ;
360
- if ([description containsString: @" text_search_ad" ])
361
- return @" text_search_ad" ;
362
- if ([description containsString: @" video_display_full_layout" ])
363
- return @" video_display_full_layout" ;
364
- if ([description containsString: @" video_display_full_buttoned_layout" ])
365
- return @" video_display_full_buttoned_layout" ;
326
+ for (NSString *str in @[
327
+ @" brand_promo" ,
328
+ @" carousel_footered_layout" ,
329
+ @" carousel_headered_layout" ,
330
+ @" eml.expandable_metadata" ,
331
+ @" feed_ad_metadata" ,
332
+ @" full_width_portrait_image_layout" ,
333
+ @" full_width_square_image_layout" ,
334
+ @" landscape_image_wide_button_layout" ,
335
+ @" post_shelf" ,
336
+ @" product_carousel" ,
337
+ @" product_engagement_panel" ,
338
+ @" product_item" ,
339
+ @" shopping_carousel" ,
340
+ @" shopping_item_card_list" ,
341
+ @" statement_banner" ,
342
+ @" square_image_layout" ,
343
+ @" text_image_button_layout" ,
344
+ @" text_search_ad" ,
345
+ @" video_display_full_layout" ,
346
+ @" video_display_full_buttoned_layout"
347
+ ])
348
+ if ([description containsString: str]) return str;
349
+
366
350
return nil ;
367
351
}
368
352
static BOOL isAdRenderer (YTIElementRenderer *elementRenderer, int kind) {
0 commit comments