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

ざっくりわかるSwift

 ざっくりわかるSwift

Shigure Shimotori

July 19, 2017
Tweet

More Decks by Shigure Shimotori

Other Decks in Programming

Transcript

  1. AndroidͱiOSͷ؀ڥͷҧ͍ • Android • ॳճ͚ͩొ࿥ྉΛ෷͑͹OK • ೔ຊAndroidͷձ͕͋Δɺֶੜ෦΋͋Δ • ࠓKotlin͕೤͍ʂ •

    iOS • ຖ೥͓෍ࢪ͕ඞཁ • ͦΜͳձ͚͋ͬͨͬ • ·ͨSwift4ʹॻ͖׵͑Δ࡞ۀ͕͸͡·Δ͓…
  2. ཁ໿͢Δͱ͜Μͳ͔Μ͡ʂ • ϓϩτίϧࢦ޲ / ΦϒδΣΫτࢦ޲ /
 ؔ਺ܕ / ໋ྩܕ /

    ϒϩοΫߏ଄ • ڧ͍੩తܕ෇͚ / ܕਪ࿦ • Objective-C౳͔ΒͷӨڹ͋Γ • Swift4Ӷҙ੡࡞த • ܕ҆શnull҆શɻૉ੖Β͍͠ɻ • LLVMͱ͔ͳΜͱ͔ https://en.wikipedia.org/wiki/Swift_(programming_language)
  3. Java Comparable<T>ͱSwift Comparable • Java Comparable<T> • Swift Comparable μΠϚ

    http://qiita.com/S_Shimotori/items/83e22d83f5c0096a6d5b http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/lang/Comparable.java https://github.com/apple/swift/blob/c15c671372620b543e19a662218a247f601628e4/stdlib/public/core/Comparable.swift ※ ࣮ࡍ͸Equatableͷ “=” ͱComparableͷ ”<“ Λ࣮૷͢Ε͹଍ΓΔ
  4. OptionalͱCommandLine • Optional͸enum Optional<Wrapped> • .some(Wrapped)ͱ.noneΛྻڍ • Nullableͷਖ਼ମ • enum

    CommandLine͸ྻڍͯ͠ͳ͍ • ྻڍܕࣗ਎͕ΠχγϟϥΠζ͞Εͳ͍ಛੑΛར༻ https://github.com/apple/swift/blob/master/stdlib/public/core/CommandLine.swift https://github.com/apple/swift/blob/master/stdlib/public/core/Optional.swift Optional<String>ͷ౶ҥߏจ
  5. Swift͕Ͱ͖Δ͜ͱɺ୯඼Ͱ͸Ͱ͖ͳ͍͜ͱ • Swift಺ଂͷඪ४ϥΠϒϥϦ͕Ͱ͖Δ͜ͱ • هड़ʹඞཁͳػೳͷجຊ૚ • Stringͱ͔printͱ͔ͦ͏͍͏ͷ • “import Foundation”ͰͰ͖Δ͜ͱ

    • ΞϓϦͷجຊతͳػೳʹؔΘΔૢ࡞ • ϑΝΠϧͱ͔ηογϣϯͱ͔ͦ͏͍͏ͷ • Darwin༻FoundationͱLinux༻Foundation͸ผ෺ (௚༁)
  6. ͱΓ͋͑ͣॻ͖ͳ͕Β΍ͬͯΈ͍ͨʂ • ԦಓXcodeͰߦ͖͍ͨਓ • Xcode8ʹ͸ϦϑΝΫλϦϯάػೳ͕ͳ͍(স) • playgroundsͰؾܰʹॻ͚Δɺͨͷ͍͠ • JetBrainsڭͷਓ •

    iOSͱҰॹʹ΍ΔͳΒAppCodeɺpure SwiftͳΒCLion • Vimmer • ͪΌΜͱߋ৽͕௥͍͍ͭͯΔͷ͸ͳ͍Μ͡Ό… • Emacser • ͪΌΜͱߋ৽͞ΕͯΔɺͣΔ͍