<file_sep>import Foundation

struct Repository {
    public let name: String
    public let stargazerCount: Int
    public let forkCount: Int
    public let url: URL
    public let updatedAt: Date
}
<file_sep>import Foundation

struct User {
    let id: String
    let password: String
}
<file_sep>import Foundation
import UIKit

let total: Int = 7
var answer: Int = 0


//////////////問題///////////////////
// 型指定あり
let question1: CGFloat = 10
let question2: String = "test"
let question3: [UIViewController] = []

// 型指定なし
let question4 = 0.0
let question5 = true

// Optional
let question6: Int? = nil
let question7: Bool? = true
/////////////////////////////////////


AnswerCheck: do {
    /*
     TODO: Any.selfをquestionNの型に書き換えてください
     e.g question1がIntの場合
     Any.self → Int.self
     */
    
    // Question1
    if type(of: question1) == Any.self {
        answer += 1
        print("Question 1 is the correct answer")
    }
    
    // Question2
    if type(of: question2) == Any.self {
        answer += 1
        print("Question 2 is the correct answer")
    }
    
    // Question3
    if type(of: question3) == Any.self {
        answer += 1
        print("Question 3 is the correct answer")
    }
    
    // Question4
    if type(of: question4) == Any.self {
        answer += 1
        print("Question 4 is the correct answer")
    }
    
    // Question5
    if type(of: question5) == Any.self {
        answer += 1
        print("Question 5 is the correct answer")
    }
    
    // Question6
    if type(of: question6) == Any.self {
        answer += 1
        print("Question 6 is the correct answer")
    }
    // Question7
    if type(of: question7) == Any.self {
        answer += 1
        print("Question 7 is the correct answer")
    }
}

print("\(total)問中\(answer)問正解")
if total == answer {
    print("全問正解👏")
}
<file_sep>import UIKit

class Lesson5ViewController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        sampleMethod()
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        sampleMethod()
    }
    
    func set() {
        sampleMethod()
    }

    // 右クリック→`Find call hierarchy`
    func sampleMethod() {
    }
}
<file_sep>import UIKit

class SearchView: UIView {}
<file_sep>import UIKit

class Lesson4ViewController: UIViewController {
    var str = ""

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    func sampleLesson4Method() {
    }
    
    
    
    
    /*
     大量のコードがある想定
    */
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    func checkDefinition() {
        str = "checkDefinition"
        
        // call sampleMethod
        // cmd + ctrl + click
        sampleLesson4Method()
    }
}
<file_sep>2018 Haloween Swimee hands-on project.

## Requirements
- Xcode10
- Swift4.2

## Question & Answer
If you are interested in answering lesson1 and lesson3, please check answer branch
- [Quesiton](https://github.com/funzin/2018_haloween_handson/tree/master)
- [Answer](https://github.com/funzin/2018_haloween_handson/tree/answer)
<file_sep>import UIKit
import PlaygroundSupport

let baseView = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
let button = UIButton(frame: CGRect(x: 0, y: 0, width: 100, height: 100))


ButtonConigure: do {
    // コメントを外して挙動を確認して下さい
    //button.backgroundColor = .blue
    //button.layer.borderColor = UIColor.red.cgColor
    //button.layer.borderWidth = 10
    //button.layer.cornerRadius = 5
    //button.setTitle("button", for: .normal)
}

BaseViewConfigure: do {
    baseView.backgroundColor = .white
    button.center = baseView.center
    baseView.addSubview(button)
}

PlaygroundPage.current.liveView = baseView
