ios - app does not function properly in iphone 5 and 4s simulator -
this weirdest thing, when run app in simulator on xcode functions except when try run in iphone 4s simulator , iphone 5 simulator acts funny. in function below have animations taking place. , mean acting funny these animations run smoothly , can see dots created move across screen gradually in iphone 4s , 5 simulators dont see animations @ or see brief flashes of them have no idea why. please help!!
func go () {
// remove add banner view self.gameadbanner?.hidden = true // enable user interaction of content view self.contentview.userinteractionenabled = true // make level label appear uiview.animatewithduration(0, delay: 1, options: nil, animations: { self.levellabel.alpha = 1 self.levelnumber.alpha = 1 }, completion: {finished in self.displayad()}) // declare delay counter varriables var delaycounter:int = 100000 var durationcounter:double = 0 // initiate starting level levelnumber.text = string(level) // set random number varriable make amount of dots in each color 1 color var diversifyreddots = arc4random_uniform(5) var diversifybluedots = arc4random_uniform(5) var diversifyyellowdots = arc4random_uniform(5) var diversifygreendots = arc4random_uniform(5) // create if statement first 2 levels dots spawn if level < 3 { diversifyreddots = 4 } // loop------------------ loop in 0...loopnumber { // set constants animations let reddelay = nstimeinterval(arc4random_uniform(100000) + delaycounter) / 30000 let bluedelay = nstimeinterval(arc4random_uniform(100000) + delaycounter) / 30000 let yellowdelay = nstimeinterval(arc4random_uniform(100000) + delaycounter) / 30000 let greendelay = nstimeinterval(arc4random_uniform(100000) + delaycounter) / 30000 let options = uiviewanimationoptions.allowuserinteraction | uiviewanimationoptions.layoutsubviews //set constants dots let redsize:cgfloat = 54 let redyposition : cgfloat = cgfloat( arc4random_uniform(150)) + 54 let bluesize:cgfloat = 54 let blueyposition : cgfloat = cgfloat( arc4random_uniform(150)) + 54 let yellowsize:cgfloat = 54 let yellowyposition : cgfloat = cgfloat( arc4random_uniform(150)) + 54 let greensize:cgfloat = 54 let greenyposition : cgfloat = cgfloat( arc4random_uniform(150)) + 54 // create dots , add them view let reddot = uibutton() reddot.setbackgroundimage(reddot, forstate: uicontrolstate.normal) reddot.frame = cgrectmake(-100, redyposition, redsize, redsize) self.contentview.addsubview(reddot) let bluedot = uibutton() bluedot.setbackgroundimage(bluedot, forstate: uicontrolstate.normal) bluedot.frame = cgrectmake(-100, blueyposition, bluesize, bluesize) self.contentview.addsubview(bluedot) let yellowdot = uibutton() yellowdot.setbackgroundimage(yellowdot, forstate: uicontrolstate.normal) yellowdot.frame = cgrectmake(-100, yellowyposition, yellowsize, yellowsize) self.contentview.addsubview(yellowdot) let greendot = uibutton() greendot.setbackgroundimage(greendot, forstate: uicontrolstate.normal) greendot.frame = cgrectmake(-100, greenyposition, greensize, greensize) self.contentview.addsubview(greendot) // define animations // red if diversifyreddots > 5 { // increase actual red self.increasered() // increase count dot number uiview.animatewithduration(dotduration , delay: reddelay - 6, options: options, animations: { reddot.frame = cgrectmake(700, redyposition, redsize, redsize) }, completion: {finished in reddot.removefromsuperview()}) } // blue if diversifybluedots > 5 { // increase actual blue self.increaseblue() // increase count dot number uiview.animatewithduration(dotduration , delay: bluedelay - 6, options: options, animations: { bluedot.frame = cgrectmake(700, blueyposition, bluesize, bluesize) }, completion: {finished in bluedot.removefromsuperview()}) } // yellow if diversifyyellowdots > 5 { // increase actual yellow self.increaseyellow() // increase count dot number uiview.animatewithduration(dotduration , delay: yellowdelay - 6, options: options, animations: { yellowdot.frame = cgrectmake(700, yellowyposition, yellowsize, yellowsize) }, completion: {finished in yellowdot.removefromsuperview()}) } // green if diversifygreendots > 5 { // increae acutual green self.increasegreen() // increase count dot number uiview.animatewithduration(dotduration , delay: greendelay - 6, options: options, animations: { greendot.frame = cgrectmake(700, greenyposition, greensize, greensize) }, completion: {finished in greendot.removefromsuperview()}) } // incremint counters delaycounter+=50000 diversifyreddots++ diversifybluedots++ diversifyyellowdots++ diversifygreendots++ }
Comments
Post a Comment