Check out example codes for "sprite kitYourNextScene". It will help you in understanding the concepts better.

Code Example 1

if isInit {
  do nothing
} else {
  add sprites
  isInit = true
}

Learn ReactJs, React Native from akashmittal.com