UIViewHelpersiOS UIView类Category中的辅助方法
这是UIView Category中越来越多的辅助方法集合。包括单元测试的集合。截至目前,此类别中的每个方法都致力于递归UIView的子视图并根据条件测试每个子视图。假设您想找到应用程序的“第一响应者”。使用类别方法firstSubviewPassingTest:,您可以轻松迭代应用程序的所有子视图以定位第一响应者。
-(UIView*)findCurrentFirstResponder {
// Get the app's highest-level view
UIView *rootView = [[[[UIApplication sharedApplication] keyWindow] rootViewController] view];
// Recurse through all its subviews to find
}
下载地址
用户评论