Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to study iOS (Long version)

Akio Itaya
August 25, 2018

How to study iOS (Long version)

It is a presentation material at ODC.

Akio Itaya

August 25, 2018
Tweet

More Decks by Akio Itaya

Other Decks in Technology

Transcript

  1. END

  2. 3VO

  3. 51 #BTF7JFX$POUSPMMFS w TFU#,*NBHF @JNBHF7JFX6**NBHF7JFX  Ҿ਺ʹ༩͑ͨJNBHFΛഎܠʹઃఆ͢Δ w UJNF#PPMFBO @TUBSU5JNF6*OU

    HPBM5JNF6*OU #PPM TFU#,*NBHFͰ࢖༻͞Ε͍ͯΔ w PO$MJDL#VUUPO @TFOEFS6*#VUUPO  <0WFSSJEF>Ϙλϯ͕ΫϦοΫ͞Εͨͱ͖ʹݺ͹ΕΔ
  4. 54 4ZTUFN 6*7JFX$POUSPMMFS #BTF7JFX$POUSPMMFS ܧঝ .BJO7JFX$POUSPMMFS ܧঝ $VTUPN#VUUPOTXJGU ֦ு 6*#VUUPO

    ֦ு ࠓճࢲୡ͕৮͍ͬͯΔΫϥεͰ͢ɻ എܠը૾ͷઃఆॲཧɾϘλϯΛԡ͠ ͨͱ͖ͷॲཧؚ͕·Ε͍ͯ·͢ɻ ͳ͓ɺ͜ͷΫϥε͸൘୩͕ຐ๏ͱݴͬ ͯ࢓ࠐΜͩ΋ͷͰ͢ɻ $PDPBUPVDIϑϨʔϜϫʔΫ ʹؚ·ΕΔΫϥεͷҰͭͰ͢ɻ ͳ͓ɺ͜ͷΫϥε͸"QQMF͕४ උ͍ͯ͠Δ΋ͷʹͳΓ·͢ɻ Ϙλϯͷ৭ɾαΠζɾܗɾλΠτϧɾ λΠτϧจࣈ৭ɾԡ͞Εͨͱ͖ʹݺ ͹ΕΔϝιουͷొ࿥͕هड़͞Εͨ DVTUPN4FUUJOHϝιουΛ௥Ճͯ͠ ͍·͢ɻ·ͨɺԡ͞Εͨͱ͖ʹݺ͹ ΕΔϝιουΛ6*7$ʹԾ௥Ճ͢Δ ॲཧ΋هड़͍ͯ͠·͢ɻ $PDPBUPVDIϑϨʔ ϜϫʔΫʹؚ·ΕΔ ΫϥεͷҰͭͰ͢ɻ ͳ͓ɺ͜ͷΫϥε͸ "QQMF͕४උ͍ͯ͠ Δ΋ͷʹͳΓ·͢ɻ
  5. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } શମ
  6. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } શମ
  7. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } શମ
  8. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } શମ
  9. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } ىಈ
  10. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } ىಈ
  11. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } นࢴ
  12. Class ViewController: BaseViewController { override func viewDidLoad() } Class BaseViewController:

    UIViewController { override func onClickButton(_ sender: UIButton) func setBKImage(_ imageView: UIViewController) func isTime(_ startTime: Int, goalTime: Int) -> Bool } extension UIButton { func customSetting(_ vc: UIViewController, title: String) var randomColor: UIColor func onClickButton(_ sender: UIButton) } นࢴ
  13. Import UIKit Class ViewController: BaseViewController { @IBOutlet weak var button:

    UIButton! override func viewDidLoad() { button.customSetting(self, title: ”Camera”) } }
  14. Import UIKit Class ViewController: BaseViewController { @IBOutlet weak var button:

    UIButton! override func viewDidLoad() { button.customSetting(self, title: ”Camera”) } }
  15. Import UIKit extension UIButton { func customSetting(_ vc: UIViewController, title:

    String) { frame = CGRect(x: 0, y: 0, width: 80, height: 80) backgroundColor = randomColor layer.maskToBounds = true layer.cornerRadius = 40 titleLabel?.font = .systemFont(ofSize: .buttonFontSize) setTitle(title, for: .normal) setTitleColor(.white, for: .normal) addTarget(vc, action: #selector(vc.onClickButton(_:)), for: .touchUpInside) } }
  16. Import UIKit extension UIButton { func customSetting(_ vc: UIViewController, title:

    String) { frame = CGRect(x: 0, y: 0, width: 80, height: 80) backgroundColor = randomColor layer.maskToBounds = true layer.cornerRadius = 40 titleLabel?.font = .systemFont(ofSize: .buttonFontSize) setTitle(title, for: .normal) setTitleColor(.white, for: .normal) addTarget(vc, action: #selector(vc.onClickButton(_:)), for: .touchUpInside) } }
  17. Import UIKit Class BaseViewController: UIViewController { override func onClickButton(_ sender:

    UIButton) { let vc = CameraViewController() vc.view.backgroundColor = .white vc.setCharaImage(”04”) self.present(vc, animated: true, completion nil) } }
  18. Import UIKit extension UIButton { func customSetting(_ vc: UIViewController, title:

    String) { frame = CGRect(x: 0, y: 0, width: 80, height: 80) backgroundColor = randomColor layer.maskToBounds = true layer.cornerRadius = 40 titleLabel?.font = .systemFont(ofSize: .buttonFontSize) setTitle(title, for: .normal) setTitleColor(.white, for: .normal) addTarget(vc, action: #selector(vc.onClickButton(_:)), for: .touchUpInside) } }
  19. Import UIKit extension UIButton { var randomColor: UIColor { switch

    arc4random_uniform(5) case 0: return .magenta case 1: return .purple case 2: return .red case 3: return .orange case 4: return .yellow default: return .clear } }
  20. Import UIKit Class ViewController: BaseViewController { func setBKImage(_ imageView: UIViewController)

    { if var topImage = UIImage(named: ”p1”), isTime(0, goalTime: 4) { let vc = CameraViewController() vc.view.backgroundColor = .white vc.setCharaImage(”04”) self.present(vc, animated: true, completion nil) } } }
  21. Import UIKit Class ViewController: BaseViewController { func setBKImage(_ imageView: UIViewController)

    { if var topImage = UIImage(named: ”p1”), isTime(0, goalTime: 4) { let vc = CameraViewController() vc.view.backgroundColor = .white vc.setCharaImage(”04”) self.present(vc, animated: true, completion nil) } } }
  22. Import UIKit Class ViewController: BaseViewController { func isTime(_ start: Int,

    goal: Int) -> Bool { let now = Date(), formatter = IDateFormatter() formatter.locale = Locale(identifier: ”ja_JP”) formatter.dateFormat = ”HH” let nowTime = formatter.string(from: now) for i in start…goal { let time = NSString(format: ”%02d”, i)) as String if nowTime == time { return true } } } }