2_Cat Years

2

//
//  ViewController.swift
//  Cat Years
//
//  Created by ZC on 16/1/6.
//  Copyright © 2016年 ZC. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var catYearsTextField: UITextField!

    @IBOutlet weak var resultYears: UILabel!

    @IBAction func findResult(sender: AnyObject) {

        if(catYearsTextField != nil){

            var catAge = Int(catYearsTextField.text!)!

            catAge = catAge * 7

            resultYears.text = "Your cat‘s age is \(catAge) in cat years!"

        }else{
            resultYears.text = "Please input your cat‘s age!"
        }

    }

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

}

项目:2_Cat Years

时间: 2024-10-14 10:59:55

2_Cat Years的相关文章

Thumbnails为图片加水印

在JAVA中使用Thumbnails为图片加水印 将D盘下面的cat.jpg作为水印加在2.jpg上面,输出新的图片2_cat.jpg到D盘下面 1.java类 import java.io.File; import java.io.IOException; import javax.imageio.ImageIO; import net.coobird.thumbnailator.Thumbnails; import net.coobird.thumbnailator.geometry.Pos