b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

iOSSDK体系架构(7)

电脑杂谈  发布时间:2019-09-03 14:04:30  来源:网络整理

RCMentionedType定义如下:

//RCStatusDefine Class
#pragma mark RCMentionedType - 消息中@提醒的类型
/*!
 @提醒的类型
 */
typedef NS_ENUM(NSUInteger, RCMentionedType) {
   /*!
   @所有人
   */
   RC_Mentioned_All = 1,
   /*!
   @部分指定用户
   */
   RC_Mentioned_Users = 2,
};

@消息推送会越过所有免打扰逻辑,给客户推送Push通知。

即使您使用的是IMLibSDK集成,可参考。

从2.6.8版本开始,支持消息撤回功能。在RCIM.h文件中,通过修改enableMessageRecall来启动该功能,默认为关闭状况。

//RCIM Class
/*!
 是否开启消息撤回功能,默认值是 NO。
 */
@property(nonatomic, assign) BOOL enableMessageRecall;

在RCIM.h文件中,通过maxRecallDuration设置消息可中止的时间值,默认为120秒,表示消息发送后120秒内可以选择撤回该消息。

//RCIM Class
/*!
消息可撤回的最大时间,单位是秒,默认值是 120s。
*/
@property(nonatomic, assign) NSUInteger maxRecallDuration;

调用下面接口,您也可以自己来推动撤回消息的功能:

//RCIMClient Class
/*!
 撤回消息并更新UI
 @param messageId 被撤回的消息Id
 @discussion 只有存储并发送成功的消息才可以撤回。
 */
- (void)recallMessage:(long)messageId;

阅读回执功能修改

IMKitSDK中已推动阅读回执功能,默认为关闭状况,您可以借助RCIM的下面接口进入消息的阅读回执功能,目前仅支持单聊、群聊。

//RCIM Class
/*!
 开启已读回执功能的会话类型,默认为空
 @discussion 这些会话类型的消息在会话页面显示了之后会发送已读回执。目前仅支持单聊、群聊。
 */
@property(nonatomic, copy) NSArray* enabledReadReceiptConversationTypeList;

单击查看群组消息阅读功能产品介绍。

通过设置enableSyncReadStatus开启多端阅读消息数同步功能。默认为NO关闭状态。

//RCIM Class
/*!
 是否开启多端同步未读状态的功能,默认值是 NO
 @discussion 开启之后,用户在其他端上阅读过的消息,当前客户端会清掉该消息的未读数。目前仅支持单聊、群聊。
 */
@property(nonatomic, assign) BOOL enableSyncReadStatus;

即使聊天的用户正在输入文字以及正在录制语音消息,SDK可以在会话页面的NavigationBar的Title中显示对方正在输入和对方正在讲话的提醒。

您可以借助RCIM的下面接口进入输入状况提示的功能,目前仅支持单聊。

// RCIM Class
/*!
 是否开启发送输入状态,默认值是NO,开启之后在输入消息的时候对方可以看到正在输入的提示(目前只支持单聊)
 */
@property(nonatomic, assign) BOOL enableTypingStatus;

融云IMKit中提供位置实时共享功能,功能支持在单聊中使用。

上面以Demo中的代码为例,说明集成流程。以下代码,可以在SealTalk的RCDChatViewController.m中找到。SealTalk源码下载地址

引入头文件

//RCDChatViewController Class
#import "RealTimeLocationEndCell.h"
#import "RealTimeLocationStartCell.h"
#import "RealTimeLocationStatusView.h"
#import "RealTimeLocationViewController.h"

修改协议和代理

//RCDChatViewController Class
@interface RCDChatViewController () < RCRealTimeLocationObserver,
    RealTimeLocationStatusViewDelegate>
@property(nonatomic, weak) id<RCRealTimeLocationProxy> realTimeLocation;
@property(nonatomic, strong)
    RealTimeLocationStatusView *realTimeLocationStatusView;

注册自定义消息cell

//RCDChatViewController Class
  [self registerClass:[RealTimeLocationStartCell class]
      forMessageClass:[RCRealTimeLocationStartMessage class]];
  [self registerClass:[RealTimeLocationEndCell class]
      forMessageClass:[RCRealTimeLocationEndMessage class]];

获取即时位置共享服务,并配置给当前类。

//RCDChatViewController Class
__weak typeof(&*self) weakSelf = self;
  [[RCRealTimeLocationManager sharedManager]
      getRealTimeLocationProxy:self.conversationType
      targetId:self.targetId
      success:^(id<RCRealTimeLocationProxy> realTimeLocation) {
        weakSelf.realTimeLocation = realTimeLocation;
        [weakSelf.realTimeLocation addRealTimeLocationObserver:self];
        [weakSelf updateRealTimeLocationStatus];
      }
      error:^(RCRealTimeLocationErrorCode status) {
        NSLog(@"get location share failure with code %d", (int)status);
      }];

在单击位置时弹出位置实时共享

//RCDChatViewController Class
- (void)pluginBoardView:(RCPluginBoardView *)pluginBoardView
     clickedItemWithTag:(NSInteger)tag {
  switch (tag) {
  case PLUGIN_BOARD_ITEM_LOCATION_TAG: {
    if (self.realTimeLocation) {
      UIActionSheet *actionSheet = [[UIActionSheet alloc]
                   initWithTitle:nil
                        delegate:self
               cancelButtonTitle:@"取消"
          destructiveButtonTitle:nil
               otherButtonTitles:@"发送位置", @"位置实时共享", nil];
      [actionSheet showInView:self.view];
    } else {
      [super pluginBoardView:pluginBoardView clickedItemWithTag:tag];
    }
  } break;

单击actionSheet执行位置实时共享

//RCDChatViewController Class
- (void)actionSheet:(UIActionSheet *)actionSheet
    clickedButtonAtIndex:(NSInteger)buttonIndex {
  switch (buttonIndex) {
  case 0: {
    [super pluginBoardView:self.pluginBoardView
        clickedItemWithTag:PLUGIN_BOARD_ITEM_LOCATION_TAG];
  } break;
  case 1: {
    [self showRealTimeLocationViewController];
  } break;
  }
}

将下面所有步骤或者方式中相关的的代码都拷贝到您的工程中,就可以正常使用位置实时共享功能了。

从IMKitSDK2.9.0版本开始,支持会话中长按消息后,显示消息多选功能,可以自定义点击事件

1、开发者在长按消息后发生更多选项,能够多选消息,SDK默认实现多选消息删除功能

2、通过以下属性可更改会话页面多选状态和初始状态

ifly格式_ifly格式如何打开_ifly文件用什么打开

/*!
 会话页面消息是否可编辑选择,如果为 YES,消息 cell 会变为多选样式,如果为 NO,页面恢复初始状态。
 */
@property(nonatomic, assign) BOOL allowsMessageCellSelection;

3、如果必须设置SDK内置消息是否允许多选,可通过在会话页面重写上面步骤,修改消息cell的allowsSelection属性,自定义消息一旦允许多选,也可以修改此属性。

//RCConversationViewController
/*!
 即将显示消息Cell的回调
 @param cell        消息Cell
 @param indexPath   该Cell对应的消息Cell数据模型在数据源中的索引值
 @discussion 您可以在此回调中修改Cell的显示和某些属性。
 */
- (void)willDisplayMessageCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath;
//RCMessageBaseCell
/*!
 是否允许选择
 */
@property(nonatomic) BOOL allowsSelection;

4、进入多选状态后,底部的视图为:

//RCConversationViewController
/*!
 消息编辑选择的状态下页面底部出现的工具视图
 */
@property(nonatomic, strong) UIToolbar *messageSelectionToolbar;

即使开发者想添加对多选消息的操作事件,如转发、收藏等,可以在viewDidLoad中借助给messageSelectionToolbar添加UIBarButtonItem的方法添加事件。


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-121563-7.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    • 陈文海
      陈文海

      马云你狂妄的不知所云了

    • 芮雪霞
      芮雪霞

      '

      • 卢嗣业
        卢嗣业

        这样他就有理由制裁在国际上摸黑我们了

    热点图片
    拼命载入中...