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

How to make and publish a Swift playground book for iPad

sonson
September 01, 2018

How to make and publish a Swift playground book for iPad

sonson

September 01, 2018
Tweet

More Decks by sonson

Other Decks in Programming

Transcript

  1. Χϝϥ͔Βͷը૾ΛϦΞϧλΠϜʹ͍͡ΔPlayPixels
    Tech.
    Yuichi Yoshida
    Senior researcher, DENSO IT Laboratory, Inc.
    #iOSDC2018
    @sonson_twit
    © 2014 DENSO IT Laboratory, Inc., All rights reserved. Redistribution or public display not permitted without written permission from DENSO IT Laboratory, Inc.
    Swift Playgrounds Bookͷ࡞Γํͱ഑Γํ

    View Slide

  2. ࣗݾ঺հ
    • sonson
    • twitter: sonson_twit
    • github: sonsongithub
    • portfolio
    • 2tchɾɾɾଟ෼ɼࣙΊΔ
    • numsw
    • iOS11 Programming Book(ൃചத)
    • ࢓ࣄ(computer vision, machine learning)
    • ը૾ೝࣝɾݕࡧٕज़
    • ࠷ۙ͸σʔλαΠΤϯεతͳ͜ͱ΋

    View Slide

  3. $PSF.-ͱ$SFBUF.-ʹ
    ͍ͭͯॻ͘Α

    View Slide

  4. ࠓ೔ͷ໨త

    View Slide

  5. Swift Playgrounds

    View Slide

  6. View Slide

  7. σϞ
    • AppleͷσϞ

    View Slide

  8. ࠓ೔ͷ͓࿩
    • ໨త
    • iPadʹࣗ෼޷ΈͷSwift coding؀ڥΛ࡞Δ
    • ͦ͏͍͏؀ڥΛΈΜͳͰެ։͋ͬͯ͠ɼָ͠Ή
    • ࡞Γํͱެ։ํ๏
    • Appleۘ੡ͷςϯϓϨʔτʹΑΔ࡞ΓํΛ঺հ
    • ެ։Ͱ͖ΔΜͰ͢Αɼ͜Ε͕ɽ
    • Χϝϥͷը૾ॲཧΛ͢Δαϯϓϧ
    • ը૾ॲཧͷࠜװΛ஌ͬͯ΋Β͏

    View Slide

  9. ͜͏͍͏ͷΛΈΜͳͰ
    • ର࿩ʢ͓͢͢Ίʣ
    • Binary searchͷσϞ
    • ֆจࣈॲཧͷσϞ
    • numsw - ઢܗ୅਺
    • PlayPixelsʢࠓ೔ͷϝΠϯσΟογϡʣ

    View Slide

  10. ͍͍ͱ͜Ζ
    • ϝΠϯͷ໨త͸ڭҭΒ͍͠
    • Ͱ΋Ͷ͐ɾɾίϯςϯπ࡞Δͷେม
    • iPadͰಈ͘ʂʂʂ
    • Ͳ͜Ͱ΋ίʔυ͕ॻ͚Δ
    • ͓खܰɼ͔ͬ͜Α͘σϞͰ͖Δ
    • ͲΜͲΜਐԽ͍ͯ͠Δ
    • Χϝϥ͕࢖͑ΔΑ͏ʹͳͬͨʂ
    • Bluetooth͕࢖͑ΔΑ͏ʹͳͬͨʂ

    View Slide

  11. ͭΒ͍ͱ͜Ζ
    • ϑϨʔϜϫʔΫ΍ϥΠϒϥϦ͕࢖͑ͳ͍
    • ͢΂ͯιʔείʔυ͸Φʔϓϯʹͳͬͯ͠·͏
    • σόοά͕େม
    • Ϛγʹ͸ͳ͖ͬͯͨ
    • Apple΍LEGOͷίϯςϯπ͕͗͢͢͝Δ
    • ૉਓ͕࡞Δͱɼ൵͍͠ɾɾɾɾ

    View Slide

  12. PlaygroundBookͷ࡞Γํ

    View Slide

  13. PlaygroundBook

    View Slide

  14. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift

    View Slide

  15. ֓ཁ
    -JWF7JFXTXJGU
    $POUFOUTTXJGU

    View Slide

  16. ࡞Γํ
    • AppleͷςϯϓϨʔτΛ࢖͏ʢమଇʣ
    • Swift Playgrounds Author Template for Xcode 9.3Λσ
    ϕϩούʔαΠτ͔Βμ΢ϯϩʔυ

    View Slide

  17. ·ͣ͸ઃఆ
    • README.mdͷ”First Step”ʹै͍ɼϓϩδΣΫτͷ໊લ
    ͱ͔Λมߋ͢Δ
    • ద౰ʹ΍Δͱ໘౗ष͍͜ͱʹͳΔͷͰ஫ҙ
    • AppleͷςϯϓϨ͸͔ͳΓνϡʔϯ͞ΕͯΔɾɾɾʁ

    View Slide

  18. ϓϩδΣΫτͷ
    ໊લͳͲͷม਺
    ·ͣಡΉ
    Ͱͳ͍ͱϋϚΔ
    γϛϡϨʔλ্Ͱ#MVFUPPUI
    ͳͲΛ࠶ݱ͢ΔͨΊͷπʔϧ΍-JC
    γϛϡϨʔλΞϓϦຊମ
    1MBZHSPVOE#PPL
    ຊମ

    View Slide

  19. Swift Playgrounds Author Template
    • ΞϓϦͱͯ͠BookΛಈ͔͠ɼσόοά͠΍͘͢
    • Bluetooth౳ͷUIΛΤϛϡϨʔτ
    • ϏϧυεΫϦϓτ΋ࠐΈ
    • σόοά
    • iOS12ͰSwift PlaygroundsͰNSLogΛ࣮ߦͯ͠΋Կ
    ΋දࣔ͞Εͳ͍ɾɾɾɾ
    • ͜ͷςϯϓϨʔτ͕།Ұͷ։ൃ؀ڥɾɾɾɾ

    View Slide

  20. λʔήοτ
    4XJGU1MBZHSPVOE#PPL

    View Slide

  21. λʔήοτ
    #PPLͷγϛϡϨʔλͱͯ͠ͷΞϓϦ

    View Slide

  22. λʔήοτ
    ΞϓϦͷͨΊʹίʔυΛ-JCʹ

    View Slide

  23. -JWF7JFX5FTUBQQͷͨΊͷ
    ϑϨʔϜϫʔΫ

    View Slide

  24. ͷத਎

    View Slide

  25. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift

    View Slide

  26. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    ຊମ

    View Slide

  27. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    ϖʔδ
    ࠷খ୯Ґ

    View Slide

  28. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    ֤ϖʔδͷઃఆ

    View Slide

  29. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    ຊͷߏ੒

    View Slide

  30. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    Ϧιʔε

    View Slide

  31. Playgroundbookͷߏ੒
    ├── Chapters

    │ └── Chapter1.playgroundchapter

    │ ├── Manifest.plist

    │ └── Pages

    │ ├── Basic.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ ├── Binarize.playgroundpage

    │ │ ├── Contents.swift

    │ │ ├── LiveView.swift

    │ │ └── Manifest.plist

    │ └── Filter.playgroundpage

    │ ├── Contents.swift

    │ ├── LiveView.swift

    │ └── Manifest.plist

    ├── Manifest.plist

    ├── PrivateResources

    │ ├── Base.lproj

    │ │ └── LiveView.storyboard

    │ ├── en.lproj

    │ │ └── ManifestPlist.strings

    │ └── icon.png

    └── Sources

    ├── LiveViewController.swift

    └── LiveViewSupport.swift
    Ұ൪େ੾
    ڞ௨ͷΫϥεͱ͔

    View Slide

  32. playgroundpageͷߏ੒ཁૉ
    • LiveView.swift
    • Contents.swift
    • Manifest.plist

    View Slide

  33. LiveView.swift
    • LiveView.swiftʹॻ͘͜ͱ͸͋Μ·Γͳ͍
    • LiveViewControllerΛ͜͜Ͱੜ੒
    • receiveͰίϯτϩʔϥ͔ΒσʔλΛ͏͚ͱΓඳը
    • ॏཁͳͷ͸ɼLiveViewControllerͷ࣮૷
    import UIKit
    import PlaygroundSupport
    PlaygroundPage.current.liveView = sharedLiveViewController

    View Slide

  34. Contents.swift
    • ίʔσΟϯάʹؔ͢Δίϝϯτ΍ώϯτɼεέϧτϯίʔυ
    • ษڧͱͯ͠ͷίϯςϯπ͸ͪ͜Β͕ओ
    //#-hidden-code
    import UIKit
    import PlaygroundSupport
    //#-end-hidden-code
    func process(input: UnsafePointer, output: inout [CUnsignedChar], width: Int,
    height: Int, bytesPerPixel: Int) {
    //#-editable-code
    // write your own code
    //#-end-editable-code
    }
    //#-hidden-code
    class Listener: PlaygroundRemoteLiveViewProxyDelegate {
    func remoteLiveViewProxy(_ remoteLiveViewProxy: PlaygroundRemoteLiveViewProxy,
    received message: PlaygroundValue) {
    // handle message from LiveViewController
    }
    }
    let listener = Listener()
    if let proxy = page.liveView as? PlaygroundRemoteLiveViewProxy {
    proxy.delegate = listener
    }
    //#-end-hidden-code

    View Slide

  35. Manifest.plist - Page
    1MBZHSPVOE-PHHJOH.PEF0⒎
    -JWF7JFX&EHF5P&EHF:&4

    View Slide

  36. Manifest.plist - Page
    1MBZHSPVOE-PHHJOH.PEF/PSNBM
    -JWF7JFX&EHF5P&EHF:&4

    View Slide

  37. Manifest.plist - Page
    1MBZHSPVOE-PHHJOH.PEF0⒎
    -JWF7JFX&EHF5P&EHF:&4

    View Slide

  38. cutscenepageͷߏ੒ཁૉ
    • playgroundpageͱ͸ҟͳΓHTML΋දࣔՄೳ
    • ϑΥϧμ໊ɹ00.cutscenepage
    • Manifest.plistʹHTMLΛࢦఆ
    • PrivateResourcesʹݴޠ͝ͱʹHTMLΛ༻ҙ͢Δ
    • ίʔυෆཁͷϜʔϏʔͬΆ͍ͷʹ࢖͏Α͏ͩ

    View Slide

  39. جຊίϯηϓτ
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε

    View Slide

  40. جຊίϯηϓτ
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε

    View Slide

  41. جຊίϯηϓτ
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ

    View Slide

  42. ૹΔͱ͖͸྆ํͱ΋ಉ͡
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ
    TFOE @NFTTBHF1MBZHSPVOE7BMVF

    View Slide

  43. ૹड৴Ͱ͖Δܕ
    public enum PlaygroundValue {
    case array([PlaygroundSupport.PlaygroundValue])
    case dictionary([String : PlaygroundSupport.PlaygroundValue])
    case string(String)
    case data(Data)
    case date(Date)
    case integer(Int)
    case floatingPoint(Double)
    case boolean(Bool)
    }

    View Slide

  44. ૹΔͱ͖͸྆ํͱ΋ಉ͡
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ
    TFOE @NFTTBHF1MBZHSPVOE7BMVF

    View Slide

  45. ड৴͚͕ͩҟͳΔ
    $POUFOUͷϓϩηε
    class Listener: PlaygroundRemoteLiveViewProxyDelegate {
    var pixelBuffer24bit: [CUnsignedChar]?
    func remoteLiveViewProxy(_ remoteLiveViewProxy: PlaygroundRemoteLiveViewProxy,
    received message: PlaygroundValue) {
    // handle a message
    }
    func remoteLiveViewProxyConnectionClosed(_ remoteLiveViewProxy: PlaygroundRemoteLiveViewProxy) { }
    }
    let listener = Listener()
    if let proxy = page.liveView as? PlaygroundRemoteLiveViewProxy {
    proxy.delegate = listener
    }

    View Slide

  46. ૹΔͱ͖͸྆ํͱ΋ಉ͡
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ
    TFOE @NFTTBHF1MBZHSPVOE7BMVF

    View Slide

  47. ड৴͚͕ͩҟͳΔ
    -JWF7JFXͷϓϩηε
    @objc(Book_Sources_LiveViewController)
    public class LiveViewController: UIViewController, PlaygroundLiveViewMessageHandler,
    PlaygroundLiveViewSafeAreaContainer {
    public func receive(_ message: PlaygroundValue) {
    update(message)
    }
    }

    View Slide

  48. جຊίϯηϓτ
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ

    View Slide

  49. PlayPixelsͷ৔߹
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ
    ը૾ॲཧ $BNFSB
    ͜ͷॲཧͷίʔυ
    $POUFOUTTXJGU
    Ωϟϓνϟͨ͠
    ը૾Λ%BUBʹ

    View Slide

  50. PlayPixelsͷ৔߹
    -JWF7JFXͷϓϩηε
    $POUFOUͷϓϩηε
    1SPYZ
    %BUBʹ
    ύοΩϯά
    6**NBHFʹ
    6**NBHF7JFXʹηοτ

    View Slide

  51. LiveViewTest.app
    • UIApplication౳Λվ଄ʁ
    • LiveViewControllerͷಈ࡞֬ೝ༻ͷΞϓϦ
    • Swift Playgroundsઐ༻ͷUIͷςετ
    • ͦͷͨΊͷBluetoothͳͲͷϑϨʔϜϫʔΫ
    • Contents.swiftͷ୅ཧίʔυͷ࣮૷͕ඞཁ
    ࢖͏΂͖ɽσόοάͰࢮͶΔ
    #if LiveViewTestApp
    // γϛϡϨʔλͰಈ͔͢ͱ͖͸ɼϝιουΛ௚Ͱୟ͖ɼContents.swiftͷ୅ΘΓΛ࣮ߦ
    self.update(value)
    #else
    // PlaygroundͰಈ͔͢ͱ͖͸ɼproxyܦ༝ͰContents.swiftʹσʔλΛૹΔ
    self.send(value)
    #endif

    View Slide

  52. Playground Book
    • PlaygroundSupportͱݺ͹ΕΔϞδϡʔϧ͕৭ʑػೳΛఏڙ
    • ςϯϓϨʔτͰγϛϡϨʔγϣϯՄೳ
    • PlaygroundValueܕͰ౉ͤΔσʔλͷܕͷόϦΤʔγϣϯ͕গͳ͍
    • ؔ਺ͱ͔౉ͤͳ͍
    • LiveViewTest.app͸ɼContents.swiftͱແؔ܎
    • ίϯςϯπΛ͏·͘දࣔͤ͞ΔͨΊͷςετίʔυ͕ඞཁ

    View Slide

  53. ։ൃͷྲྀΕʁ
    • TemplateΛฤू
    • LiveViewControllerΛ࣮૷
    • AppDelegate.swiftͰίϯςϯπΛදࣔ͢ΔίʔυΛ
    ॻ͘(Contents.swift)
    • iPad࣮ػͰɼLiveViewTest.appΛςετ
    • PlaygroundBookΛϏϧυ
    • AirDropͰiPad࣮ػʹPlaygroundBookΛૹΔ
    • Swift PlaygroundsͰ࣮ߦ͢Δ

    View Slide

  54. υΩϡϝϯτ
    • Playground Book Format Reference
    • Swift PlaygroundsͷϓϩδΣΫτࣗମ͕ιʔεͷๅݿ

    View Slide

  55. Furthermore,
    • Contents.swiftͷৄ͍͠ઃఆ
    • ίϯςϯπ࡞ΓͶ
    • ଟݴޠԽʢَ໳ʣ
    • Key-value store΋͋Δ
    • AssesmentStatus
    • ϢʔβͷਐḿධՁ༻ͷ࢓૊Έʁ

    View Slide

  56. PlaygroundBookΛެ։͢Δ

    View Slide

  57. ެ։ํ๏
    • ࠷ۙ΍ͬͱެ։Ͱ͖ΔΑ͏ʹͳͬͨ
    • Ϣʔβ͕Swift Playgrounds͔ΒfeedΛొ࿥Մೳ
    • ϒϥ΢β͔Βొ࿥͢Δ͜ͱ΋Ͱ͖Δ

    View Slide

  58. खॱ
    • ެ։ͷͨΊͷjsonϑΝΠϧ(feed)Λ࡞Δ
    • BookΛෳ਺ݸऩΊΒΕΔ
    • ϋϚΔϙΠϯτ
    • λΠτϧͱ໊લ͕Ұக
    • λΠτϧͱղౚޙͷ໊લ͕Ұக
    • identifier͕Ұக

    View Slide

  59. feed
    {
    "title": "sonson",
    "publisherName": "Yuichi Yoshida",
    "feedIdentifier": "com.sonson.playground",
    "contactURL": "mailto:[email protected]",
    "formatVersion": "1.0",
    "documents": [
    {
    "title": "PlayPixels",
    "overviewSubtitle": "To be written.",
    "detailSubtitle": "αϒλΠτϧৄࡉ",
    "description": "ৄ͍͠આ໌",
    "contentIdentifier": "com.sonson.playground.PlayPixels",
    "contentVersion": "1.0",
    "url": "https://sonson.jp/playgrounds/playpixels/PlayPixels.playgroundbook.zip",
    "publishedDate": "2018-05-18T12:00:00+00:00",
    "lastUpdatedDate": "2018-05-18T12:00:00+00:00",
    "thumbnailURL": "playpixels/thumbnail.png",
    "bannerImageURL": "playpixels/thumbnail.png",
    "additionalInformation": [
    {
    "name": "Languages",
    "value": "English"
    }
    ],
    "previewImageURLs": []
    }
    ]
    }

    View Slide

  60. खॱ
    • ެ։ͷͨΊͷjsonϑΝΠϧ(feed)Λ࡞Δ
    • BookΛෳ਺ݸऩΊΒΕΔ
    • ϋϚΔϙΠϯτ
    • λΠτϧͱ໊લ͕Ұக
    • λΠτϧͱղౚޙͷ໊લ͕Ұக
    • identifier͕Ұக
    • feedʹࢦఆͨ͠ύεʹzipͰݻΊͨbookϑΝΠϧΛஔ͘
    ├── feed.json

    ├── index.html

    └── playpixels

    ├── PlayPixels.playgroundbook.zip

    └── thumbnail.png

    View Slide

  61. ϒϥ΢β͔ΒμΠϨΫτʹొ࿥
    "https://developer.apple.com/ul/sp0?url=https://sonson.jp/playgrounds/feed.json"

    View Slide

  62. https://sonson.jp/playgrounds/

    View Slide

  63. Swift Playgrounds͕ىಈ

    View Slide

  64. ొ࿥ɾɾɾɾײಈ

    View Slide

  65. PlayPixelsͰֶͿը૾ॲཧͷجຊ

    View Slide

  66. https://github.com/sonsongithub/PlayPixels

    View Slide

  67. ը૾ॲཧͷجຊ

    View Slide

  68. ը૾ॲཧͷجຊ



    View Slide

  69. ը૾ॲཧͷجຊ



    View Slide

  70. ը૾ॲཧͷجຊ



    View Slide

  71. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾




    View Slide

  72. ϑΟϧλ



    View Slide

  73. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾







    View Slide

  74. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾








    º

    View Slide

  75. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾








    View Slide

  76. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾








    View Slide

  77. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾









    View Slide

  78. ৞ΈࠐΈԋࢉʔϑΟϧλ
    ೖྗը૾ ग़ྗը૾









    ϑΟϧλͷαΠζͰ
    ͪΐͬͱখ͘͞ͳΔ

    View Slide

  79. ͜Ε͸ɾɾɾͲΜͳϑΟϧλʁ



    View Slide

  80. ࣮͸
    ܀ాଟت෉ɺ੺ึতଠ࿠, ύλʔϯೝࣝ ૣҴాେֶߨٛ – ฏ੒18೥౓

    View Slide

  81. ྲྀߦΓͷCNN
    Y. Lecun, L. Bottou, Y. Bengio and P. Haffner, "Gradient-based learning applied to document
    recognition," in Proceedings of the IEEE, vol. 86, no. 11, pp. 2278-2324, Nov. 1998.
    ͜ͷॏΈΛػցֶशͰಘΔ

    View Slide

  82. ·ͱΊ
    • Swift playgroundsͷָ͠͞
    • Swift Playgrounds Author TemplateΛ࢖͓͏
    • Bookͷجຊ
    • Proxyϕʔεͷϓϩάϥϛϯά
    • Feedͷઃఆ
    • ެ։͸ɼPlayground.appͰͰ͖Δʂ
    • PlayPixelsͰֶͿɼը૾ॲཧͷجຊ

    View Slide