There are no reviews yet. Be the first to send feedback to the community and the maintainers!
![Wormhole Banner](https://raw.githubusercontent.com/nixzhu/Wormhole/master/images/wormhole_banner.png) # Wormhole Wormhole is not just a Swift port of [MMWormhole](https://github.com/mutualmobile/MMWormhole) but with better API and use logic. You can remove any a listener from it separately. ## Example In WatchKit extension, passing a message: ```Swift import Wormhole let wormhole = Wormhole(appGroupIdentifier: "group.com.nixWork.Wormhole", messageDirectoryName: "Wormhole") wormhole.passMessage(NSNumber(bool: lightState), withIdentifier: "lightState") ``` In App, make a listener and listen a message: ```Swift import Wormhole let wormhole = Wormhole(appGroupIdentifier: "group.com.nixWork.Wormhole", messageDirectoryName: "Wormhole") lazy var lightStateListener: Wormhole.Listener = { let action: Wormhole.Listener.Action = { [unowned self] message in if let lightState = message as? NSNumber { self.lightStateLabel.text = lightState.boolValue ? "Light On" : "Light Off" } } let listener = Wormhole.Listener(name: "lightStateLabel", action: action) return listener }() wormhole.bindListener(lightStateListener, forMessageWithIdentifier: "lightState") ``` Now easy to remove a listener: ```Swift wormhole.removeListener(lightStateListener, forMessageWithIdentifier: "lightState") ``` or ```Swift wormhole.removeListenerByName("lightStateLabel", forMessageWithIdentifier: "lightState") ``` For more information, see the demo. 另有中文介绍:[再造虫洞:一次 Objective-C 到 Swift 的改写之旅](https://github.com/nixzhu/dev-blog/blob/master/2015-05-27-wormhole.md) ## Installation ### CocoaPods [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command: ```bash $ [sudo] gem install cocoapods ``` To integrate Wormhole into your Xcode project using CocoaPods, specify it in your `Podfile`: ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks! pod 'Wormhole', '~> 1.0' ``` Then, run the following command: ```bash $ pod install ``` You should open the `{Project}.xcworkspace` instead of the `{Project}.xcodeproj` after you installed anything from CocoaPods. For more information about how to use CocoaPods, I suggest [this tutorial](http://www.raywenderlich.com/64546/introduction-to-cocoapods-2). ## Credits Thanks to [Lex Tang](https://github.com/lexrus) design the logo banner. ## License Wormhole is available under the MIT license. See the LICENSE file for more info.
dev-blog
翻译、开发心得或学习笔记MonkeyKing
MonkeyKing helps you to post messages to Chinese Social Networks.Proposer
Make permission request easier.Coolie
Coolie(苦力) helps you to create models (& their constructors) from a JSON file.KeyboardMan
KeyboardMan helps you to make keyboard animation.Sensei
Sensei is a Mac app based on OpenAI API.Baby
Create models from a JSON file, even a Baby can do it.Bible-Assistant
Bible Assistant AppRuler
Size matters, you need a ruler.Navi
Focus on avatar caching.AudioBot
AudioBot helps you do audio record & playback.Redstone
Redstone has a State MachineSharedBaby
Baby's web interface.nixBoard
一块简易的围棋棋盘HelloMou
The translation(Chinese) of Markdown Editor Mou's Hello.mdGentleTouch
Touch yourself, with WATCH.Ananda
JSON model decoding based on yyjson.AdaptiveChartDemo
Generate chart image from simple data, for WATCHcomputation
Understanding Computation: From Simple Machines to Impossible ProgramsAppClip
Create Web Clip for App.rushGo
围棋急速入门,关于围棋的介绍,使对围棋感兴趣的人对围棋的规则有个快速了解。nixhttpd
简易的http服务器以及测试环境KeypathObserver
KeypathObserver helps you do KVO observing.nixGoBoard
在iOS上实现的棋盘应用,可用于在生活中遇到某个围棋爱好者时,将iPad当做棋盘来一局,仅此而已。SuperPreview
SuperPreview for Image PreviewAutoReview
AutoReview has a nice logic for show prompt of app review.PropertyListenerDemo
Listen, they're changed!MentionInUITextViewDemo
Detect mention in UITextViewTextureDemo
algorithm-playgrounds
Try some algorithmsAutoLayoutInUIScrollView
AutoLayout in UIScrollView DemoStateMachineDemo
Simple State Machine Democoolie-cli
Coolie's command-line interfaceWorkerBee
WorkerBee is a toolkitCenterTwoViewsUseAutoLayout
AutoLayout Tip 142
The answer to life, the universe and everything.NotificationCenterDemo
sgf2asy
转换sgf格式的围棋棋谱为asy矢量格式的脚本Girl
A HTML Parsernixzhu.github.io
code-reading
Notes from code readingLove Open Source and this site? Check out how you can help us