MCAdvertiserAssistant

1 MCAdvertiserAssistant

  1. Configuring and Initialization
  2. Starting and Stopping the Assistant

2 MCAdvertiserAssistantDelegate

  1. Advertiser Assistant Delegate Methods

1 MCAdvertiserAssistant

MCAdvertiserAssistant主要用户发出广播供附近的设备发现。

1.1 Configuring and Initialization

/// 初始化MCAdvertiserAssistant
public init(serviceType: String, discoveryInfo info: [String : String]?, session: MCSession)

/// MCAdvertiserAssistantDelegate代理
weak public var delegate: MCAdvertiserAssistantDelegate?
/// 会话
public var session: MCSession { get }
/// 信息字典
public var discoveryInfo: [String : String]? { get }
/// 标示名称
public var serviceType: String { get }

1.2 Starting and Stopping the Assistant

/// 开始广播
public func start()

/// 结束广播
public func stop()

2 MCAdvertiserAssistantDelegate

2.1 Advertiser Assistant Delegate Methods

/// 发出请求
@available(iOS 7.0, *)
optional public func advertiserAssistantWillPresentInvitation(advertiserAssistant: MCAdvertiserAssistant)

/// 结束请求
@available(iOS 7.0, *)
optional public func advertiserAssistantDidDismissInvitation(advertiserAssistant: MCAdvertiserAssistant)

 

Appendix

Sample Code

Swift

Multipeer Connectivity Framework Reference

MCAdvertiserAssistant Class Reference

MCAdvertiserAssistantDelegate Class Reference

Revision History

时间 描述
2016-01-22 博文完成

CSDN:http://blog.csdn.net/y550918116j

GitHub:https://github.com/937447974/Blog

你可能感兴趣的:(MCAdvertiserAssistant)