How to get the number of collection view cells of a collection view?

Hi,

I wanted to ask about how to: get the number of collection view cells of a collection view in iOS using Appium/Ruby?

Thanks in advance for any help!

Not sure about ruby but something like:
driver.findElement(By.className(“UIACollectionView”)).findElements(By.className(“UIACollectionCell”)).size()

It would be better if you could use IDs