๐
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
| public extension NSLayoutConstraint { | |
| /// Disable auto resizing mask and activate constraints | |
| /// | |
| /// - Parameter constraints: constraints to activate | |
| static func on(_ constraints: [NSLayoutConstraint]) { | |
| constraints.forEach { | |
| ($0.firstItem as? UIView)?.translatesAutoresizingMaskIntoConstraints = false | |
| $0.isActive = true | |
| } |
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 ViewController: UIViewController { | |
| let box = UIView() | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| box.backgroundColor = UIColor.red | |
| view.addSubview(box) | |
| } | |
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 Foundation | |
| public enum Event<T> { | |
| case Next(value: T) | |
| case Failed(error: ErrorType) | |
| // MARK: Initialization | |
| public init(value: T) { | |
| self = .Next(value: value) | |
| } |
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 Foundation | |
| public final class Signal<T> { | |
| var event: Event<T>? | |
| var callbacks: [Event<T> -> Void] = [] | |
| let lockQueue = dispatch_queue_create("lock_queue", DISPATCH_QUEUE_SERIAL) | |
| // MARK: Initialization | |
| public init(event: Event<T>) { |
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, {Component} from 'react' | |
| import { StyleSheet, View, Text, SafeAreaView } from 'react-native' | |
| import { facebookService } from '../../library/FacebookService' | |
| import { Avatar } from 'react-native-elements' | |
| export default class ProfilePage extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.logout = this.logout.bind(this) |
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, View, Text } from 'react-native' | |
| import {facebookService} from '../../library/FacebookService' | |
| export default class LogInPage extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.login = this.login.bind(this) | |
| } |
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, View, Text } from 'react-native' | |
| import {facebookService} from '../../library/FacebookService' | |
| export default class LogInPage extends React.Component { | |
| constructor(props) { | |
| super(props) | |
| this.login = this.login.bind(this) | |
| } |
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 { createStackNavigator } from 'react-navigation' | |
| import LoginPage from './LoginPage' | |
| export const LoginNavigator = createStackNavigator({ | |
| Login: { | |
| screen: LoginPage, | |
| navigationOptions: { | |
| title: "Login" | |
| } | |
| } |
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 { createBottomTabNavigator } from 'react-navigation' | |
| import ProfilePage from '../profile/ProfilePage' | |
| import ShopPage from '../shop/ShopPage' | |
| export const MainNavigator = createBottomTabNavigator({ | |
| Profile: { | |
| screen: ProfilePage, | |
| navigationOptions: { | |
| tabBarLabel: 'Profile' | |
| } |
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, {Component} from 'react'; | |
| import {Platform, StyleSheet, Text, View} from 'react-native'; | |
| import {LoginNavigator} from './src/components/login/LoginNavigator' | |
| import {MainNavigator} from './src/components/main/MainNavigator' | |
| import FBSDK from 'react-native-fbsdk' | |
| import {createSwitchNavigator} from 'react-navigation' | |
| const { AccessToken } = FBSDK | |
| export default class App extends Component { |