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

GeekSalon -iOSアプリ開発体験会

GeekSalon -iOSアプリ開発体験会

GeekSalon 3.1

Daisuke Masuhara

March 01, 2017
Tweet

More Decks by Daisuke Masuhara

Other Decks in Education

Transcript

  1. %BJTVLF.BTVIBSB &EVDBUPS 3BQQFS J04%FWFMPQFS\4XJGU 0CKFDUJWF$^ $PNFEJBO #BTFCBMM1MBZFS 3BQQFS डݧαϓϦJ04ΞϓϦ։ൃߨ࠲ߨࢣਅ໷தͷϓϦϯε ςϨϏே೔

     εΫʔϧֵ໋ʂ ೔ຊςϨϏ 3BQ/FXT+BQBO "CFNB57  ζʔϜΠϯαλσʔ ೔ຊςϨϏ ϚαΧϝ57 /),૯߹  ཧܥঁࢠԠԉϚΨδϯʮ3JLFKPʯ ߨஊࣾ "&3" ே೔৽ฉग़൛ ౳ !NBTVIBSB !NBTTVND &ODPVSBHF(FFL4BMPO
  2. ΨνϟΞϓϦ ΋͘͡ ᶃ ΞϓϦ։ൃͷੈքΛ஌Ζ͏ ᶄ 9DPEFͷجૅ ᶅ 4XJGUͷجૅ ᶆ ཚ਺Λ࢖ͬͯΈΑ͏

    ᶇ ৚݅෼ذ JGจ Λ࢖ͬͯΈΑ͏ ᶈ ΨνϟΞϓϦΛ࡞Ζ͏ ᶉ σόοάͯ͠ΈΑ͏ ᶊ ࣮ػʹೖΕͯΈΑ͏ ᶋ ڞ༗ձ ᶌ ·ͱΊͱ͓໾ཱͪ৘ใ  
  3. 1SPEVDU/BNF ൒֯ӳ਺εϖʔεه߸ແ 5FBN ͋ͱͰ͍͍ 0SHBOJ[BUJPO/BNF ձࣾ૊৫໊ 0SHBOJ[BUJPO*E υϝΠϯٯॻ͖ -BOHVBHF 4XJGU

    %FWJDFT J1IPOF ͦͷଞ νΣοΫ͠ͳ͍ &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ϓϩδΣΫτͷ࡞੒ ˞อଘ৔ॴ͸σεΫτοϓͳͲ͸͡Ί͸Θ͔Γ΍͍͢ͱ͜Ζʹ͠·͠ΐ͏ɻ  
  4. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ม਺Λએݴ͢Δ ϓϩάϥϜͰ஋Λѻ͏ͨΊʹม਺ͱݺ͹ΕΔ΋ͷΛ࢖͍·͢ɻίϯϐϡʔλ͸جຊతʹ͸ϓϩάϥϜ௨Γʹ͔͠ಈ͘͜ͱ͕Ͱ͖·ͤΜɻ ·ͣ͸ίϯϐϡʔλʹɺʮ͜Μͳม਺Λ࢖͏Αʂʯͱzએݴzͯ͋͛͠·͢ɻ ྫɿ೥ྸ ੔਺ Λѻ͏ͨΊͷม਺Λએݴ͍ͨ͠ͱ͖ WBSBHF*OU WBSMFU

    ม਺ͷ໊લ σʔλܕ ॳظ஋  ɿ ॳظ஋Λઃఆ͢Δ͜ͱɺ࠷ॳͷঢ়ଶʹ໭͢͜ͱΛॳظԽͱ͍͍·͢ɻ ͋ͱ͔Β஋͕มΘΔ৔߹͸WBSɺมΘΒͳ͍৔߹͸MFUͰએݴ͠·͠ΐ͏ɻ ·ͨɺσʔλܕͷ෦෼͸ɺӈลͷ஋ͷܕ͕໌Β͔ͳ৔߹͸4XJGU͕࣋ͭʮܕਪ࿦ʯʹΑͬͯɺলུ͢Δ͜ͱ΋Ͱ͖·͢ɻ  
  5. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ม਺໊ΛܾΊΔ ม਺ ΁Μ͢͏ ͷ໊લ͸ɺࣗ༝ʹܾΊΔ͜ͱ͕Ͱ͖·͢ɻͨͩ͠ɺॻ͖ํʹ͸͋Δఔ౓zϚφʔz͕ଘࡏ͠·͢ɻ 4XJGUͰ͸ɺʮΩϟϝϧέʔεʯͱݺ͹ΕΔه๏Ͱม਺໊Λهड़͢Δͷ͕௨ྫͱͳ͍ͬͯ·͢ɻ ಛʹɺม਺໊΍ؔ਺໊͸ϩʔϫʔΩϟϝϧέʔεɺΫϥε໊͸ΞούʔΩϟϝϧέʔεͰॻ͘ͷ͕ҰൠతͰ͢ɻ  

    ه๏ ྫ ಛ௃ ΞούʔΩϟϝϧέʔε 6TFS5FBN/BNF ޠ۟ͷ۠੾ΓΛେจࣈ ઌ಄ͷจࣈ͕େจࣈ ϩʔϫʔΩϟϝϧέʔε VTFS5FBN/BNF ޠ۟ͷ۠੾ΓΛେจࣈ ઌ಄ͷจࣈ͕খจࣈ εωʔΫέʔε VTFS@UFBN@OBNF ޠ۟ͷ۠੾ΓΛΞϯμʔείΞ νΣΠϯέʔε VTFSUFBNOBNF ޠ۟ͷ۠੾ΓΛϋΠϑϯ
  6. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ͨΊ͠ʹॻ͍࣮ͯߦͯ͠ΈΔ ࣍ͷϖʔδͷʮجຊతͳܕʯΛ΋ͱʹ ؆୯ʹαϯϓϧϓϩάϥϜΛॻ͍ͯΈ·͠ΐ͏ɻ ม਺ʹॳظ஋ΛೖΕɺ ͦΕΛWJFX%JE-PBEؔ਺ͷதͰ࣮ߦ͠·͢ɻ ࠷ޙʹQSJOUؔ਺Λ࢖ͬͯग़ྗͯ͠Έ·͢ɻ 7JFX$POUSPMMFSTXJGUʹӈͷίʔυΛॻ͍ͯɺ 9DPEFࠨ্ͷ⾣ϘλϯΛԡ͔͢

    $PNNBOE 3ΩʔͰ࣮ߦ͍ͯͩ͘͠͞ɻ import UIKit class ViewController: UIViewController { var myAge: Int = 18 let myName: String = "Ichiro Suzuki" override func viewDidLoad() { super.viewDidLoad() // Πνϩʔ͸ຊ౰͸42ࡀͩͬͨͷͰɺॳظ஋ͷ18ࡀʹ24ࡀ଍ͯ͠୅ೖ͠௚͢ɻ myAge = myAge + 24 // printؔ਺Λ࢖ͬͯग़ྗͯ͠ΈΔɻ print("\(myName)ͷ೥ྸ͸\(myAge)ࡀͰ͢ɻ") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }  
  7. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ جຊతͳܕ ୯ޠ ҙຯ ྫ *OU ੔਺ɻ*OUFHFS ੔਺ ͷུޠɻ

    WBSBHF 'MPBU খ਺఺෇͖ͷ਺஋ɻුಈখ਺఺ܕɻ WBSQPJOU %PVCMF খ਺఺෇͖ͷ਺஋ɻഒਫ਼౓ුಈখ਺఺਺ܕɻ WBSMPDBUJPO 4USJOH จࣈྻɻ MFUOBNFl+PIOz #PPM ࿦ཧܕɻUSVFGBMTFɻ WBSJT4MFFQJOHUSVF "SSBZ ഑ྻܕɻෳ਺ͷσʔλΛॱ൪෇͖Ͱอ࣋Ͱ͖Δɻ WBSUFBNT<l$BSQz l5JHFSTz> %JDUJPOBSZ ࣙॻܕɻΩʔͱ஋Λରʹͯ͠อ࣋Ͱ͖Δɻ WBSDJUZ<lOBNFzl5PLZPz> 0QUJPOBM5ZQF Φϓγϣφϧܕɻۭͷঢ়ଶ OJM Λอ࣋Ͱ͖Δɻ ɻ WBSNJEEMF/BNF4USJOH  
  8. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ԋࢉࢠ ԋࢉࢠ ҙຯ ଍͢  Ҿ͘ ͔͚Δ 

    ׂΔ  ׂͬͨ༨ΓΛग़͢ "# #ͷ஋Λ"ʹ୅ೖ "# "ͱ#͕ಉ͡஋͔Ͳ͏͔Λௐ΂Δ "# "ͱ#͕ಉ͡஋Ͱͳ͍͔Ͳ͏͔Λௐ΂Δ "# "͔ͭ# "cc# "·ͨ͸#  
  9. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ جຊతͳ୯ޠू ୯ޠ ҙຯ MFU ఆ਺ FYCJSUIEBZ ɻ஋ͷ࠶୅ೖ͕Ͱ͖ͳ͍ม਺ɻ WBS

    ม਺ FYBHF GVOD ؔ਺ɺϝιουɺػೳ FYXBML FBU TMFFQ ม਺ ஋ͷอଘྖҬʹ໊લΛ͚ͭͨ΋ͷ ܕ σʔλͷछྨͷ෼ྨ FY੔਺ͳͷ͔খ਺ͳͷ͔ ϝιου ॲཧͷ͔ͨ·Γ Ϋϥε ઃܭਤɺಉ͡ಛ௃Λ࣋ͭ΋ͷͷू߹ମ FYਓؒ Πϯελϯε Ϋϥε͔ΒੜΈग़͞Ε࣮ͨମ FYླ໦Ұ࿠ ˞ݫີʹݴ͏ͱؔ਺ͱϝιου͸ҧ͍·͕͢ɺ͸͡Ί͸ಉ͡Α͏ͳ΋ͷͱଊ͑ͯ΋ࠔΒͳ͍ͱࢥ͍·͢ɻ  
  10. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ཚ਺Λൃੜͤͯ͞ΈΑ͏ import UIKit class ViewController: UIViewController { var

    myAge: Int = 18 let myName: String = "Ichiro Suzuki" var salary: Int = 0 override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. // Πνϩʔ͸ຊ౰͸42ࡀͩͬͨͷͰɺॳظ஋ͷ18ࡀʹ24ࡀ଍ͯ͠୅ೖ͠௚͢ɻ myAge = myAge + 24 // څྉΛϥϯμϜʹੜ੒ͯ͠ΈΔɻarc4random_uniformؔ਺͸UInt32ܕͳͷͰIntܕʹม׵͍ͯ͠Δɻ salary = Int(arc4random_uniform(1000000000)) // printؔ਺Λ࢖ͬͯग़ྗͯ͠ΈΔɻ print("\(myName)ͷ೥ྸ͸\(myAge)ࡀͰ͢ɻࠓγʔζϯͷ೥เ͸\(salary)ԁͰͨ͠ɻ") } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }  
  11. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ JGจͱ͸ʁ JG৚݅"\ ॲཧ" ^ JGจΛ࢖͏ͱɺ৚݅ʹΑͬͯॲཧΛม͑Δ͜ͱ͕Ͱ͖·͢ɻॻ͖ํ͸ҎԼͷͱ͓ΓͰ͢ɻ JG৚݅"\ ॲཧ" ^FMTFJG৚݅#\

    ॲཧ# ^FMTFJG৚݅$\ ॲཧ$ ^FMTF\ ॲཧ% ^ JG৚݅"\ ॲཧ" ^FMTF\ ॲཧ# ^  
  12. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ JGจΛ࢖ͬͨྫ import UIKit class ViewController: UIViewController { var

    number: Int = 0 override func viewDidLoad() { super.viewDidLoad() number = Int(arc4random_uniform(10)) print(number) if number < 2 { print("খ٢") } else if number >= 2 && number <= 6 { print("٢") } else if number == 7 { print("େ٢") } else { print("ڟ") } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } ӈͷϓϩάϥϜͰ͸ɺ·ͣdͷൣғͰཚ਺Λൃੜͤ͞·͢ɻ ൃੜͨ͠ཚ਺Λ΋ͱʹɺҎԼͷ৚݅Ͱ͓Έ͘͡ΛׂΓৼΓ·͢ɻ WJFX%JE-PBEؔ਺͸ɺ͜ͷը໘͕ىಈͨ͠ͱ͖ʹ౓͚ͩݺ͹Ε ΔॲཧͰ͢ɻ͜ͷதʹϓϩάϥϜΛॻ͘ͱɺը໘ىಈ࣌ʹ޷͖ͳ ॲཧΛൃಈͤ͞Δ͜ͱ͕Ͱ͖·͢ɻը໘ͷॳظঢ়ଶΛ࡞Γ͍ͨͱ ͖ʹΑ͘࢖ΘΕ·͢ɻ d     খ٢ ٢ େ٢ ڟ ͔ ͔͔͔͔  ͔ ˞͋͘·ͰྫͳͷͰɺ৚݅ࣜͳͲ͸ࣗ෼ͰΞϨϯδͯ͠Έ·͠ΐ͏ɻ  
  13. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ૉࡐΛ४උ͠Α͏ʂ ΨνϟΞϓϦΛ࡞Δʹ͋ͨͬͯɺඞཁͳૉࡐΛूΊ·͠ΐ͏ʂ ·ͣ͸αΫοͱίϯηϓτΛܾΊͯɺҎԼͷૉࡐΛूΊ·͠ΐ͏ɻ ूΊΔ΋ͷ ਺ྔ ஫ҙ఺ എܠը૾ 

    എܠʹΑͬͯੈք؍͕มΘΔͷͰ ஫ҙɻ ྫɿಎ۸ͷഎܠͳΒϞϯ ελʔήʔϜ Ϟϯελʔͷը૾  ͱΓ͋͑ͣຕ͋ͭΊͯɺ͋ͱͰ ૿΍ͦ͏ɻϞϯελʔ͕͍ࣸͬͯ Δ෦෼Ҏ֎͕ಁա͞Ε͍ͯΔ΋ͷ ͕Φεεϝɻ  
  14. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ 4UPSZCPBSE 9DPEFͷ࠷େͷಛ௃ͱ΋ݴͬͯ Α͍4UPSZCPBSE ετʔϦʔ Ϙʔυ ɻ4UPSZCPBSEͰ͸͋Β ͔͡Ί༻ҙ͞Ε͍ͯΔύʔπΛ υϥοάυϩοϓͰ഑ஔ͢Δ

    ͜ͱͰɺ௚ײతʹΞϓϦͷύʔ π഑ஔɺϨΠΞ΢τΛ࡞੒͢Δ ͜ͱ͕Ͱ͖·͢ɻ ·ͣ͸.BJOTUPSZCPBSEϑΝ ΠϧΛճΫϦοΫͯ͠දࣔͤ͞ ·͢ɻ  
  15. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ύʔπͷ഑ஔ 4UPSZCPBSE্ͷ7JFX$POUSPMMFSʹύʔ πΛ഑ஔ͍͖ͯ͠·͢ɻ*NBHF7JFX Λͭ എܠ༻ͱϞϯελʔ༻ ɺΨνϟ ΛҾͨ͘ΊͷϘλϯΛͭஔ͖·͢ɻ ύʔπΛΫϦοΫͨ͋͠ͱɺ9DPEF

    ӈ্ͷ໺ٿͷϗʔϜϕʔεͷΑ͏ͳϚʔ ΫͷϘλϯΛԡ͢ͱ֤ύʔπͷࡉ͔ ͍ઃఆΛ͢Δ͜ͱ͕Ͱ͖·͢ɻྫ͑ ͹͜ͷαϯϓϧͰ͸ɺഎܠ৭Λࠇʹ มߋͨ͠Γɺ഑ஔͨ͠Ϙλϯͷഎܠ ৭Λ੺ʹมߋ͍ͯ͠·͢ɻ  
  16. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ϓϩάϥϜΛॻ͘ import UIKit class ViewController: UIViewController { //

    ม਺ͷએݴ var number = 0 @IBOutlet weak var monsterImageView: UIImageView! @IBOutlet weak var gachaButton: UIButton! override func viewDidLoad() { super.viewDidLoad() // ॳظઃఆ monsterImageView.image = nil gachaButton.layer.cornerRadius = gachaButton.bounds.height / 2 gachaButton.layer.masksToBounds = true } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } @IBAction func tapGachaButton() { // ΨνϟͷΞϧΰϦζϜ number = Int(arc4random_uniform(100)) if number < 60 { monsterImageView.image = UIImage(named: "[email protected]") } else if number >= 60 && number < 80 { monsterImageView.image = UIImage(named: "[email protected]") } else { monsterImageView.image = UIImage(named: "[email protected]") } // Ξχϝʔγϣϯ monsterImageView.alpha = 0.0 UIView.animate(withDuration: 1.0) { self.monsterImageView.alpha = 1.0 } } } ΨνϟͷϓϩάϥϜΛॻ͍͍͖ͯ·͢ɻ ॳΊͯݟΔίʔυ΋͋Δͱࢥ͍·͕͢ɺ·ͣ͸ॻ͍ͯΈ·͠ΐ ͏ɻ J04ͷΞϓϦ͸ʮ$PDPB5PVDIʯͱ͍͏ϑϨʔϜϫʔΫͰಈ͍ ͍ͯ·͕͢ɺ$PDPBܥͷϓϩάϥϜͷಛ௃ͱͯ͠ɺzม਺໊΍ϝ ιου໊͕௕͍͚ΕͲɺӳޠΛಡΊ͹ͦΕ͕ԿΛ͍ࣔͯ͠Δ͔ ཧղͰ͖Δzͱ͍͏఺͕͋Γ·͢ɻ ӳޠ͕ಡΊΔਓ͸ɺࡉ͔͍୯ޠ΍จ๏͸Θ͔Βͳͯ͘΋ɺͦΕ ͧΕͷϓϩάϥϜ͕͓͓·͔ʹԿΛҙຯ͍ͯ͠Δͷ͔े෼ཧղ Ͱ͖Δ͸ͣͰ͢ɻ  
  17. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ؔ࿈෇͚ ͜͜·ͰɺύʔπΛ഑ஔ͠ɺϓϩάϥϜ Λॻ͖·ͨ͠ɻ͔͠͠ɺ͜Ε͚ͩͰ͸ ʮͲͷϓϩάϥϜ͕ͲͷύʔπʹରԠ͠ ͍ͯΔͷ͔ʁʯ͕໌֬ʹͳ͍ͬͯ·ͤ ΜɻϓϩάϥϜͱύʔπΛඥ෇͚Δ͜ͱ Λɺʮؔ࿈෇͚ʯͱݴ͍ɺ!*#0VUMFUɺ !*#"DUJPOͳͲͷम০ࢠΛม਺ͷલ΍

    ϝιουͷલʹ͚ͭΔ͜ͱͰ࣮ݱͰ͖ ·͢ɻ9DPEFͷӈଆͷΧϥϜ͔Βυ ϥοάɾΞϯυɾυϩοϓͰ؆୯ʹؔ ࿈෇͚Λ͢Δ͜ͱ͕Ͱ͖·͢ɻ *#"DUJPOͷؔ࿈෇͚Λߦͬͨͱ͖ʹબ୒ࢶ͕ग़͖ͯ·͕͢ 5PVDI%PXO΋͘͠͸5PVDI6Q*OTJEFΛબͼ·͠ΐ͏ɻ  
  18. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ ൃల՝୊ /P ՝୊ ώϯτ  Ϟϯελʔ͚ͩͰͳ͘എܠ΋มΘΔΑ͏ʹͯ͠ΈΑ͏ NPOTUFS*NBHF7JFXͷίʔυΛࢀߟ ʹͯ͠Έ·͠ΐ͏ʂ

     λΠτϧը໘Λ͚ͭͯը໘ʹͯ͠ΈΑ͏ #VUUPO΍*NBHF7JFXΛ഑ஔͨ͠Α͏ ʹɺύʔπҰཡ͔Β7JFX$POUSPMMFS Λ௥Ճͯ͠Έ·͠ΐ͏ʂ  ΞχϝʔγϣϯΛม͑ͯΈΑ͏ ʮ4XJGUΞχϝʔγϣϯʯͳͲͰݕ ࡧͯ͠Έ·͠ΐ͏ʂ  
  19. &ODPVSBHF(FFL4BMPO ΨνϟΞϓϦ σόοάͷώϯτ σόοάͱ͸ɺΤϥʔ΍ෆ۩߹΍ൈ͚Λݟ͚ͭͯվળ΍ख௚͠ΛՃ͑Δ͜ͱͰ͢ɻ ॳ৺ऀ͕ى͕ͪ͜͠ͳΤϥʔΛ·ͱΊͯΈ·ͨ͠ɻ Α͋͘ΔΤϥʔɾϛε ରॲ๏ͱώϯτ Τϥʔ͕ग़ͯ3VOͰ͖ͳ͍ ɾεϖϧϛε ɾେจࣈখจࣈͷϛε

    ɾॻ͘৔ॴΛؒҧ͍ͬͯΔ ɾΧοίͷ਺͕߹͍ͬͯͳ͍ 3VOͰ͖Δ͕ࢥͬͨΑ͏ʹಈ͔ͳ͍ ɾม਺ͷத਎͕ҧ͍ͬͯΔͷͰQSJOUؔ਺ͰνΣοΫ 3VOͰ͖Δ͕ಈ͔͢ͱΫϥογϡ͢Δ ɾؔ࿈෇͚Λਖ਼͘͠ߦ͍ͬͯͳ͍ ɾؔ࿈෇͚ޙʹม਺໊Λมߋͨ͠