ios - Show array elements in textView (Swift) -


how can add elements array textview 1 second delay?

language- swift (still relatively new programming)

i think need

class viewcontroller: uiviewcontroller {      @iboutlet weak var textview: uitextview!      var array = ["string1", "string2", "string3"]     var = 0     var str: string = ""     var timer = nstimer()      func testfunc() {         str += "\(array[i])\n"         textview.text = str         if == count(array) - 1 {             timer.invalidate()         }         += 1     }      override func viewdidload() {         super.viewdidload()          timer = nstimer.scheduledtimerwithtimeinterval(1.0, target: self, selector: selector("testfunc"), userinfo: nil, repeats: true)     }      override func didreceivememorywarning() {         super.didreceivememorywarning()         // dispose of resources can recreated.     } } 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -