Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
IAP auto renewable in practice
Next
Download to read offline and view in fullscreen.

Share

SwiftyJSON 慘痛經驗

Download to read offline

有一天客戶抱怨app 某頁 load 很久....
然後就寫了這一篇

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

SwiftyJSON 慘痛經驗

  1. 1. SwiftyJSON Hokila
  2. 2. star module parser
  3. 3. app load API response parse
  4. 4. 1. 2. api spec 3. parser
  5. 5. NSData Model
  6. 6. NSData ModelNSDictionary Objective-C
  7. 7. NSData ModelNSDictionary Swift
  8. 8. NSData Model Swift
  9. 9. NSData Model Swift [String:AnyObject]
  10. 10. NSData Model Swift [String:AnyObject] JSON
  11. 11. NSData Model Swift JSON
  12. 12. NSData ModelJSON SwiftyJSON Parser
  13. 13. SwiftyJSON
  14. 14. NSDictionary
  15. 15. parser 3
  16. 16. private func parseAndReloadUI(json:JSON){ let start = CACurrentMediaTime() let candidateItems = self.parseJSON(json) print("time parse = (CACurrentMediaTime() - start)") self.items = candidateItems self.reloadUI() }
  17. 17. private func parseAndReloadUI(json:JSON){ let start = CACurrentMediaTime() let candidateItems = self.parseJSON(json) print("time parse = (CACurrentMediaTime() - start)") self.items = candidateItems self.reloadUI() } time parse = 3.6
  18. 18. private func parseAndReloadUI(json:JSON){ let start = CACurrentMediaTime() let candidateItems = self.parseJSON(json) print("time parse = (CACurrentMediaTime() - start)") self.items = candidateItems self.reloadUI() } time parse = 3.6 time parse = 0.28
  19. 19. private func parseAndReloadUI(json:JSON){ let start = CACurrentMediaTime() let candidateItems = self.parseJSON(json) print("time parse = (CACurrentMediaTime() - start)") self.items = candidateItems self.reloadUI() } time parse = 3.6 time parse = 0.28 code
  20. 20. parser • as? SwiftyJSON • SwiftyJSON NSDictionary • parse node cache reuse
  21. 21. NSData ModelJSON SwiftyJSON Parser NSData ModelNSDictionary NSJSONSerialization Parser
  22. 22. • SwiftyJSON NSJSONSerialization • variable lazy 

  • ZheYu3

    Dec. 14, 2017
  • ChingYiuLee

    Oct. 11, 2017
  • ssuser777f9f

    Sep. 17, 2017
  • HaiFengKao1

    Apr. 15, 2017
  • allenlinli

    Apr. 11, 2017
  • ssuser975265

    Mar. 9, 2017
  • Danqphy

    Feb. 17, 2017

有一天客戶抱怨app 某頁 load 很久.... 然後就寫了這一篇

Views

Total views

2,702

On Slideshare

0

From embeds

0

Number of embeds

8

Actions

Downloads

18

Shares

0

Comments

0

Likes

7

×