Pro Yearly is on sale from $80 to $50! »

Swift プロトコル指向なCのラッパーを作る

Swift プロトコル指向なCのラッパーを作る

5287c9b9576749092d3170ec738338b8?s=128

Yusuke Ito

April 21, 2016
Tweet

Transcript

  1. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 4XJGUϓϩτίϧࢦ޲ͳ $ͷϥούʔΛ࡞Δ ϦʔυΞʔΩςΫτ
 ҏ౻༞ี :VTVLF*UP !OPWJ@ നϠΪίʔϙϨʔγϣϯ 5PLZP4FSWFS4JEF4XJGU.FFUVQ
 

  2. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE 

  3. ΄͔े਺ࣾ ΧϝϦΦͷΞϧΰϦζϜΛαʔϏεͱͯ͠"1*ఏڙ

  4. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE αʔόʔαΠυ 4XJGUΤϯδχΞืूதʂ  ΋ͪΖΜɺJ04ɾ"OESPJE΋

  5. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE $PSF"VEJP w J04.BD -JOVYͰ͸࢖͑ͳ͍͕ʜ ༻ͷԻ੠ॲཧɾ ϋʔυ΢ΣΞ੍ޚ༻ͷ"1* w ݁ߏݹͯ͘.BD049ʙɺJ1IPOF04ܥʙ w

    "1*͸$ݴޠ w ࠓ͸"7'PVOEBUJPOܥΛ࢖͏͜ͱ͕ଟ͍ͷͰ௚઀ୟ ͘͜ͱ͸গͳ͍͔΋ 
  6. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ྫΦʔσΟΦσόΠεҰཡ Λऔಘ w $PSF"VEJPͷ)"- )BSEXBSF"CTUSBDUJPO -BZFS Λ࢖༻ w (JTUOPWJEFWJDFTD

    IUUQTHJTUHJUIVCDPN OPWJ  w ՕॴͰ΋Կ͔ؒҧ͑ΔͱɺΤϥʔɾ஋͕ฦͬͯ͜ ͳ͍ɾམͪΔͷͰ ࠓͱͳͬͯ͸ ͭΒ͍ 
  7. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ೖग़ྗ੍ޚͷ"1* w "VEJP0CKFDU(FU1SPQFSUZ%BUB
 σόΠεɾετϦʔϜͳͲͷϓϩύςΟΛऔಘ w "VEJP0CKFDU4FU1SPQFSUZ%BUB
 ಉϓϩύςΟΛઃఆ 

  8. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ϓϩύςΟͱܕ  ϓϩύςΟ ఆ਺ ϓϩύςΟ ಺༰ ର৅ ܕ L"VEJP)BSEXBSF1SPQFS

    UZ%FWJDFT ઀ଓ͞Ε͍ͯΔ
 σόΠε  "VEJP%FWJDF*% 6*OU L"VEJP%FWJDF1SPQFSUZ %FWJDF/BNF$'4USJOH σόΠεͷ໊લ "VEJP%FWJDF*% $'4USJOH3FG L"VEJP%FWJDF1SPQFSUZ 7PMVNF4DBMBS ݱࡏͷԻྔ "VEJP%FWJDF*% 'MPBU L"VEJP%FWJDF1SPQFSUZ 4USFBNT σόΠεͷ͍࣋ͬͯΔ ετϦʔϜ "VEJP%FWJDF*% "VEJP4USFBN*% L"VEJP4USFBN1SPQFSUZ 1IZTJDBM'PSNBU ରԠ͍ͯ͠Δप೾਺ɾ Ϗοτਂ౓ "VEJP4USFBN*% "VEJP4USFBN#BTJD% FTDSJQUJPO
  9. $PQZSJHIU4IJSPZBHJ$PSQPSBUJPO"MMSJHIUTSFTFSWFE ϓϩύςΟͱܕ w ೖྗ ϓϩύςΟ ͷఆ਺͕ܾ·Ε͹ɺग़ྗͷܕ΋ࣗ ಈతʹܾ·Δ (FUͷ΄͏  w

    4XJGUͰ͸ೖྗͷܕʹରԠ͢Δग़ྗͷܕͱͯ͠දݱ Ͱ͖Δɻ 1SPUPDPMͷBTTPDJBUFEUZQF  w "1*,JUͳͲͰ΋ಉ͡ߟ͑ํ 3FRVF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