2017-01-07 5 views
1

私のchatviewcontrollerにステッカーを統合しています。QuickBloxのiOSコードにステッカーを実装するには

しかし、どうすれば理解できるのでしょうか。Quickbloxのドキュメントにはいくつかのコードスニペットがありますが、コードの配置場所とステッカーの取り扱い方法は混乱しています。 enter code here

https://quickblox.com/developers/SimpleSample-chat_users-ios#Stickers

1 . pod "StickerPipe" - Done 
2 . [STKStickersManager initWitApiKey:@"API_KEY"]; - Done 
3. if ([STKStickersManager isStickerMessage:message]) { 
[self.stickerImageView stk_setStickerWithMessage:message placeholder:nil placeholderColor:nil progress:nil completion:nil]; 
} 

これは私がチャットの入力TextViewのために書くために必要なコードです。そして、どのように

@property (strong, nonatomic) STKStickerController *stickerController; 
self.inputTextView.inputView = self.stickerController.stickersView; 
[self reloadStickersInputViews]; 

は、プロパティを書きましたが、ステッカー

5を処理する方法がわかりません。

- (void)stickerController:(STKStickerController *)stickerController didSelectStickerWithMessage:(NSString *)message { 

//Send sticker message 
} 

デリゲート内のコードは何ですか。

お勧めします。

+0

こんにちはGaurav、私は同じ問題、iOS QuickBloxアプリケーションでStrikerPipe SDKを実装する方法があります。あなたは解決策を手に入れますか? –

+0

現在私は解決策がありません。 –

答えて

0

ユーザー選択シール'stickerviewcontroller'からdidSelectStickerWithMessageデリゲートが選択されると、 はステッカー・ビュー・コントローラからステッカーメッセージが供給するために、このデリゲートメソッドを使用してUIImageView ( UIImageView+Stickers.h)でそれを表示します - 私はあなたが答えを超える理解し、あなたがより多くの詳細については、クエリを頼むことを願って

- (void)stk_setStickerWithMessage: (NSString*)stickerMessage completion: (STKCompletionBlock)completion;

。私たちは、手順に従って、ステッカーを追加することができます

1

、私は同様に、我々は

にも入ってくるために私を追加することができ、発信のために追加されている)QMChatStickerOutGoingCellと呼ばれる細胞を作成し、ImageViewのプロパティを持ってい

II stickerImageViewを言う)ChatViewController(サブクラスQMChatViewControllerの)ⅲ)ステッカー

を更新しますので、私たちのような

- (Class)viewClassForItem:(QBChatMessage *)item { 
if ([STKStickersManager isStickerMessage: item.text]) { 
     return [QMChatStickerOutGoingCell class]; 
    } 
//Add condition for other cells 

} 

の下に実行することができますQMChatStickerOutGoingCellのための細胞タイプを知っておく必要があります

- (void)collectionView:(QMChatCollectionView *)collectionView 
configureCell:(UICollectionViewCell *)cell forIndexPath:(NSIndexPath 
*)indexPath{ 
[super collectionView:collectionView configureCell:cell forIndexPath:indexPath]; 

QMChatCell *chatCell = (QMChatCell *)cell; 

// subscribing to cell delegate 
[chatCell setDelegate:self]; 

[chatCell containerView].highlightColor = [UIColor colorWithWhite:0.5 alpha:0.5]; 


QBChatMessage *message = [self.chatDataSource messageForIndexPath:indexPath]; 

if ([cell isKindOfClass:[QMChatStickerOutGoingCell class]]){ 
    [chatCell containerView].bgColor = [UIColor redColor]; 
    [(QMChatStickerOutGoingCell *)chatCell fillWithStickerMessage: message.text downloaded: [self.stickerController isStickerPackDownloaded: message.text]]; 
} 

//Handle for other cells 
} 
関連する問題