Skip to content

Instantly share code, notes, and snippets.

View kenji272's full-sized avatar

kenji funatsu kenji272

View GitHub Profile
import UIKit
class SecondViewController: UIViewController {
let divisionsName: [String] = ["東京都", "神奈川県", "埼玉県", "千葉県"]
var divisionButton: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
@kenji272
kenji272 / AppDelegate.swift
Last active August 29, 2015 14:21
【課題】Part8 2つの画面のスライダーが連動するアプリ
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
// 共通のスライダー値
var sliderValue: Float = 0.0
@kenji272
kenji272 / AdditionViewController.swift
Created May 9, 2015 13:40
【課題】Part7 足し算と引き算を行うタブアプリ
import UIKit
class AdditionViewController: UIViewController {
@IBOutlet weak var target1Text: UITextField!
@IBOutlet weak var target2Text: UITextField!
@IBOutlet weak var resultLabel: UILabel!
override func viewDidLoad() {
@kenji272
kenji272 / ViewController.swift
Last active August 29, 2015 14:19
【課題】Part6 スライダーを指定された位置に移動させるゲームアプリ
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var targetCountLabel: UILabel!
@IBOutlet weak var answerCountSlider: UISlider!
override func viewDidLoad() {
super.viewDidLoad()
@kenji272
kenji272 / ViewController.swift
Created April 24, 2015 13:47
【課題】Part5 割り算アプリ(アラート表示あり)を作る
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var target1Text: UITextField!
@IBOutlet weak var target2Text: UITextField!
@IBOutlet weak var resultLabel: UILabel!
@kenji272
kenji272 / ViewController.swift
Created April 21, 2015 16:27
【課題】Part4 数字をカウントアップするアプリを作る
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var targetTextField: UITextField!
@IBOutlet weak var resultLabel: UILabel!
var resultCount: Int = 0
@kenji272
kenji272 / ViewController.swift
Last active August 29, 2015 14:19
【課題】Part3 符号を反転させてから足し算するアプリを作る
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var target1TextField: UITextField!
@IBOutlet weak var target2TextField: UITextField!
@IBOutlet weak var target1Label: UILabel!
@IBOutlet weak var target2Label: UILabel!
@kenji272
kenji272 / ViewController.swift
Created April 17, 2015 16:07
【課題】Part2 足し算・引き算・掛け算・割り算するアプリを作る
import UIKit
enum CalculationEnum: Int {
case PLUS
case MINUS
case TIMES
case DIVIDE
func calculate(target1: Double, target2: Double) -> Double {
@kenji272
kenji272 / ViewController.swift
Last active June 14, 2023 07:57
【課題】Part1 5つの数字を足し算するアプリを作る
import UIKit
class ViewController: UIViewController {
// textFieldCollection
// 足し算アプリのため、テキストフィールドの順序は保証しなくて良い
@IBOutlet var numberTextFieldCollection: [UITextField]!
// 結果を表示するラベル
@IBOutlet weak var resultLabel: UILabel!