hackdie / react-native-show-case

Showcase using reference id in native side. Kotlin + Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-show-case

Screenshot

Getting started

$ npm install react-native-show-case --save

Mostly automatic installation

$ react-native link react-native-show-case

Manual installation

iOS

  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modulesreact-native-show-case and add RNShowCase.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNShowCase.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)<

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  • Add import com.reactlibrary.RNShowCasePackage; to the imports at the top of the file
  • Add new RNShowCasePackage() to the list returned by the getPackages() method
  1. Append the following lines to android/settings.gradle:
    include ':react-native-show-case'
    project(':react-native-show-case').projectDir = new File(rootProject.projectDir, 	'../node_modules/react-native-show-case/android')
    
  2. Insert the following lines inside the dependencies block in android/app/build.gradle:
      compile project(':react-native-show-case')
    

Usage

import {
  View,
  Text,
  findNodeHandle,
} from 'react-native';
import RNShowCase from 'react-native-show-case';

...

componentDidMount = () => {
   setTimeout(() => {
      const handleId = findNodeHandle(this.superRef);
      RNShowCase.show(handleId, 'Title', 'Description yea!!!');
    }, 100);
}

...

render = () => {
return (
	<View style={...}>
	<Text ref={r => {this.superRef = r}}> Show showcase here </Text>
	</View>)
} 

TODO

  1. Listeners onCasePresented, onCaseDismissed

Credits

This project is just a wraper for https://github.com/rahuliyer95/iShowcase and https://github.com/mreram/ShowCaseView

License RNShowCase is available under the MIT license. See the LICENSE file for more info.

About

Showcase using reference id in native side. Kotlin + Swift

License:MIT License


Languages

Language:Swift 82.5%Language:Kotlin 6.8%Language:Java 4.5%Language:Objective-C 3.3%Language:Ruby 2.4%Language:JavaScript 0.4%