GithubHelp home page GithubHelp logo

chrisgrant / tvos_remote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vivianaranha/tvos_remote

0.0 1.0 0.0 1.38 MB

Creating a remote for tvOS - Support for TvOS App and iOS App

License: MIT License

Objective-C 100.00%

tvos_remote's Introduction

#Apple TV Project (Receiver)

Step 1: Create a TvOS Project and import the files from RemoteReceiver

libRemoteReceiver.a
RemoteReceiver.h

Step 2: In your ViewController.m file import the RemoteReceiver.h file

#import "RemoteReceiver.h"

Step 3: Inside ViewController.m file add the following code

@interface ViewController () <RemoteReceiverDelegate>
@property (nonatomic, strong) RemoteReceiver *remoteReceiver;
@end

Step 4: Inside viewDidLoad alloc and set the delegate for remoteReceiver

self.remoteReceiver = [[RemoteReceiver alloc] init];
self.remoteReceiver.delegate = self;

Step 5: Implement the following delegate method for messages send from iOS remote app

-(void) didReceiveMessage:(NSDictionary *)userInfo{
    NSLog(@"%@",userInfo);
}

#iOS Project (Sender/Remote Control)

Step 1: Create an iOS Project and import the files from RemoteSender

libRemoteSender.a
RemoteSender.h

Step 2: Import the RemoteSender class in your ViewController

#import "RemoteSender.h"

Step 3: Update ViewController.m with the following code

@interface ViewController ()
@property(nonatomic, strong) RemoteSender *remoteSender;
@end

Step 4: Allocate and initialize the remoteSender object

self.remoteSender = [[RemoteSender alloc] init];

Step 5: Implement gestures and methods (Check below for just button code)

- (IBAction)sendSomeInformation:(id)sender {
    NSDictionary *theDictionaryToSendToTV = @{@"name": @"John Smith",@"age": @"35", @"address":@"123 Main St"};
    [self.remoteSender sendInfo:theDictionaryToSendToTV];
}

tvos_remote's People

Contributors

vivianaranha avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.