Slide 1

Slide 1 text

݁ࠗࣜΛࢧٕ͑ͨज़ 'JSFCBTFΛ׆༻ͨ͠αʔόϨεJ04ΞϓϦέʔγϣϯ։ൃ J04%$+BQBO %BZ 5SBDL"ʙ !NPUPLJFF

Slide 2

Slide 2 text

"CPVUNF w HJUIVC UXJUUFS RJJUBNPUPLJFF w J04%$+BQBOελοϑ w גࣜձࣾι΢κ΢ͰϝϧΧϦΧ΢ϧͷ։ൃΛ͍ͯ͠ΔJ04ΤϯδχΞ w ι΢κ΢͸ϝϧΧϦʹଓ͘৽ͨͳαʔϏεΛ࡞ΔձࣾͰ͢ w γΣΞαΠΫϧαʔϏεNFSDIBSJ४උத w ϋʔυ΢ΣΞ΋Ͱ͖ΔPSڵຯ௡ʑͳJ04ΤϯδχΞɺେืूத

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

͖ΐ͏࿩͢͜ͱ

Slide 5

Slide 5 text

ڈ೥݁ࠗࣜΛڍ͛ͨͱ͖ʹɺ
 ઐ༻ͷJ04ΞϓϦΛ։ൃ͓ͨ͠࿩

Slide 6

Slide 6 text

݁ࠗࣜ)BDL

Slide 7

Slide 7 text

ͳͥ։ൃͨ͠ͷ͔ʁ

Slide 8

Slide 8 text

ղܾ͢΂͖՝୊͕͔͋ͬͨΒ

Slide 9

Slide 9 text

ղܾ͍ͨ͠՝୊ w ݁ࠗࣜͷΧϝϥϚϯ͸େม͕͓͔͔ۚΔ w ΧϝϥϚϯʹݶΒͣશൠతʹߴ͍ w ݁ࠗࣜͰΈΜͳεϚϗͰࣸਅࡱͬͯΔ w Ͱ΋ͳ͔ͥૹΒΕͳ͍ʢ࣮͸ࣗ෼͚ͩૹ͍ͬͯͳ͍͚͔ͩ΋ʣ

Slide 10

Slide 10 text

ղܾ͢΂͖՝୊ w ݁ࠗࣜͷΧϝϥϚϯ͸େม͕͓͔͔ۚΔ w ΧϝϥϚϯʹݶΒͣશൠతʹߴ͍ w ݁ࠗࣜͰΈΜͳεϚϗͰࣸਅࡱͬͯΔ w Ͱ΋ͳ͔ͥૹΒΕͳ͍ʢ࣮͸ࣗ෼͚ͩૹ͍ͬͯͳ͍͚͔ͩ΋ʣ

Slide 11

Slide 11 text

ࣸਅΞοϓϩʔυ·ͰͷಓͷΓ

Slide 12

Slide 12 text

ࡱΔ ͳΜΒ͔ͷ࡞ۀ Ξοϓϩʔυ

Slide 13

Slide 13 text

ͳΜΒ͔ͷ࡞ۀ͕๛෋ w ࡱΔˠͳΜΒ͔ͷ࡞ۀˠΞοϓϩʔυ w ͳΜΒ͔ͷ࡞ۀ͕໘౗Ͱ͋ΔʢΞϓϦ։͍ͯɺࣸਅબΜͰɺૹΔʣ w ͳΜΒ͔ͷ࡞ۀͷखஈ͕ͨ͘͞Μ͋ΔʢΞϓϦ͍ͬͺ͍ʣ w -*/& 'BDFCPPL.FTTFOHFS ϓϦϯτΞ΢τ &NBJMʜ w ํ๏͕͋Γ͗͢Δ͜ͱʹՃ͑ͯૹΔखஈΛܾΊΔίϛϡχέʔγϣϯ͕໘౗ w ๨ΕΔɺͦͯ࣌͠͸ྲྀΕΔ

Slide 14

Slide 14 text

खஈʹ͍ͭͯ͸ Կ΋ߟ͑ͳͯ͘΋ྑ͍Α͏ʹ͍ͨ͠

Slide 15

Slide 15 text

*OTUBHSBNΈ͍ͨͳΞϓϦΛ ։ൃ͠Α͏

Slide 16

Slide 16 text

͜ͷΞϓϦͰ໨ࢦ͢͜ͱ w ࡱΔˠͳΜΒ͔ͷ࡞ۀˠΞοϓϩʔυ w ͳΜΒ͔ͷ࡞ۀ͕໘౗Ͱ͋ΔˠΞϓϦ಺ͰࡱӨޙͷϑϩʔʹ૊ΈࠐΉ ͜ͱʹΑͬͯ࠷খԽ w ͳΜΒ͔ͷ࡞ۀͷखஈ͕ͨ͘͞Μ͋Δˠखஈ͕ΞϓϦʹू໿ w ํ๏͕͋Γ͗͢Δ͜ͱʹՃ͑ͯૹΔํ๏ͷίϛϡχέʔγϣϯ͕໘౗ w ๨ΕΔɺͦͯ࣌͠͸ྲྀΕΔˠʮࡱΔʯʮΞοϓϩʔυʯΛಉ࣌ʹߦ͏

Slide 17

Slide 17 text

։ൃ͢Δͧɾɾɾʂ

Slide 18

Slide 18 text

͢Ͱʹϲ݄੾ͬͯͨ ʢ݁ࠗࣜ͸೥݄೔ʣ

Slide 19

Slide 19 text

*OJUJBMDPNNJU J04%$+BQBO స৬ ݁ࠗࣜ

Slide 20

Slide 20 text

*OJUJBMDPNNJU J04%$+BQBO స৬ ݁ࠗࣜ ͖͋Β͔ʹਓੜͷେࣄͳΠϕϯτΛ٧ΊࠐΈ͍͗ͯ͢Δ

Slide 21

Slide 21 text

͋ΕɺϜϦʁ

Slide 22

Slide 22 text

Ͱ΋࡞Γ͍ͨɾɾɾʂ ΍͍ͬͯͧ͘ʂ

Slide 23

Slide 23 text

ओͳ΍Γ͍ͨ͜ͱ w ࣸਅʢλΠϜϥΠϯʣ w 1VTI௨஌ w ੮࣍දӾཡ w ͓஌Βͤը໘

Slide 24

Slide 24 text

ࡉ͔͘ w ࣸਅʢλΠϜϥΠϯʣ w Χϝϥ͔ΒͷΞοϓϩʔυ w ΞϧόϜ͔ΒͷΞοϓϩʔ υ w Ξοϓͨࣸ͠ਅʹ-JLFతͳ ͜ͱ͕Ͱ͖Δ w Ξοϓͨࣸ͠ਅʹίϝϯτ Ͱ͖Δ w ࣸਅΛՃ޻Ͱ͖Δ w 1VTI௨஌ w ݁ࠗࣜલ೔ʹʮ໌೔͸ΑΖ͘͠ ͓Ͷ͕͍͠·͢ʯͱ͔ૹΓ͔ͨͬ ͨ w ੮࣍දӾཡ w ͜Ε෼͔ͬͯΔͱخ͍͠͸ͣ w ͓஌Βͤը໘ w Կ͔͋ͬͨΒ͜͜ʹදࣔͯ͠ʮಡ ΜͰͶʯ͕͔ͨͬͨ͠

Slide 25

Slide 25 text

࡟ͬͨͭ΋ΓͰ΋ͨ͘͞Μ

Slide 26

Slide 26 text

՝୊੔ཧ w εέδϡʔϧ w ϦϦʔε೔݁ࠗࣜ౰೔ʜͩͱؒʹ߹Θͳ͍ͷͰ೔͘Β͍લ w αʔόαΠυʢͳʹΛ࢖͏ʹͯ͠΋ઈରؒʹ߹Θͳ͍ʣ w ࣌ظʢ৽͍͠04 4XJGUͳͲ͕ग़Δ͔ग़ͳ͍͔ͷλΠϛϯάʣ w ഑෍ w Πϯετʔϧ͢ΔਓΛͬͪ͜Ͱίϯτϩʔϧ͍ͨ͠ w Ϣʔβʔ w ࣗ෼ͨͪͷ༑ୡಉੈ୅ w ෕਌ɺ฼਌ɺ਌଒ εϚϗ࢖͍׳Εͯͳ͍ਓ͕ଟ͍ w 04͸ʜʁJ04ͷਓ͍ͨΒͲ͏͠Α͏

Slide 27

Slide 27 text

΍Βͳ͍͜ͱΛܾΊͨ

Slide 28

Slide 28 text

՝୊΁ͷΞϓϩʔν w εέδϡʔϧ͸Ԇͼͳ͍ͷͰͰ͖Δ͜ͱΛؒʹ߹͏ൣғͰ΍Δ w αʔόαΠυ͸΍Βͳ͍ɺ'JSFCBTFΛ࢖͏ w J04 4XJGUͰ։ൃΛߦ͏ w ετΞʹ͸ग़͞ͳ͍ɺ%FQMPZHBUFͰ഑Δ w Πϯετʔϧํ๏͕෼͔Βͳ͍ਓ͸έΞ͢Δ

Slide 29

Slide 29 text

࣮૷

Slide 30

Slide 30 text

΍Γ͍ͨ͜ͱ w ࣸਅ w Χϝϥ͔ΒͷΞοϓϩʔυ w ΞϧόϜ͔ΒͷΞοϓϩʔ υ w Ξοϓͨࣸ͠ਅʹ-JLFతͳ ͜ͱ͕Ͱ͖Δ w Ξοϓͨࣸ͠ਅʹίϝϯτ Ͱ͖Δ w ࣸਅΛՃ޻Ͱ͖Δ w 1VTI௨஌ w ݁ࠗࣜલ೔ʹʮ໌೔͸ΑΖ͘͠ ͓Ͷ͕͍͠·͢ʯͱ͔ૹΓ͔ͨͬ ͨ w ੮࣍දӾཡ w ͜Ε෼͔ͬͯΔͱخ͍͠͸ͣ w ͓஌Βͤը໘ w Կ͔͋ͬͨΒ͜͜ʹදࣔͯ͠ʮಡ ΜͰͶʯ͕͔ͨͬͨ͠

Slide 31

Slide 31 text

΄΅શͯ'JSFCBTFͰ࣮ݱՄೳ

Slide 32

Slide 32 text

΍Γ͍ͨ͜ͱ w ࣸਅʢλΠϜϥΠϯʣ w Χϝϥ͔ΒͷΞοϓϩʔυ w ΞϧόϜ͔ΒͷΞοϓϩʔ υ w Ξοϓͨࣸ͠ਅʹ-JLFతͳ ͜ͱ͕Ͱ͖Δ w Ξοϓͨࣸ͠ਅʹίϝϯτ Ͱ͖Δ w ࣸਅΛՃ޻Ͱ͖Δ w 1VTI௨஌ w ݁ࠗࣜલ೔ʹʮ໌೔͸ΑΖ͘͠ ͓Ͷ͕͍͠·͢ʯͱ͔ૹΓ͔ͨͬ ͨ w ੮࣍දӾཡ w ͜Ε෼͔ͬͯΔͱخ͍͠͸ͣ w ͓஌Βͤը໘ w Կ͔͋ͬͨΒ͜͜ʹදࣔͯ͠ʮಡ ΜͰͶʯ͕͔ͨͬͨ͠ ແ೦ɺ͜Ε͚ͩͰ͖ͣ

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

λΠϜϥΠϯͷ࣮૷

Slide 35

Slide 35 text

λΠϜϥΠϯͷػೳ w Χϝϥ͔ΒͷΞοϓϩʔυ w ΞϧόϜ͔ΒͷΞοϓϩʔυ w Ξοϓͨࣸ͠ਅʹ-JLFతͳ͜ͱ͕Ͱ͖Δ w Ξοϓͨࣸ͠ਅʹίϝϯτͰ͖Δ w ࣸਅΛՃ޻Ͱ͖Δ

Slide 36

Slide 36 text

ඞཁͳ΋ͷ

Slide 37

Slide 37 text

ࣸਅΛΞοϓϩʔυ ը૾63-औಘ औಘͨ͠ը૾63-ͱͱ΋ʹ%BUBCBTFʹอଘ ίʔϧόοΫ

Slide 38

Slide 38 text

final class FirebaseDatabaseManager { private var reference: FIRDatabaseReference = FIRDatabase.database().reference().child("articles") func save(_ article: Article, completion: CompletionHandler?) { reference.child(article.id).setValue(article.encoded) { _, _ in completion?() } } func load(_ completionHandler: @escaping ([Article]) -> ()) { reference.observeSingleEvent(of: .value) { snapshot -> Void in completionHandler(Article.build(snapshot.value)) } } func added(_ completionHandler: @escaping (Article?) -> ()) { let handler: (FIRDataSnapshot) -> Void = { snapshot in completionHandler(Article.decodeSingle(snapshot)) } reference.observe(.childAdded, with: handler) } 'JSFCBTF4%,Λ࢖͍ɺ3FBMUJNF%BUBCBTFͷมߋΛ؂ࢹ

Slide 39

Slide 39 text

protocol PhotoViewerViewModelProtocol: class { func didUpdate(_ state: PhotoViewerViewModel.State) } final class PhotoViewerViewModel { enum State { case list([Article]) case add([Article]) case update(Article) case loading case error(String) } func refresh() { guard reachability.isReachable else { delegate?.didUpdate(.error("σʔλΛऔಘͰ͖·ͤΜͰͨ͠")) return } delegate?.didUpdate(.loading) database.load { [weak self] articles in self?.delegate?.didUpdate(.list(articles)) self?.subscribe() } } 7JFX.PEFMͰ4UBUFΛఆٛɺ%BUBCBTFͷมߋʹԠͯ͡ঢ়ଶΛߋ৽͢Δ

Slide 40

Slide 40 text

func didUpdate(_ state: PhotoViewerViewModel.State) { cameraButton.isEnabled = true switch state { case .list(let article): tableView.isHidden = false refreshControl.endRefreshing() SVProgressHUD.dismiss() dataSource = article tableView.reloadData() case .add(let articles): tableView.isHidden = false dataSource = articles + dataSource tableView.reloadData() SVProgressHUD.dismiss() case .loading: cameraButton.isEnabled = false tableView.isHidden = false SVProgressHUD.show(withStatus: "loading...") 7JFX$POUSPMMFS͸4UBUFʹԠͯ͡දࣔΛ੾Γସ͑Δ

Slide 41

Slide 41 text

௨஌ɾ͓஌Βͤͷ࣮૷

Slide 42

Slide 42 text

௨஌ʹඞཁͳ΋ͷ

Slide 43

Slide 43 text

͓஌Βͤʹඞཁͳ΋ͷ

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

ΞϓϦ͕ΞΫςΟϒʹͳͬͨ࣌ʹμ΢ϯϩʔυ

Slide 46

Slide 46 text

final class FirebaseStorageManager { private let storageRef = FIRStorage.storage().reference(forURL: "gs://{project id}.appspot.com/") func newsLoad(_ completion: @escaping ([News]) -> Void) { storageRef.child("news.json").data(withMaxSize: maxSize) { (data, error) in guard error == nil, let data = data else { return } completion(News.decode(data)) } }

Slide 47

Slide 47 text

func applicationDidBecomeActive(_ application: UIApplication) { let storage = FirebaseStorageManager() storage.newsLoad { news in NewsHistoryContainer.news = news NotificationCenter.default.post(name: updateNewsCount, object: nil) } }

Slide 48

Slide 48 text

w େࣄͳ৘ใ͸1VTI௨஌ˍ͓஌Βͤ഑৴ w ձ৔·Ͱͷϧʔτ w ెา෼਺ w J04%$Ͱಘͨ஌ݟ w આ໌จΛॻ͍ͯ΋ͳ͔ͳ͔ಡΜͰ΋Β͏͜ ͱ͸೉͍͠ w J04%$ͷΞϓϦͰ΋ࠔΓͲ͜Ζ΍ޙͰฉ͍ ͯΨοΧϦ͢ΔΑ͏ͳ৘ใ͸UXJUUFSΞΧ΢ ϯτͷ΄͔ɺ1VTI௨஌Ͱ഑৴ʢࠓ͔ΒͰ΋ ݟͯͶʣ

Slide 49

Slide 49 text

݁ࠗࣜͳΒͰ͸ͷ1+ͷਐΊํ

Slide 50

Slide 50 text

ͨͩͰ͑͞΍Δ͜ͱଟͯ͘ࡴെͱ͕ͪ͠ ʢͱฉ͍ͨʣ

Slide 51

Slide 51 text

݁ࠗࣜͷλεΫΛ*TTVFͰҰݩ؅ཧ

Slide 52

Slide 52 text

Ոఉ༻4MBDLʹ௨஌ ४උ๩ͯ͘͠ʢԞ͞ΜͰ͸ͳࣗ͘෼͕ʣΠϥΠϥͯ͠͠·ͬͯ΋ ΩϟϥΫλʔʹ௨஌͞ΕΔͱͪΐͬͱ࿨Ή

Slide 53

Slide 53 text

w ΞϓϦͱ1VTI௨஌ͷ഑৴ɺจݴΛ ܾΊΔͷ͸Ԟ͞Μͷ໾ׂʹ w Ԟ͞Μ͸։ൃͱ͔શؔ͘܎ͳ͍ ࢓ࣄ w ීஈɺΤϯδχΞ͕ͲΜͳ࢓ࣄΛ ͍ͯ͠Δ͔ͷཧղʹ΋ͭͳ͕Δ w ίʔυॻ͘ͷ͸΄ͱΜͲҰਓͰ׬ ݁ͯ͠͠·͏ͷͰԞ͞Μʹʮਃ͠༁ ͳ͍ʯײ͕ग़ͯ͘Δ w lؔΘ͍ͬͯΔzײɺνʔϜײ w ೉ͦ͠͏ɺྑ͘෼͔Βͳ͍ͱࢥ ΘΕͳ͍Α͏ʹ

Slide 54

Slide 54 text

͖Ίࡉ΍͔ͳέΞ w ஈ֊ެ։ w ࠷ॳ͸Ϧςϥγʔߴͦ͏ͳਓʹ w खॱΛগͣͭ͠࡞Γঃʑʹ୭Ͱ΋ ෼͔ΔΑ͏ͳखॱॻΛ࡞Γ্͛ͯ ͍ͬͨ w ࠷ޙͷํͰ྆਌ɺ਌଒ʹ഑෍

Slide 55

Slide 55 text

݁Ռ

Slide 56

Slide 56 text

૯Ξοϓϩʔυ਺ ͪͳΈʹϓϩʹ͓ئ͍ͨ͠΋ͷ͸ຕ

Slide 57

Slide 57 text

w ਓ͕ࡱͬͨຕͰ͸ͳ͘ɺ͍ΖΜͳਓ͕ࡱͬͨຕ w ྔͱͯ͠͸͍ͨ͘͢͝͞Μ͋ΔΘ͚Ͱ͸ͳ͍͕ɺผʑʹࣸਅΛ΋Β͏ΑΓ ΋ѹ౗తʹίϛϡχέʔγϣϯίετ͕গͳ͘ࡁΉ w ͍Ζ͍Ζͳਓ͕ࡱӨͨࣸ͠ਅΛݟΔ͜ͱ͕Ͱ͖ͯ໘ന͍

Slide 58

Slide 58 text

·ͱΊ w ݁ࠗࣜ΍J04%$ͷΑ͏ͳΠϕϯτΞϓϦͷ։ൃͰ'JSFCBTFͷػೳ͸ͱͯ΋༗ޮత ʹ࢖͑Δ w 1VTI௨஌ͳͲΞϓϦΛ࢖ͬͯ΋Β͏্Ͱඞཁͳػೳͷ࣮ݱ͕ૉૣ͘Ͱ͖Δ w σʔλͷಉظػೳͳͲڧྗͳػೳ͕'JSFCBTF4%,ʹ༻ҙ͞Ε͍ͯΔͷͰɺͦ ΕΛ࢖͏͜ͱͰΑΓ࢖͍΍͍͢ΞϓϦ͕։ൃͰ͖Δ

Slide 59

Slide 59 text

Έͳ͞Μ΋ΠϕϯτͰ Կ͔࡞ͬͯΈ·ͤΜ͔ʁ

Slide 60

Slide 60 text

No content