1234567891011121314151617import UIKit @IBOutlet weak var mainImageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() mainImageView.image = UIImage(named: "Image.jpg") mainImageView.userInteractionEnabled = true mainImageView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: "buttonTapped:"))} func buttonTapped(sender: UITapGestureRecognizer) { if (sender.state =..
123456 import UIKit UIApplication.sharedApplication().beginIgnoringInteractionEvents()//터치 비활성화 UIApplication.sharedApplication().endIgnoringInteractionEvents()//터치 활성화 Colored by Color Scriptercs Swift 4.01234import UIKit UIApplication.shared.beginIgnoringInteractionEvents() UIApplication.shared.endIgnoringInteractionEvents()cs
123456789101112131415161718192021222324252627282930313233343536import Foundationimport UIKitimport MessageUI class MyPageViewController: UIViewController , MFMailComposeViewControllerDelegate{ @IBAction func sendMail(sender: AnyObject) { //메일 보내기 버튼 선택시 let mailComposeViewController = configuredMailComposeViewController() if MFMailComposeViewController.canSendMail() { self.presentViewController(..
123456789import UIKit class MyPageViewController: UIViewController { @IBAction func linkToSafari(sender: AnyObject) { UIApplication.sharedApplication().openURL(NSURL(string: "http://www.naver.com/")!) } }Colored by Color Scriptercs
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