Skip to content

Latest commit

 

History

History
46 lines (39 loc) · 1 KB

README.md

File metadata and controls

46 lines (39 loc) · 1 KB

Swift View Query

Vquery Features

  • Vquery provides a query service for views in both UIKit and AppKit for Swift.
  • Vquery supports xib layouts well.
  • Supports SPM and CocoaPods management.

Installation

  • Manual import of the file Vquery.swift
import Vquery
  • SPM(Swift Package Manager):
https://github.com/Meterwhite/VquerySwift
  • CocoaPods:
    pod 'Vquery'

Sample Code

  • Query the view and perform some
someView.vquery{ $0.tag == index }.foreach{ $0.isHidden = true }
  • Query by matching type and condition:
someView.vquery(ofType: MyLabel.self){ $0.yearTitle == "2024" }
  • Query sibling views by matching type and condition:
someView.vquerySibling(ofType: MyLabel.self){ $0.yearTitle == "2024" }
  • Work with views laid out in xib:
someView.vqueryByInspector(tag: index, accessibilityLabel: "Row Title")

More Details

  • Check out the Demo:
    • Click< > Code-> Download ZIP
    • Open the project Vquery-demo