-3

I want to add 4 buttons that will appears all the time in the user screen. I tried to add them above the AR view but it didn't work

rmaddy
  • 314,917
  • 42
  • 532
  • 579
ath al
  • 1
  • 1
  • Welcome to stackoverflow. Please show us what you've tried so far (a code snippet). Here's some help with formatting your post https://stackoverflow.com/help/formatting – belwood Jan 24 '19 at 01:11

2 Answers2

1

You can simply add four buttons from object library on an ARSCNView . It's as simple as adding buttons to a UIView just drag and drop and connect IBActions and IBOutlets as per the requirement. For example See this screenshot i have added two buttons above the scene view and attached their IBAction

Then just add IBAction to the ViewController file and it will definitely work.

@IBAction func add(_ sender: Any) {
    // do your stuff
 }
 @IBAction func reset(_ sender: Any) {
    // do your stuff
 }
Diksha235
  • 442
  • 7
  • 17
-3

You have to use overlaySKScene attribute of the scene, which is an SKScene. overlaySKScene is an attribute of the scnView. Check the doc here and this answer

Andrew21111
  • 868
  • 8
  • 17