I have a problem with one of my function: my application run perfectly on iPhone 5s, 6, etc, but on a iPhone 5 I have a problem with my code. When my function is called, I always have this problem:
switch choixDeCote {
case 1 : //Haut
let MinValue = self.size.width / 8
let MaxValue = self.size.width - 200
SpawnX = UInt32(MaxValue - MinValue)
SpawnX = arc4random_uniform(SpawnX)
SpawnY = UInt32(self.size.height)
directionX = Int(arc4random()) % Int(self.frame.size.width)
print(directionX)
directionY = 0
action = SKAction.moveTo(CGPoint(x: CGFloat(directionX),y: CGFloat(directionY)),duration: 4)
break
And Xcode says that directionX = Int(arc4random()) % Int(self.frame.size.width)
has a problem, but I don't know which one.