You need UIKit Dynamics
. Detailed tutorial available here UIKIt Dynamics
Please refer also to this answer Implement UIKitDynamics for dragging view off screen
Pregunta
I just need this view to be a sticker page where the user can move and place stickers.
I have a view connected to the StickerViewController
, and I simply copy and pasted this code into the class for it. Everything builds ok, but crashes before it even makes it to the StickerViewController
.
I use a simple button for testing, so I know that the view controller is not loading properly and I placed breakpoints. I did not start this project using the SpriteKit template. I have only been programming iOS mobile apps for 3 weeks, so I still new to this.
In the header, I import UIKit
and SpriteKit
.Then:
@interface StickersViewController : SKScene @end
In the m file, instead of having initWithNibName
I have initWithSize
.
Solución
You need UIKit Dynamics
. Detailed tutorial available here UIKIt Dynamics
Please refer also to this answer Implement UIKitDynamics for dragging view off screen
Otros consejos
This project is a UIKit
app eventually with 5 different SpriteKit
scenes inside. https://github.com/eppz/blog.SpriteKit_drag May take a look on it.
Basically I made an SKView
subclass - https://github.com/eppz/blog.SpriteKit_drag/blob/master/SpriteKit_drag/EPPZSpriteKitView.h - then set it as the root UIViewController.view
class in IB.