Update ViewController.swift
Code updated from iphone