Skip to content

Instantly share code, notes, and snippets.

@akimach
Created June 8, 2016 09:34
Show Gist options
  • Select an option

  • Save akimach/58093b437985caaf3c1e72e8cdc8fa93 to your computer and use it in GitHub Desktop.

Select an option

Save akimach/58093b437985caaf3c1e72e8cdc8fa93 to your computer and use it in GitHub Desktop.
セルの挿入
override func viewDidLoad() {
super.viewDidLoad()
self.timer = NSTimer.scheduledTimerWithTimeInterval(1.0, target: self, selector: #selector(NotificationBoardViewController.timerUpdate(_:)), userInfo: nil, repeats: true)
}
func timerUpdate(timer: NSTimer) {
data.append(String(counter))
let indexPath = NSIndexPath(forRow: counter, inSection: 0)
newsTable.insertRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Automatic)
counter += 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment