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

What is Object

coe
August 20, 2019

What is Object

What is Object

coe

August 20, 2019
Tweet

More Decks by coe

Other Decks in Technology

Transcript

  1. ϘλϯΫϦοΫΛҰݸҰݸॻ͘ʁ import UIKit import AVFoundation class ViewController: UIViewController { var

    doPlayer:AVAudioPlayer! var rePlayer:AVAudioPlayer! var miPlayer:AVAudioPlayer! var faPlayer:AVAudioPlayer! var soPlayer:AVAudioPlayer! var raPlayer:AVAudioPlayer! var siPlayer:AVAudioPlayer! func onDoClick() { } func onReClick() { } func onMiClick() { } …
  2. ϘλϯʹUBHΛׂΓ౰ͯΔʁ import UIKit import AVFoundation class ViewController: UIViewController { var

    doPlayer:AVAudioPlayer! var rePlayer:AVAudioPlayer! var miPlayer:AVAudioPlayer! var faPlayer:AVAudioPlayer! var soPlayer:AVAudioPlayer! var raPlayer:AVAudioPlayer! var siPlayer:AVAudioPlayer! func onClick(_ sender: UIButton) { switch sender.tag { case 1: … } } … ͬͪ͜ͷํ͕ߦ਺গͳ͘ͳΔͶʂ
  3. import UIKit import AVFoundation class Player: NSObject { private var

    player:AVAudioPlayer! @IBInspectable var path:String! override func awakeFromNib() { player = try! AVAudioPlayer(contentsOf: Bundle.main.url(forResource: path, withExtension: nil)!) } @IBAction func start(_ sender: Any) { player.play() } @IBAction func stop(_ sender: Any) { player.stop() player.currentTime = 0 } }
  4. ϑΝΠϧύεΛ*#͔ΒઃఆͰ͖ΔΑ͏ʹ͢Δ import UIKit import AVFoundation class Player: NSObject { private

    var player:AVAudioPlayer! @IBInspectable var path:String! override func awakeFromNib() { player = try! AVAudioPlayer(contentsOf: Bundle.main.url(forResource: path, withExtension: nil)!) } @IBAction func start(_ sender: Any) { player.play() } @IBAction func stop(_ sender: Any) { player.stop() player.currentTime = 0 } }
  5. *# OJC ͔Βઃఆ͞ΕͨύϥϝʔλͰ "7"VEJP1MBZFSॳظԽ import UIKit import AVFoundation class Player:

    NSObject { private var player:AVAudioPlayer! @IBInspectable var path:String! override func awakeFromNib() { player = try! AVAudioPlayer(contentsOf: Bundle.main.url(forResource: path, withExtension: nil)!) } @IBAction func start(_ sender: Any) { player.play() } @IBAction func stop(_ sender: Any) { player.stop() player.currentTime = 0 } }
  6. *#͔Β"DUJPOΛड͚औΕΔΑ͏ʹ͢Δ import UIKit import AVFoundation class Player: NSObject { private

    var player:AVAudioPlayer! @IBInspectable var path:String! override func awakeFromNib() { player = try! AVAudioPlayer(contentsOf: Bundle.main.url(forResource: path, withExtension: nil)!) } @IBAction func start(_ sender: Any) { player.play() } @IBAction func stop(_ sender: Any) { player.stop() player.currentTime = 0 } }
  7. 7JFX$POUSPMMFSͷओͳ໾ׂ w ϥΠϑαΠΫϧ؅ཧ w ˠϥΠϑαΠΫϧʹ߹Θͤͨॲཧ͸ແ͍ w 6*ͷมߋ w ˠͳ͠ w

    ؅ཧԼΦϒδΣΫτಉ࢜ͷίϛϡχέʔγϣϯ w ˠͳ͠ w ը໘ભҠ w ˠͳ͠