Coder Social home page Coder Social logo

sson's Introduction

SSon

A thing similar to a Gson Json -> Dictionary -> Class Model에 Mapping 하여 바로 사용할 수 있도록~!! Network 통신 후 Json을 Parsing 할 필요 없이 Model에 Mapping 되도록 만들었다. 실제 사용 예는 Sample에 나와있다.

  • @objcMembers or 필수 Variable에 꼭 @objc 붙일것 -> @objc var text: String? (Swift 4.0이상에선 필수)
  • 지원 타입 = String, String?, Int, Int64, Bool, Array[T], Dictionary[T:T], NSArray, NSArray?, NSDictionary, NSDictionary?
  • 사용 금지 타입 = Int?, Bool? (Objective-C -> Swift 타입으로 변경시 KVC 에러 발생)

Decodable

Swift 4.0에서 나온 Decodable을 사용하면 Sson을 사용할 필요 없이 바로 Model에 Mapping 할 수 있다.

Sson과 Decodable

Objective C와 병행해서 사용할려면 Sson이 낫고 Swift 만을 사용할려면 Decodable Protocol을 상속 받는것이 낫다..... Test 예제는 둘이 동시에 사용할 수 있도록 Decodable Wrapper를 만들었다...

sson's People

Contributors

wooky83 avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.