From 7f632008c56209a5a61d89a9d945d5348b364aea Mon Sep 17 00:00:00 2001 From: aricloverEXALT <157071384+aricloverEXALT@users.noreply.github.com> Date: Sun, 12 Jan 2025 16:25:38 -0600 Subject: [PATCH] Update YTPivotBarReorder.m --- Sources/YTPivotBarReorder.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Sources/YTPivotBarReorder.m b/Sources/YTPivotBarReorder.m index 248b4fc..58178bc 100644 --- a/Sources/YTPivotBarReorder.m +++ b/Sources/YTPivotBarReorder.m @@ -68,11 +68,21 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath]; - UILabel *indexLabel = [[UILabel alloc] initWithFrame:cell.contentView.bounds]; + YTIPivotBarItemRenderer *itemRenderer = self.pivotBarItems[indexPath.row]; + + UILabel *indexLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, cell.contentView.bounds.size.width, cell.contentView.bounds.size.height/2)]; indexLabel.text = [NSString stringWithFormat:@"%ld", (long)indexPath.row]; indexLabel.textAlignment = NSTextAlignmentCenter; indexLabel.textColor = [UIColor whiteColor]; + + UILabel *identifierLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, cell.contentView.bounds.size.height/2, cell.contentView.bounds.size.width, cell.contentView.bounds.size.height/2)]; + identifierLabel.text = itemRenderer.pivotIdentifier; + identifierLabel.textAlignment = NSTextAlignmentCenter; + identifierLabel.textColor = [UIColor whiteColor]; + identifierLabel.font = [UIFont systemFontOfSize:10]; + [cell.contentView addSubview:indexLabel]; + [cell.contentView addSubview:identifierLabel]; return cell; }