RemoteBus 1.0.0

RemoteBus 1.0.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2015年5月

Arturo Gutierrez维护。



RemoteBus 1.0.0

  • 作者
  • Arturo Gutierrez

小型库,用于在 iOS 应用和扩展之间传递消息。RemoteBus 通过模拟应用程序和扩展之间的总线,提供了一种同步数据或简单传递事件的方法。

演示

Demo

用法

    // Create bus for this app group and name
    remoteBus = [[RBRemoteBus alloc] initWithName:@"OneBus" appGroupIdentifier:@"group.com.arturogutierrez.remotebus"];

    // Subscribe for remote events
    [remoteBus subscribeForIdentifier:@"SomeEventIdentifier" subscriber:^(RBMessage *message) {
        NSString *text = (NSString *) message.body;
        [self.label setText:text];
    }];

    // Pass an event
    RBMessage *message = [[RBMessage alloc] initWithIdentifier:@"AnotherEventIdentifier" body:@"Hey there!"];
    [remoteBus sendMessage:message];

安装

  • 下载源文件(Classes 文件夹)并将其添加到您的项目中或通过 CocoaPods 安装。
  • 配置您的应用程序和扩展以使用同一应用程序组容器。您可以在这里了解如何操作这里这里

Pod

它将很快通过 CocoaPods 提供使用。

例子

您可以在 示例 文件夹中查看一个示例或直接查看 测试

开发者

Follow me on Twitter Add me to Linkedin

许可证

Copyright 2015 Arturo Gutiérrez Díaz-Guerra

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://apache.ac.cn/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.