当前位置:网站首页>Recursion of subviews of view
Recursion of subviews of view
2022-06-12 13:41:00 【Li. CQ】
// - Method 1
- (void)getSubView:(UIView *)view array:(NSMutableArray *)array{
for (UIView *sub in view.subviews){
[array addObject:sub];
[self getSubView:sub array:array];
}
}
// - Method 2
- (NSMutableArray *)getSubView:(UIView *)view{
if (view.subviews.count == 0) return [NSMutableArray arrayWithObject:view];
NSMutableArray *sArray = [NSMutableArray arrayWithObject:view];
for (UIView *sub in view.subviews){
NSArray *array = [self getSubView:sub];
[sArray addObjectsFromArray:array];
}
return sArray;
}
// - Print view All recursive children of view
- (void)printSubView:(UIView *)view format:(NSString *)format{
NSLog(@"%@--|%@", format, view);
for (UIView *sub in view.subviews){
[self printSubView:sub format:[format stringByAppendingFormat:@" "]];
}
}
边栏推荐
- Codeforces 1637 C. Andrew and stones - simple thinking
- 基于华为云鲲鹏弹性云服务器ECS部署openGauss数据库【这次高斯不是数学家】
- 2062: [example 1.3] movie tickets
- AVFoundation
- Codeforces 1629 A. download more RAM - simple greed
- What if the MySQL installation on the apple computer is completed and cannot be found
- VGA display color bar and picture (FPGA)
- 【SemiDrive源码分析】【X9芯片启动流程】26 - R5 SafetyOS 之 LK_INIT_LEVEL_TARGET 阶段代码流程分析(TP Drvier、Audio Server初始化)
- 数据类型转换和条件控制语句
- Install RPM package offline using yum
猜你喜欢

import torch_ Data view of geometric

简历 NFT 平台 TrustRecruit 加入章鱼网络成为候选应用链

事件的传递和响应以及使用实例

Application of binary search -- finding the square root sqrt of a number

MySQL 查询 limit 1000,10 和 limit 10 速度一样快吗? 深度分页如何破解

xcode 调试openGLES

Paw 高级使用指南

Qt5 plug-in production

Script import CDN link prompt net:: err_ FILE_ NOT_ Found problem

Pytorch framework
随机推荐
Wechat web developer tools tutorial, web development issues
[Title brushing] Super washing machine
【SemiDrive源码分析】【X9芯片启动流程】25 - MailBox 核间通信机制介绍(代码分析篇)之 RPMSG-IPCC RTOS & QNX篇
2064: [example 2.1] exchange value
Deploy opengauss database based on Huawei cloud Kunpeng elastic ECS [Gauss is not a mathematician this time]
There was an error installing mysql. Follow the link below to CMD
Debug code to quickly locate the error location
Tinyxml Usage Summary
创新实训(十一)开发过程中的一些bug汇总
Codeforces 1638 A. reverse - simple thinking
Web3.0,「激发创造」的时代
[WUSTCTF2020]颜值成绩查询-1
Convert the string to hexadecimal string and display it
Informatics Olympiad all in one 1000: introductory test questions
JVM runtime parameters
Software construction 03 regular expression
Actual combat | realizing monocular camera ranging by skillfully using pose solution
Record some settings for visual studio 2019
import torch_ Geometric loads some common datasets
torch_ geometric message passing network