This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AudioPlayer.swift | |
// | |
// Created by MDobekidis | |
// | |
import Foundation | |
import AVFoundation | |
import UIKit | |
import Signals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// listening for current item change | |
self.audioQueueObserver = self.playerQueue?.observe(\.currentItem, options: [.new]) { | |
[weak self] (player, _) in | |
print("media item changed...") | |
} | |
// listening for current item status change | |
self.audioQueueStatusObserver = self.playerQueue?.currentItem?.observe(\.status, options: [.new, .old], changeHandler: { | |
(playerItem, change) in | |
if playerItem.status == .readyToPlay { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Delete folling existing files | |
- AppDelegate.m | |
- AppDelegate.h | |
- main.m | |
2. Create a new AppDelegate.swift and when it asks if you would like to create an Objective-C bridge header just say "Yes" | |
3. Copy the following content to your Bridging-Header.h file | |
``` | |
#import <React/RCTRootView.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeScreen extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>HomeScreen</Text> | |
<Text onPress={() => this.props.navigation.push('Settings')}>Go to Settings</Text> | |
</View> | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeScreen extends React.Component { | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>HomeScreen</Text> | |
<Text onPress={() => this.props.navigation.goDetail()}>Go to Detail</Text> | |
</View> | |
); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const HomeStack = createStackNavigator({ Home: HomeScreen }, { | |
// ์ด๊ฑด ์คํ ์์ ์๋ ์คํฌ๋ฆฐ๋ค์ ๊ธฐ๋ณธ ์ค์ ์ ๋๋ค. | |
// ๊ทธ๋์ 'Home'์์ ํ์ดํ์ ๋ฎ์ด ์ฐ์ง ์๋ ์ด์ 'Home'์ด ํ์ดํ๋ก ์ฌ์ฉ๋ฉ๋๋ค. | |
navigationOptions: { | |
title: 'Home', | |
} | |
}); | |
// HomeStack์ ๊ทธ๋ฆฌ๋ ๋ค๋น๊ฒ์ดํฐ์ ์ํด์ ์ฌ์ฉ๋๋ ์ต์ ์ ๋๋ค. | |
// ์ฌ๊ธฐ์์๋ ํญ ๋ค๋น๊ฒ์ดํฐ๋ฅด ์๋ฏธํฉ๋๋ค. | |
HomeStack.navigationOptions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HomeScreen extends React.Component { | |
static navigationOptions = { tabBarLabel: 'Home!' }; | |
... | |
} | |
class DetailScreen extends React.Component { | |
static navigationOptions = { tabBarLabel: 'Detail!' }; | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { createStackNavigator, createBottomTabNavigator } from 'react-navigation'; | |
const HomeScreen = () => ( | |
<View style={styles.container}> | |
<Text>HomeScreen</Text> | |
</View> | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { StackNavigator, TabNavigator } from 'react-navigation'; | |
class HomeScreen extends React.Component { | |
static navigationOptions = { tabBarLabel: 'Home!' }; | |
render() { | |
return ( | |
<View style={styles.container}> | |
<Text>HomeScreen</Text> |
NewerOlder