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

初めての Source of Truth / Brief Intro to Source of...

初めての Source of Truth / Brief Intro to Source of Truth

Elvis Shi

July 03, 2020
Tweet

More Decks by Elvis Shi

Other Decks in Programming

Transcript

  1. ॳΊͯͷ4PVSDFPG5SVUI f o r  : 6 . & .

    *  T X J G U     d Έ Μ ͳ Ͱ ৼ Γ ฦ Ζ ͏ ɺ 8 8 % $ d ?
  2. } var employedBy = "YUMEMI Inc." var job = "iOS

    Tech Lead" var favoriteLanguage = "Swift" var twitter = "@lovee" var qiita = "lovee" var github = "el-hoshino" var additionalInfo = """ ࣾ಺ϏσΦձٞͰ Vzoomer ૿΍͠·ͨ͠ʂ """ final class Me: Developable, Talkable {
  3. -JTU 7JFX %FUBJM 7JFX isOn: Bool isOn: Bool ભҠ 4PVSDF

    PG5SVUI 4PVSDF PG5SVUI JT0O͸ͦΕͧΕͷϏϡʔͷ ݻ༗ঢ়ଶͷͨΊɺ ͦΕͧΕಠཱͨ͠4PVSDF PG5SVUIʹͳΔ
  4. -JTU 7JFX %FUBJM 7JFX ભҠ ࢀর 4PNFXIFSF name: String 4PVSDF

    PG5SVUI 3FGFSFODF PG5SVUI 3FGFSFODF PG5SVUI
  5. -JTU 7JFX %FUBJM 7JFX "QQ 4DFOF -JTU 7JFX %FUBJM 7JFX

    4DFOF App Data Scene Data Scene Data List View Data List View Data ભҠ ࢀর
  6. Մมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε @State var @StateObject var

    ෆՄมڞ༗ let let Մมڞ༗ @Binding var @ObservedObject var ෆՄมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε let let ෆՄมڞ༗ let let Մมڞ༗ /" /" NEW
  7. Մมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε @State var @StateObject var

    ෆՄมڞ༗ let let Մมڞ༗ @Binding var @ObservedObject var ෆՄมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε let let ෆՄมڞ༗ let let Մมڞ༗ /" /" NEW ࣗ෼͸ͦͷσʔλΛม͑ͳ͍͚Ͳɺ ผͷը໘ʹΑͬͯͦͷσʔλ͕มΘͬͨΒ ࣗ෼Λߋ৽͠ͳ͍ͱ͍͚ͳ͍ɻ ͦΕͰ΋letͳͷʁ! ͦ͏Ͱ͢ʂ
  8. 6*,JU6*7JFX 4XJGU6*7JFX ܕ ࢀরܕ ஋ܕ ੜ੒࣌ظ Ϗϡʔ࡞੒࣌ ඳըߋ৽։࢝࣌ ഁغ࣌ظ ϏϡʔώΤϥϧΩʔ͔Β

    ͳ͘ͳͬͨͱ͖ ඳըߋ৽ऴ͙ྃ࣌͢ ੜଘظؒ جຊ௕͍ ඇৗʹ୹͍ ੜ੒ճ਺ جຊগͳ͍ ඇৗʹଟ͍ ຊ࣭ ϏϡʔΦϒδΣΫτͦͷ΋ͷ ϏϡʔͷϨϯμϦϯάઆ໌
  9. 6*,JU6*7JFX 4XJGU6*7JFX ܕ ࢀরܕ ஋ܕ ੜ੒࣌ظ Ϗϡʔ࡞੒࣌ ඳըߋ৽։࢝࣌ ഁغ࣌ظ ϏϡʔώΤϥϧΩʔ͔Β

    ͳ͘ͳͬͨͱ͖ ඳըߋ৽ऴ͙ྃ࣌͢ ੜଘظؒ جຊ௕͍ ඇৗʹ୹͍ ੜ੒ճ਺ جຊগͳ͍ ඇৗʹଟ͍ ຊ࣭ ϏϡʔΦϒδΣΫτͦͷ΋ͷ ϏϡʔͷϨϯμϦϯάઆ໌ ඞཁʹͳͬͨͱ͖ ౎౓ੜ੒͞ΕΔͨΊ letͰ΋ਖ਼͘͠ ϨϯμϦϯά͞ΕΔ" ͋Εʁ͡Ό͋ 4PVSDFPG5SVUI ͷϏϡʔ͸ʁ
  10. Մมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε @State var @StateObject var

    ෆՄมڞ༗ let let Մมڞ༗ @Binding var @ObservedObject var ෆՄมσʔλ σʔλ͕஋ܕ ʢString΍Intʣ σʔλ͕ࢀরܕ ʢObservableObjectʣ ιʔε let let ෆՄมڞ༗ let let Մมڞ༗ /" /"