Skip to content

Commit

Permalink
Adds documentation for UIViewController+UIView methods
Browse files Browse the repository at this point in the history
  • Loading branch information
theextremeprogrammer committed Jul 8, 2019
1 parent a6aaec8 commit aaa7847
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Succinct/UIViewController/UIViewController+UIView.swift
@@ -1,8 +1,20 @@
extension UIViewController {
///
/// Searches the entire view hierarchy of a view controller's primary view for a UIView whose background color matches the searchColor.
///
/// - Note: Once an object is found matching the provided criteria the remainder of the view hierarchy is **not** searched.
///
/// - Parameter searchColor: UIColor to compare to the backgroundColor of any UIView objects that are found.
/// - Returns: A boolean value indicating if a UIView object was found or not.
public func hasView(withBackgroundColor searchColor: UIColor) -> Bool {
return view.hasView(withBackgroundColor: searchColor)
}


///
/// Searches the entire view hierarchy of a view controller's primary view for all UIView objects whose background color matches the provided searchColor.
///
/// - Parameter searchColor: UIColor to compare to the backgroundColor of any UIView objects that are found.
/// - Returns: An integer representing the total number of views found where the searchColor matches the backgroundColor of a UIView object.
public func countOfViews(withBackgroundColor searchColor: UIColor) -> Int {
return view.countOfViews(withBackgroundColor: searchColor)
}
Expand Down

0 comments on commit aaa7847

Please sign in to comment.