WatchCon is a tool which enables creating easy connectivity between iOS and WatchOS.

Overview

WatchCon

Build Status CocoaPods Compatible Carthage Compatible Platform License

WatchCon

WatchCon is a tool which enables creating easy connectivity between iOS and WatchOS

Requirements

iOS 9.0+ / watchOS 2.0+

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate WatchCon into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
	pod 'WatchCon', '1.0'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

brew update
brew install carthage

To integrate WatchCon into your Xcode project using Carthage, specify it in your Cartfile:

github "abdullahselek/WatchCon" ~> 1.0

Run carthage update to build the framework and drag the built WatchCon.framework into your Xcode project.

Callbacks to give information about current processes

WatchConSessionDelegate
  • Called when the session has completed activation. With state WCSessionActivationStateNotActivated is succeed
- (void)activationDidCompleteWithState:(WCSessionActivationState)activationState
                                 error:(nullable NSError *)error __IOS_AVAILABLE(9.3) __WATCHOS_AVAILABLE(2.2);
  • Called when the session can no longer be used to modify or add any new transfers
- (void)sessionDidBecomeInactive:(WCSession *)session __IOS_AVAILABLE(9.3) __WATCHOS_UNAVAILABLE;
  • Called when all delegate callbacks for the previously selected watch has occurred
- (void)sessionDidDeactivate:(WCSession *)session __IOS_AVAILABLE(9.3) __WATCHOS_UNAVAILABLE;
  • Called when any of the Watch state properties change
- (void)sessionWatchStateDidChange:(WCSession *)session __WATCHOS_UNAVAILABLE;
  • Called when the reachable state of the counterpart app changes
- (void)sessionReachabilityDidChange:(WCSession *)session;
  • Called on the delegate of the receiver. Will be called on startup if an applicationContext is available
- (void)didReceiveApplicationContext:(NSDictionary<NSString *, id> *)applicationContext;
  • Will be called in receiver on startup if the user info finished transferring when the receiver was not running
- (void)didReceiveUserInfo:(NSDictionary<NSString *, id> *)userInfo;
  • Called on the sending side after the file transfer has successfully completed or failed with an error
- (void)didFinishFileTransfer:(WCSessionFileTransfer *)fileTransfer error:(nullable NSError *)error;
  • Will be called on startup if the file finished transferring when the receiver was not running
- (void)didReceiveFile:(WCSessionFile *)file;

WatchCon Functions

  • Get WathCon instance
+ (instancetype)sharedInstance;
  • Activates session
- (void)activate;
  • A way to transfer the latest state of an app
- (void)updateApplicationContext:(NSDictionary<NSString *, id> *)dictionary;
  • Transfers user info
- (void)transferUserInfo:(NSDictionary<NSString *, id> *)dictionary;
  • Transfer file on the given url
- (BOOL)transferFile:(NSURL *)url metadataDict:(nullable NSDictionary<NSString *, id> *)metadataDict;
  • Clients can use this method to send messages to the counterpart app
- (void)sendMessage:(NSDictionary<NSString *, id> *)message
    completionBlock:(void (^)(NSDictionary * _Nullable result, NSError  * _Nullable error))completionBlock;
  • Clients can use this method to send message data
- (void)sendMessageData:(NSData *)messageData completionBlock:(void (^)(NSData * _Nullable result, NSError  * _Nullable error))completionBlock;

License

MIT License

Copyright (c) 2017 Abdullah Selek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...
Instagram-like photo browser and a camera feature with a few line of code in Swift.
Instagram-like photo browser and a camera feature with a few line of code in Swift.

NOTE: This project is no longer maintained. We highly recommend YPImagePicker. Fusuma Fusuma is a Swift library that provides an Instagram-like photo

A camera view controller with custom image picker and image cropping.
A camera view controller with custom image picker and image cropping.

ALCameraViewController A camera view controller with custom image picker and image cropping. Features Front facing and rear facing camera Simple and c

:mag_right: A simple and beautiful barcode scanner.
:mag_right: A simple and beautiful barcode scanner.

Description BarcodeScanner is a simple and beautiful wrapper around the camera with barcode capturing functionality and a great user experience. Barco

Get the data from Accelerometer, Gyroscope and Magnetometer in only Two or a few lines of code.

Get the data from Accelerometer, Gyroscope and Magnetometer in only Two or a few lines of code. CoreMotion now made insanely simple :octocat: :satellite:

Swift library to easily check the current device and some more info about it.
Swift library to easily check the current device and some more info about it.

Usage To run the example project, clone the repo, and run pod install from the Example directory first. let device = Deviice.current device is a Devi

NFC Forum Well Known Type Data Parser for iOS11 and Core NFC

NFCNDEFParse NFC Forum Well Known Type Data Parser for iOS11 and Core NFC. Supports parsing of types: Text - NFCForum-TS-RTD_Text_1.0 2006-07-24 Uri -

Lightweight Cocoa library for detecting the running device's model and screen size.
Lightweight Cocoa library for detecting the running device's model and screen size.

Lightweight Cocoa library for detecting the running device's model and screen size. With the newer  devices, developers have more work to do. This li

iOS & OSX Bluetooth library for RxSwift
iOS & OSX Bluetooth library for RxSwift

RxBluetoothKit is a Bluetooth library that makes interaction with BLE devices much more pleasant. It's backed by RxSwift and CoreBluetooth and it prov

iOS Bluetooth LE framework
iOS Bluetooth LE framework

Features A futures interface replacing protocol implementations. Timeout for Peripheral connection, Service scan, Service + Characteristic discovery a

Releases(1.0)
Owner
Abdullah Selek
Software geek at @mimecast. ML enthusiast at @verifid. Previously @heremaps, @NetasTr, @hepsiburada
Abdullah Selek
Easily communicate between iOS/OSX devices using BLE

BluetoothKit Easily communicate between iOS devices using BLE. Background Apple mostly did a great job with the CoreBluetooth API, but because it enca

Rasmus Høhndorf Hummelmose 2.1k Dec 29, 2022
A better way to operate QR Code in Swift, support iOS, macOS, watchOS and tvOS.

EFQRCode is a lightweight, pure-Swift library for generating stylized QRCode images with watermark or icon, and for recognizing QRCode from images, in

EFPrefix 4.3k Jan 2, 2023
🛰 CoreLocation Made Easy - Efficient & Easy Location Tracker, IP Location, Gecoder, Geofence, Autocomplete, Beacon Ranging, Broadcaster and Visits Monitoring

Location Manager Made Easy SwiftLocation is a lightweight Swift Library that provides an easy way to work with location-related functionalities. No mo

Daniele Margutti 3.2k Dec 30, 2022
Simple motion detector for ⌚️ (watchOS) shake gesture.

WatchShaker Simple motion detector for ⌚️ (watchOS) shake gesture. WatchShaker is a watchOS helper to get your ⌚️ shake movements Requirements watchOS

Ezequiel França 200 Dec 22, 2022
Light weight tool for detecting the current device and screen size written in swift.

Device detect the current  device model and screen size. Installation CocoaPods Device is available through CocoaPods. To install it, simply add the

Lucas Ortis 1.5k Dec 28, 2022
Easy Haptic Feedback Generator 📳

Haptica is an easy haptic feedback generator. $ pod try Haptica Requirements iOS 9.0+ Xcode 8.0+ Swift 5 (Haptica 3.x), Swift 4 (Haptica 2.x), Swift

Lasha Efremidze 702 Jan 1, 2023
Haptico 📳 - easy to use haptic feedback generator with pattern-play support

Haptico Haptico is easy to use iOS haptic feedback generator. Besides default haptic feedbacks it can play patterns! Checkout Example project. Table o

Sapozhnik Ivan 462 Jan 1, 2023
Library for iOS Camera API. Massively increase performance and ease of use within your next iOS Project.

CameraKit helps you add reliable camera to your app quickly. Our open source camera platform provides consistent capture results, service that scales,

CameraKit 628 Dec 27, 2022
Luminous provides you a lot of information about the system and a lot of handy methods to quickly get useful data on the iOS platform.

Luminous Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements iOS 8+ Swift 5 Xcode 1

Andrea Mario Lufino 324 Nov 27, 2022
Writes twitter and contact (links) to writable nfcs on iPhone 7+ iOS 14+

nfc writer ios app nfc writer app is a hacky fun side project that writes twitter and contact (links) to writable nfcs. runs on iPhone 7+ iOS 14+. joi

Vivian Phung 5 Nov 23, 2022