Case.3 Interop: Alamo
fi
re
• Alamo
fi
re/Alamo
fi
re
• NSURLSessionΛϥοϓ͢ΔSwift
͚ͷϥΠϒϥϦ
• androidͰ͍͏ͱ͜ΖͷOkHttp
Slide 33
Slide 33 text
Case.3 Interop: Alamo
fi
re
• >For example, you can use CocoaPods integration or set up a cinterops
con
fi
guration.
• https://kotlinlang.org/docs/native-c-interop-stability.html#third-party-
libraries
• CocoaPodsRead-OnlyʹͳΔ͜ͱ͕Ξφϯε͞Ε͍ͯΔͨΊSPMΛ༻͢Δ
Slide 34
Slide 34 text
Case.3 Interop: Alamo
fi
re
Slide 35
Slide 35 text
Case.3 Interop: Alamo
fi
re
• Package.swift௨ৗͷͷͱ΄΅
มΘΒͳ͍
• XCFrameworkΛॻ͖ग़ͨ͢Ίʹ
BlankͰΑ͍ͷͰproductͱ
targetΛઃఆ͢Δඞཁ͋Γ
Slide 36
Slide 36 text
Case.3 Interop: Alamo
fi
re
• `src/nativeInterop/cinteropʹ.def`Λஔ͢Δ
• https://kotlinlang.org/docs/native-de
fi
nition-
fi
le.html
• build.gradleͰcinteropઃఆΛߦ͍ɺcompiler opt, linker optΛઃఆ͢
Δ
Slide 37
Slide 37 text
Case.3 Interop: Alamo
fi
re
• defϑΝΠϧʹObj-CͷίʔυΛهࡌ͢Δ͜ͱՄೳ
• @see touchlab/CrashKiOS
Slide 38
Slide 38 text
Case.3 Interop: Alamo
fi
re
• XCFrameworkʹؚ·ΕΔϔομʔ
ͷύε࣮ػ/γϛϡϨʔλʔ, CPU
ͷΞʔΩςΫνϟʹΑͬͯҟͳΔͷ
ͰKonanTargetʹΑͬͯذͤ͞Δ
Slide 39
Slide 39 text
Case.3 Interop: Alamo
fi
re
• Alamo
fi
reͷAF͕ݟ͔ͭΒͳ͍
• Swift͚ϥΠϒϥϦͷଟ͘Obj-C༻ϔομʔΛఏڙ͍ͯ͠ͳ͍