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
| //: A UIKit based Playground for presenting user interface | |
| // ---------------------------------- Imports -------------------------------- // | |
| import UIKit | |
| import PlaygroundSupport | |
| // ---------------------------------- Model -------------------------------- // | |
| struct ModelUI { |
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
| // | |
| // SampleView.swift | |
| // CounterApp | |
| // | |
| // Created by Alejo Castaño on 23/11/2019. | |
| // Copyright © 2019 Facebook. All rights reserved. | |
| // | |
| import Foundation | |
| import UIKit |
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
| // SampleView.swift | |
| import Foundation | |
| import UIKit | |
| class SampleView: UIView { | |
| var texto: String = ""; | |
| var label = UILabel(frame: CGRect(x: 0, y: 0, width: 200, height: 100)) | |
| @objc(setMessage:) |
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
| package com.device.rn | |
| import com.facebook.react.bridge.Callback; | |
| import com.facebook.react.bridge.ReactApplicationContext; | |
| import com.facebook.react.bridge.ReactContextBaseJavaModule; | |
| import com.facebook.react.bridge.ReactMethod; | |
| import com.crashlytics.android.Crashlytics; | |
| import io.fabric.sdk.android.Fabric; |
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
| package com.device.rn | |
| import com.facebook.react.ReactPackage; | |
| import com.facebook.react.bridge.JavaScriptModule; | |
| import com.facebook.react.bridge.NativeModule; | |
| import com.facebook.react.bridge.ReactApplicationContext; | |
| import com.facebook.react.uimanager.ViewManager; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; |
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
| ... | |
| handleCallback = () => { | |
| this.setState({ loading: true }); | |
| CalendarManager.ReqresEvent({ url: 'https://reqres.in/api/users?page=1' }, (response, error) => { | |
| if (response) { | |
| console.log(response.data); | |
| } else { | |
| console.log(error); | |
| } |
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
| // | |
| // HandleRestApi.m | |
| // RNI | |
| // | |
| // Created by Alejo on 23/11/2018. | |
| // Copyright © 2018 Facebook. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #import "HandleRestApi.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
| ... | |
| import { NativeEventEmitter } from 'react-native'; | |
| const { CalendarManager } = NativeModules; | |
| const calendarManagerEmitter = new NativeEventEmitter(CalendarManager); | |
| class Home extends Component { | |
| handleAddEvent = () => CalendarManager.addEvent('Birthday Party', { site: 'Barcelona Spain' }); | |
| handleEventListener = ({ enabled }) => { |
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
| // | |
| // CalendarManager.h | |
| // RNI | |
| // | |
| // Created by Alejo on 23/11/2018. | |
| // Copyright © 2018 Facebook. All rights reserved. | |
| // | |
| #import <React/RCTBridgeModule.h> | |
| #import <React/RCTEventEmitter.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
| // | |
| // CalendarManager.m | |
| // RNI | |
| // | |
| // Created by Alejo on 23/11/2018. | |
| // Copyright © 2018 Facebook. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| #import "CalendarManager.h" |