Slide 1

Slide 1 text

React Native on tvOS by Neil Kimmett

Slide 2

Slide 2 text

!"#$%&'()*

Slide 3

Slide 3 text

Plan • hi • Build grid view in RN • Wrap grid in tvOS tab bar • Add a native search tab • bye ✌

Slide 4

Slide 4 text

hi @neilkimmett kimmett.me mobile dev since 2011

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

boilerroom.tv

Slide 8

Slide 8 text

RN on tvOS Basics • mostly the same as iOS • input with remote, not touch • a little rough around the edges

Slide 9

Slide 9 text

Lets write some code! grid view, which shows you current selected item

Slide 10

Slide 10 text

FlatList App Card Title of talk Speaker Name

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

FlatList App Card Title of talk Speaker Name

Slide 14

Slide 14 text

Navigation in tvOS • UIViewController • UINavigationController • UITabBarController

Slide 15

Slide 15 text

UITabBarController on iOS

Slide 16

Slide 16 text

UITabBarController on iOS

Slide 17

Slide 17 text

UITabBarController • owns a list of UIViewControllers, one for each tab • each UIViewController owns a UITabBarItem it uses to describe it's tab in the tab bar

Slide 18

Slide 18 text

Navigation libraries - react-navigation JS reimplementation of navigation - airbnb/native-navigation Swift native navigation (beta) - wix/react-native-navigation “a complete native navigation solution”

Slide 19

Slide 19 text

TabBarIOS

Slide 20

Slide 20 text

TabBarIOS // ur dope content

Slide 21

Slide 21 text

FlatList App Card

Slide 22

Slide 22 text

App TabBarIOS TabBarIOS.Item

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

App TabBarIOS TabBarIOS.Item

Slide 25

Slide 25 text

App TabBarIOS Search

Slide 26

Slide 26 text

Objective-C !

Slide 27

Slide 27 text

JS vs ObjC var mittens = new Cat(); Cat *mittens = [[Cat alloc] init];

Slide 28

Slide 28 text

JS vs ObjC var mittens = new Cat(“Mittens”); Cat *mittens = [[Cat alloc] initWithName:@“Mittens”];

Slide 29

Slide 29 text

JS vs ObjC @interface Cat : Animal @property NSString *name; - (instancetype)initWithName:(NSString *)name; @end

Slide 30

Slide 30 text

JS vs ObjC @interface Cat : Animal @property NSString *name; - (Cat *)initWithName:(NSString *)name; @end

Slide 31

Slide 31 text

JS vs ObjC @implementation Cat - (void)throwBall:(Ball *)ball toFriend:(Person *)friend { // … } @end

Slide 32

Slide 32 text

JS vs ObjC mittens.throw(ball, friend); [mittens throwBall:ball toFriend:friend];

Slide 33

Slide 33 text

Native components • inherit from UIView • paired with a Manager class to expose to React https://facebook.github.io/react-native/docs/native-components-ios.html

Slide 34

Slide 34 text

Native components import { requireNativeComponent } from ‘react-native’; var Map = requireNativeComponent('Map', null); https://facebook.github.io/react-native/docs/native-components-ios.html

Slide 35

Slide 35 text

App TabBarIOS Search

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

App TabBarIOS NKSearchComponent

Slide 38

Slide 38 text

TabBarIOS NKSearchComponent SearchResults

Slide 39

Slide 39 text

UISearchController

Slide 40

Slide 40 text

UISearchController

Slide 41

Slide 41 text

UISearchController - searchResultsController a UIViewController - searchResultsUpdater some

Slide 42

Slide 42 text

UISearchContainerController UISearchController TabBarIOS NKSearchComponent NKSearchResultsVC SearchResults

Slide 43

Slide 43 text

TabBarIOS NKSearchComponent UISearchContainerController UISearchController NKSearchResultsVC SearchResults

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Recap • hi • Build grid view in RN • Wrap grid in tvOS tab bar • Add a native search tab • bye ✌

Slide 46

Slide 46 text

bye ✌ @neilkimmett [email protected]