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

Simplify your life: build apps from reusable libraries

Simplify your life: build apps from reusable libraries

Originally posted here: https://speakerdeck.com/vashchenko/simplify-your-life-build-apps-from-reusable-libraries

Доклад включает в себя:
- Удобная организация кода в библиотеки
- Переиспользование библиотек - как это ускоряет разработку и делает вашу работу более продуктивной
- Live coding: как создать библиотеку на Swift c нуля

This talk was made for CocoaHeads Kyiv #14 which took place Oct 6 2018.

CocoaHeads Ukraine

October 06, 2018
Tweet

More Decks by CocoaHeads Ukraine

Other Decks in Programming

Transcript

  1. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows
  2. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary
  3. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary
  4. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger
  5. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller
  6. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower
  7. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster
  8. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time
  9. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time at run time
  10. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time at run time Library Update Mechanism rebuild host application
  11. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time at run time Library Update Mechanism rebuild host application updates separately
  12. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time at run time Library Update Mechanism rebuild host application updates separately Usage in Playgrounds can't be used
  13. Static Dynamic File extension .a on Linux, macOS, iOS .lib

    on Windows .dylib on macOS, iOS .so on Linux .dll on Windows Compilation INTO binary OUTSIDE the binary Binary Size bigger smaller Application Load Time slower faster Binding Symbols at link time at run time Library Update Mechanism rebuild host application updates separately Usage in Playgrounds can't be used is used
  14. ActionScript, Ada, C, C#, C++, Common Lisp, Crystal, CUDA, D,

    Delphi, Fortran, Graphical G Programming Language, Halide, Haskell, Java bytecode, Julia, Kotlin, Lua, Objective-C, OpenGL Shading Language, Pony, Python, R, Ruby, Rust, Scala, Swift, Xojo LLVM Clang C, C++, Objective-C, Objective-C++
  15. ActionScript, Ada, C, C#, C++, Common Lisp, Crystal, CUDA, D,

    Delphi, Fortran, Graphical G Programming Language, Halide, Haskell, Java bytecode, Julia, Kotlin, Lua, Objective-C, OpenGL Shading Language, Pony, Python, R, Ruby, Rust, Scala, Swift, Xojo LLVM Clang C, C++, Objective-C, Objective-C++
  16. C++ Ada Julia Swift JavaScript Objective-C Python IBM/360 Assembler Perl

    C# Haskell Ruby Pascal Turbo Pascal Clojure Java
  17. C++ Ada Julia Swift JavaScript Objective-C Python IBM/360 Assembler Perl

    C# Haskell Ruby Pascal Turbo Pascal Clojure Java
  18. C++ Ada Julia Swift JavaScript Objective-C Python IBM/360 Assembler Perl

    C# Haskell Ruby Pascal Turbo Pascal Clojure Java
  19. How to manage lib updates • do not manage •

    via Swift Package Manager: depend on private repo
  20. How to manage lib updates • do not manage •

    via Swift Package Manager: depend on private repo • via CocoaPods: Private Pod
  21. How to manage lib updates • do not manage •

    via Swift Package Manager: depend on private repo • via CocoaPods: Private or Local Pod • via Git Submodule
  22. Swift Package Manager Using GitHub Deploy Key Config file contents:

    GitHub.com → Your Profile → Repositories → Settings → Deploy Keys → Add deploy key → paste public key → check ‘Allow write access’
  23. Error type Check: Compilation error HEADER_SEARCH_PATHS Xcode doesn’t build subproject

    Implicit Dependencies in ‘Schemes’ should be checked Linker error 1. Is there a function with exact name? 2. Is is implemented? Xcode can’t find a built library LIBRARIES_SEARCH_PATHS Static library doesn’t work for simulator Use lipo tool to add missing architecture