custom-collection

Bug with For Each enumeration on x64 Custom Classes

扶醉桌前 提交于 2021-01-20 16:08:25
问题 I have found a bug in VBA a few months ago and was unable to find a decent workaround. The bug is really annoying as it kind of restricts a nice language feature. When using a Custom Collection Class it is quite common to want to have an enumerator so that the class can be used in a For Each loop. This can be done by adding this line: Attribute [MethodName].VB_UserMemId = -4 'The reserved DISPID_NEWENUM immediately after the function/property signature line either by: Exporting the class

Bug with For Each enumeration on x64 Custom Classes

烂漫一生 提交于 2021-01-20 16:07:52
问题 I have found a bug in VBA a few months ago and was unable to find a decent workaround. The bug is really annoying as it kind of restricts a nice language feature. When using a Custom Collection Class it is quite common to want to have an enumerator so that the class can be used in a For Each loop. This can be done by adding this line: Attribute [MethodName].VB_UserMemId = -4 'The reserved DISPID_NEWENUM immediately after the function/property signature line either by: Exporting the class

UICollectionView with different cell size

不想你离开。 提交于 2019-12-06 00:14:11
问题 My goal is to create a UICollectionView with a layout as depicted below. Is this possible without creating a custom UICollectionViewLayout ? 回答1: Use UICollectionViewDelegateFlowLayout method. func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { let width : CGFloat let height : CGFloat if indexPath.item == 0 { width = 100 height = 100 } else { width = 50 height = 50 } return

UICollectionView with different cell size

非 Y 不嫁゛ 提交于 2019-12-04 05:27:44
My goal is to create a UICollectionView with a layout as depicted below. Is this possible without creating a custom UICollectionViewLayout ? Use UICollectionViewDelegateFlowLayout method. func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize { let width : CGFloat let height : CGFloat if indexPath.item == 0 { width = 100 height = 100 } else { width = 50 height = 50 } return CGSizeMake(width, height) } Without creating a custom layout of collection view it is not possible to achieve what