ivarList = class_copyIvarList(UICollectionView.self, &count) for i in (0..<Int(count)) { let unwrapped = ivarList?[i].unsafelyUnwrapped if let ivar = ivar_getName(unwrapped), let typeEncoding = ivar_getTypeEncoding(unwrapped) { let propertyName = String(cString: ivar) let typeEncoding = String(cString: typeEncoding) print("Property:\(propertyName), Type:\(typeEncoding)") } } free(ivarList)