diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index c87673b..cc591c5 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -144,6 +144,7 @@ 048FFD1D2F277486005D62AE /* KBChatHistoryPageModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 048FFD1C2F277486005D62AE /* KBChatHistoryPageModel.m */; }; 048FFD1E2F277486005D62AE /* KBChatHistoryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 048FFD1A2F277486005D62AE /* KBChatHistoryModel.m */; }; 048FFD242F28A836005D62AE /* KBChatLimitPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 048FFD232F28A836005D62AE /* KBChatLimitPopView.m */; }; + 048FFD272F28C6CF005D62AE /* KBImagePositionButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 048FFD262F28C6CF005D62AE /* KBImagePositionButton.m */; }; 0498BD622EDFFC12006CC1D5 /* KBMyVM.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD612EDFFC12006CC1D5 /* KBMyVM.m */; }; 0498BD652EE0116D006CC1D5 /* KBEmailLoginVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD642EE0116D006CC1D5 /* KBEmailLoginVC.m */; }; 0498BD682EE01180006CC1D5 /* KBEmailRegistVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0498BD672EE01180006CC1D5 /* KBEmailRegistVC.m */; }; @@ -544,6 +545,8 @@ 048FFD1C2F277486005D62AE /* KBChatHistoryPageModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBChatHistoryPageModel.m; sourceTree = ""; }; 048FFD222F28A836005D62AE /* KBChatLimitPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBChatLimitPopView.h; sourceTree = ""; }; 048FFD232F28A836005D62AE /* KBChatLimitPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBChatLimitPopView.m; sourceTree = ""; }; + 048FFD252F28C6CF005D62AE /* KBImagePositionButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBImagePositionButton.h; sourceTree = ""; }; + 048FFD262F28C6CF005D62AE /* KBImagePositionButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBImagePositionButton.m; sourceTree = ""; }; 0498BD5E2EDF2157006CC1D5 /* KBBizCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBBizCode.h; sourceTree = ""; }; 0498BD602EDFFC12006CC1D5 /* KBMyVM.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBMyVM.h; sourceTree = ""; }; 0498BD612EDFFC12006CC1D5 /* KBMyVM.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyVM.m; sourceTree = ""; }; @@ -1234,6 +1237,8 @@ 049FB20D2EC1CD2800FAB05D /* KBAlert.m */, 042869FD2ECAEF2B00CE730C /* KBMoneyBtn.h */, 042869FE2ECAEF2B00CE730C /* KBMoneyBtn.m */, + 048FFD252F28C6CF005D62AE /* KBImagePositionButton.h */, + 048FFD262F28C6CF005D62AE /* KBImagePositionButton.m */, ); path = V; sourceTree = ""; @@ -2444,6 +2449,7 @@ 0477BEA22EBCF0000055D639 /* KBTopImageButton.m in Sources */, A1B2E1012EBC7AAA00000001 /* KBTopThreeView.m in Sources */, A1B2E1022EBC7AAA00000001 /* HomeHotCell.m in Sources */, + 048FFD272F28C6CF005D62AE /* KBImagePositionButton.m in Sources */, 0459D1B72EBA287900F2D189 /* KBSkinManager.m in Sources */, 04286A002ECAEF2B00CE730C /* KBMoneyBtn.m in Sources */, 048908F52EC0496400FABA60 /* KBShopItemVC.m in Sources */, diff --git a/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/Contents.json new file mode 100644 index 0000000..1e3d484 --- /dev/null +++ b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ai_comment_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ai_comment_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@2x.png b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@2x.png new file mode 100644 index 0000000..d2179a0 Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@3x.png b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@3x.png new file mode 100644 index 0000000..fccee2f Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_comment_icon.imageset/ai_comment_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/Contents.json new file mode 100644 index 0000000..7745d69 --- /dev/null +++ b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ai_live_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ai_live_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@2x.png b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@2x.png new file mode 100644 index 0000000..13f3bd7 Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@3x.png b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@3x.png new file mode 100644 index 0000000..0475e00 Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_live_icon.imageset/ai_live_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/Contents.json new file mode 100644 index 0000000..8fcd724 --- /dev/null +++ b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "ai_livesel_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "ai_livesel_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@2x.png b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@2x.png new file mode 100644 index 0000000..588a89b Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@3x.png b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@3x.png new file mode 100644 index 0000000..6f8517f Binary files /dev/null and b/keyBoard/Assets.xcassets/AI/ai_livesel_icon.imageset/ai_livesel_icon@3x.png differ diff --git a/keyBoard/Class/AiTalk/M/KBPersonaModel.h b/keyBoard/Class/AiTalk/M/KBPersonaModel.h index 85d6b0e..7823ee5 100644 --- a/keyBoard/Class/AiTalk/M/KBPersonaModel.h +++ b/keyBoard/Class/AiTalk/M/KBPersonaModel.h @@ -74,6 +74,13 @@ typedef NS_ENUM(NSInteger, KBPersonaVisibility) { /// 更新时间 @property (nonatomic, copy) NSString *updatedAt; +/// 评论数 +@property (nonatomic, copy) NSString *commentCount; +/// 喜欢数 +@property (nonatomic, copy) NSString *likeCount; +/// 是否喜欢 +@property (nonatomic, assign) BOOL liked; + #pragma mark - 扩展属性 diff --git a/keyBoard/Class/AiTalk/V/KBChatTableView.m b/keyBoard/Class/AiTalk/V/KBChatTableView.m index 81f60c0..daf157e 100644 --- a/keyBoard/Class/AiTalk/V/KBChatTableView.m +++ b/keyBoard/Class/AiTalk/V/KBChatTableView.m @@ -89,7 +89,8 @@ static const NSTimeInterval kTimestampInterval = 5 * 60; // 5 分钟 make.edges.equalTo(self); }]; - self.contentBottomInset = KB_TABBAR_HEIGHT + 40 + 10; + // 关键修复:减少初始 contentBottomInset,因为 chatView 已经通过约束避开了底部 + self.contentBottomInset = 20; // 简单的缓冲空间 [self updateContentBottomInset:self.contentBottomInset]; __weak typeof(self) weakSelf = self; diff --git a/keyBoard/Class/AiTalk/V/KBPersonaChatCell.m b/keyBoard/Class/AiTalk/V/KBPersonaChatCell.m index 5f05f7c..724974d 100644 --- a/keyBoard/Class/AiTalk/V/KBPersonaChatCell.m +++ b/keyBoard/Class/AiTalk/V/KBPersonaChatCell.m @@ -10,6 +10,7 @@ #import "KBAiChatMessage.h" #import "KBChatHistoryPageModel.h" #import "AiVM.h" +#import "KBImagePositionButton.h" #import #import @@ -48,6 +49,12 @@ /// AiVM 实例 @property (nonatomic, strong) AiVM *aiVM; +/// 评论按钮 +@property (nonatomic, strong) KBImagePositionButton *commentButton; + +/// 喜欢按钮 +@property (nonatomic, strong) KBImagePositionButton *likeButton; + @end @implementation KBPersonaChatCell @@ -113,6 +120,24 @@ make.centerY.equalTo(self.avatarImageView); }]; + // 评论按钮(最右侧) + [self.contentView addSubview:self.commentButton]; + [self.commentButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.contentView).offset(-20); + make.centerY.equalTo(self.avatarImageView); + make.width.mas_equalTo(40); + make.height.mas_equalTo(50); + }]; + + // 喜欢按钮(评论按钮左侧,间距20px) + [self.contentView addSubview:self.likeButton]; + [self.likeButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.equalTo(self.commentButton.mas_left).offset(-20); + make.centerY.equalTo(self.avatarImageView); + make.width.mas_equalTo(40); + make.height.mas_equalTo(50); + }]; + // 聊天列表 [self.contentView addSubview:self.chatView]; [self.chatView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -147,6 +172,10 @@ // 关键修复:清空消息时停止音频播放,避免状态混乱 [self.chatView stopPlayingAudio]; [self.chatView clearMessages]; + [self.commentButton setTitle:persona.commentCount forState:UIControlStateNormal]; + [self.likeButton setTitle:persona.likeCount forState:UIControlStateNormal]; + self.likeButton.selected = persona.liked; + } #pragma mark - 2:数据加载 @@ -350,7 +379,7 @@ - (UILabel *)nameLabel { if (!_nameLabel) { _nameLabel = [[UILabel alloc] init]; - _nameLabel.font = [UIFont boldSystemFontOfSize:20]; + _nameLabel.font = [UIFont boldSystemFontOfSize:12]; _nameLabel.textColor = [UIColor whiteColor]; _nameLabel.textAlignment = NSTextAlignmentCenter; } @@ -377,4 +406,63 @@ return _chatView; } +- (KBImagePositionButton *)commentButton { + if (!_commentButton) { + // 创建上图下文的按钮 + _commentButton = [[KBImagePositionButton alloc] initWithImagePosition:KBImagePositionTop spacing:4]; + + // 关键修复:先设置字体,再设置文字,避免循环调用 + _commentButton.titleLabel.font = [UIFont systemFontOfSize:10]; + + // 设置图片 + [_commentButton setImage:[UIImage imageNamed:@"ai_comment_icon"] forState:UIControlStateNormal]; + + // 设置文字 + [_commentButton setTitle:@"0" forState:UIControlStateNormal]; + [_commentButton setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.8] forState:UIControlStateNormal]; + + // 添加点击事件 + [_commentButton addTarget:self action:@selector(commentButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; + } + return _commentButton; +} + +- (KBImagePositionButton *)likeButton { + if (!_likeButton) { + // 创建上图下文的按钮 + _likeButton = [[KBImagePositionButton alloc] initWithImagePosition:KBImagePositionTop spacing:4]; + + // 关键修复:先设置字体,再设置文字,避免循环调用 + _likeButton.titleLabel.font = [UIFont systemFontOfSize:10]; + + // 设置图片 + [_likeButton setImage:[UIImage imageNamed:@"ai_live_icon"] forState:UIControlStateNormal]; + [_likeButton setImage:[UIImage imageNamed:@"ai_livesel_icon"] forState:UIControlStateSelected]; + + // 设置文字 + [_likeButton setTitle:@"0" forState:UIControlStateNormal]; + [_likeButton setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.8] forState:UIControlStateNormal]; + + // 添加点击事件 + [_likeButton addTarget:self action:@selector(likeButtonTapped:) forControlEvents:UIControlEventTouchUpInside]; + } + return _likeButton; +} + +#pragma mark - Button Actions + +- (void)commentButtonTapped:(KBImagePositionButton *)sender { + sender.selected = !sender.selected; + NSLog(@"[KBPersonaChatCell] 评论按钮点击,选中状态:%d", sender.selected); + + // TODO: 在这里添加评论逻辑 +} + +- (void)likeButtonTapped:(KBImagePositionButton *)sender { + sender.selected = !sender.selected; + NSLog(@"[KBPersonaChatCell] 喜欢按钮点击,选中状态:%d", sender.selected); + + // TODO: 在这里添加喜欢逻辑 +} + @end diff --git a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m index 9dec325..86dc119 100644 --- a/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m +++ b/keyBoard/Class/AiTalk/VC/KBAIHomeVC.m @@ -422,7 +422,12 @@ - (void)updateChatViewBottomInset { CGFloat bottomSpacing = (self.currentKeyboardHeight > 0.0) ? (self.currentKeyboardHeight + 8.0) : self.baseInputBarBottomSpacing; - CGFloat bottomInset = self.voiceInputBarHeight + bottomSpacing; + + // 关键修复:减少 bottomInset,因为 chatView 已经通过约束避开了底部的 avatar 区域 + // 只需要留出一点空间(比如20)让最后一条消息不紧贴 chatView 底部即可 + CGFloat bottomInset = 20; // 简单的缓冲空间 + + NSLog(@"[KBAIHomeVC] 更新 ChatView bottomInset: %.2f", bottomInset); for (NSIndexPath *indexPath in self.collectionView.indexPathsForVisibleItems) { KBPersonaChatCell *cell = (KBPersonaChatCell *)[self.collectionView cellForItemAtIndexPath:indexPath]; diff --git a/keyBoard/Class/Common/V/KBImagePositionButton.h b/keyBoard/Class/Common/V/KBImagePositionButton.h new file mode 100644 index 0000000..de09e09 --- /dev/null +++ b/keyBoard/Class/Common/V/KBImagePositionButton.h @@ -0,0 +1,39 @@ +// +// KBImagePositionButton.h +// keyBoard +// +// Created by Kiro on 2026/1/27. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 图片位置枚举 +typedef NS_ENUM(NSInteger, KBImagePosition) { + KBImagePositionTop, // 图片在上,文字在下 + KBImagePositionBottom, // 图片在下,文字在上 + KBImagePositionLeft, // 图片在左,文字在右(默认) + KBImagePositionRight // 图片在右,文字在左 +}; + +/// 可以指定图片位置的按钮 +@interface KBImagePositionButton : UIButton + +/// 图片位置(默认 KBImagePositionLeft) +@property (nonatomic, assign) KBImagePosition imagePosition; + +/// 图片和文字之间的间距(默认 8) +@property (nonatomic, assign) CGFloat spacing; + +/** + 便捷初始化方法 + + @param imagePosition 图片位置 + @param spacing 图片和文字之间的间距 + */ +- (instancetype)initWithImagePosition:(KBImagePosition)imagePosition spacing:(CGFloat)spacing; + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Common/V/KBImagePositionButton.m b/keyBoard/Class/Common/V/KBImagePositionButton.m new file mode 100644 index 0000000..25fde43 --- /dev/null +++ b/keyBoard/Class/Common/V/KBImagePositionButton.m @@ -0,0 +1,187 @@ +// +// KBImagePositionButton.m +// keyBoard +// +// Created by Kiro on 2026/1/27. +// + +#import "KBImagePositionButton.h" + +@implementation KBImagePositionButton + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + [self setupDefault]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)coder { + if (self = [super initWithCoder:coder]) { + [self setupDefault]; + } + return self; +} + +- (instancetype)initWithImagePosition:(KBImagePosition)imagePosition spacing:(CGFloat)spacing { + if (self = [super initWithFrame:CGRectZero]) { + _imagePosition = imagePosition; + _spacing = spacing; + [self setupDefault]; + } + return self; +} + +- (void)setupDefault { + // 关键修复:不要判断 _imagePosition == 0,因为 KBImagePositionTop 的值就是 0 + // 如果是通过 initWithFrame 或 initWithCoder 初始化,_imagePosition 默认就是 0 (KBImagePositionTop) + // 只有通过 initWithImagePosition 初始化时,才会明确设置 _imagePosition + + // 为非自定义初始化设置默认值 + if (self.spacing == 0) { + _spacing = 8; + } + + [self updateEdgeInsets]; +} + +#pragma mark - Setter + +- (void)setImagePosition:(KBImagePosition)imagePosition { + _imagePosition = imagePosition; + [self updateEdgeInsets]; + [self setNeedsLayout]; +} + +- (void)setSpacing:(CGFloat)spacing { + _spacing = spacing; + [self updateEdgeInsets]; + [self setNeedsLayout]; +} + +- (void)setImage:(UIImage *)image forState:(UIControlState)state { + [super setImage:image forState:state]; + // 延迟更新,确保 image 已经设置好 + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateEdgeInsets]; + }); +} + +- (void)setTitle:(NSString *)title forState:(UIControlState)state { + [super setTitle:title forState:state]; + // 延迟更新,确保 title 已经设置好 + dispatch_async(dispatch_get_main_queue(), ^{ + [self updateEdgeInsets]; + }); +} + +#pragma mark - EdgeInsets + +- (void)updateEdgeInsets { + CGSize imageSize = self.currentImage.size; + CGSize titleSize = CGSizeZero; + + if (self.currentTitle.length > 0 && self.titleLabel.font) { + NSDictionary *attributes = @{NSFontAttributeName: self.titleLabel.font}; + titleSize = [self.currentTitle sizeWithAttributes:attributes]; + } + + switch (self.imagePosition) { + case KBImagePositionTop: { + // 图片在上,文字在下 + self.imageEdgeInsets = UIEdgeInsetsMake( + -(titleSize.height + self.spacing), // top: 向上移动 + 0, // left + 0, // bottom + -titleSize.width // right: 向左移动文字的宽度 + ); + + self.titleEdgeInsets = UIEdgeInsetsMake( + imageSize.height + self.spacing, // top: 向下移动 + -imageSize.width, // left: 向左移动图片的宽度 + 0, // bottom + 0 // right + ); + break; + } + + case KBImagePositionBottom: { + // 图片在下,文字在上 + self.imageEdgeInsets = UIEdgeInsetsMake( + titleSize.height + self.spacing, // top: 向下移动 + 0, // left + 0, // bottom + -titleSize.width // right + ); + + self.titleEdgeInsets = UIEdgeInsetsMake( + -(imageSize.height + self.spacing), // top: 向上移动 + -imageSize.width, // left + 0, // bottom + 0 // right + ); + break; + } + + case KBImagePositionLeft: { + // 图片在左,文字在右(默认) + self.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, self.spacing); + self.titleEdgeInsets = UIEdgeInsetsMake(0, self.spacing, 0, 0); + break; + } + + case KBImagePositionRight: { + // 图片在右,文字在左 + self.imageEdgeInsets = UIEdgeInsetsMake( + 0, + titleSize.width + self.spacing, + 0, + -(titleSize.width + self.spacing) + ); + + self.titleEdgeInsets = UIEdgeInsetsMake( + 0, + -(imageSize.width + self.spacing), + 0, + imageSize.width + self.spacing + ); + break; + } + } + NSLog(@"imageEdgeInsets: %@", NSStringFromUIEdgeInsets(self.imageEdgeInsets)); + NSLog(@"titleEdgeInsets: %@", NSStringFromUIEdgeInsets(self.titleEdgeInsets)); +} + +- (CGSize)intrinsicContentSize { + CGSize imageSize = self.currentImage ? self.currentImage.size : CGSizeZero; + CGSize titleSize = CGSizeZero; + + if (self.currentTitle.length > 0 && self.titleLabel.font) { + NSDictionary *attributes = @{NSFontAttributeName: self.titleLabel.font}; + titleSize = [self.currentTitle sizeWithAttributes:attributes]; + } + + CGSize size = CGSizeZero; + + switch (self.imagePosition) { + case KBImagePositionTop: + case KBImagePositionBottom: { + // 垂直排列 + size.width = MAX(imageSize.width, titleSize.width); + size.height = imageSize.height + self.spacing + titleSize.height; + break; + } + + case KBImagePositionLeft: + case KBImagePositionRight: { + // 水平排列 + size.width = imageSize.width + self.spacing + titleSize.width; + size.height = MAX(imageSize.height, titleSize.height); + break; + } + } + + return size; +} + +@end