Try   HackMD

New Life for Your Product - Mars

所有議程請見議程表

歡迎來到 https://hackmd.io/@iPlayground/2019 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

點擊本頁上方的 開始用 Markdown 一起寫筆記!
手機版請點選上方 按鈕展開議程列表。

請從這裡開始

YouTube

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Slide

Annoying Hybird codebase

  • becuase powerful swift
  • Hybird with Objc, there are many feature couldn't use well

Objc Virus

  • 寫大一堆 @objc 橋接關鍵字
  • 會污染到整個 codebase
  • 用 Adapoter 處理
    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

solution

the MVX family

  • MVP
  • MVVM
  • VIPER
  • VIP
  • etc.

The Clean Architecture

  • 實作由內而外
    -> Core: Pure Swift -> 程式核心
    -> Adapter : 橋接inputs , outputs
    -> MVX: Objc -> 利用架構產生外部接口
    可參考PromiseKit的實作方式,他利用_AnyPromise層橋接Pure swift <-> Objc的部分
    https://github.com/mxcl/PromiseKit

  • 用 Coordinator Pattern 作為 Swift 跟 Obj-C 之間的 Adapter

  • UI Componet(view) = a MVC
    Child View Controller

  • How to handle "Intent" in view
    NotificationCenter

Summary

If you want to create a Swift-ObjC hybrid project

​​​​* Create major function in `Pure Swift` at first 
​​​​* Use `@objc Swift Adapter` for interface (reference PromiseKit)
​​​​    * 先實作一個可以給swift B用的pure swift A
​​​​    * 當objc C需要用到swift A時,再實作一個橋接的@objc Swift D
​​​​* Use `Coordinator` pattern for UI flow

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Reference

Session

  • Nelson:漫談 iOS 架構:MVC / MVVM / VIPER 與 Redux
  • 黃惠勤:從 MVC 到 MVVM,再到 MVVMC 的開發經驗分享
  • d_date: Integrate your app to modern world

Coordinator

UI Component

Clean Architecture

Sample Code

Statistics

tags:iPlayground2019