123456789101112131415161718192021222324252627 func createButton () { let button = UIButton(); button.setTitle("Back", forState: .Normal) button.setTitleColor(UIColor.blueColor(), forState: .Normal) button.frame = CGRectMake(25, 25, 35, 30) // X, Y, width, height button.addTarget(self, action: "buttonPressed:", forControlEvents: .TouchUpInside) button.backgroundColor = UIColor(red: (31/255.0), gr..
123456789101112131415override func viewDidLoad() { super.viewDidLoad() NSNotificationCenter.defaultCenter().addObserver(self, selector: "keyboardWillShow:", name: UIKeyboardWillShowNotification, object: nil) } func keyboardWillShow(notification:NSNotification) { let userInfo:NSDictionary = notification.userInfo! let keyboardFrame:NSValue = userInfo.valueForKey(UIKeyboardFrameEndUserInfoKey) as! ..
1234567891011121314151617181920212223242526272829303132333435363738394041import UIKit class ViewController: UIViewController { var timer:NSTimer? var count = 0 override func viewDidLoad() { super.viewDidLoad() self.startTimer() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any res..
- Total
- Today
- Yesterday