Přejít k navigační liště

Zdroják » Zprávičky » API design na iOS

API design na iOS

Zprávičky Různé

Nálepky:

Matt Gemmell sepsal pravidla, která doporučuje pro tvorbu API komponent na iOS. Jedná se o těchto 25 pravidel (podrobně je najdete vysvětlená v Mattově článku):

  1. Use the local dialect
  2. Design decoupled
  3. Required settings should be initializer parameters
  4. Allow access to initializer parameters
  5. Comment your header files (including defaults)
  6. Get up and running in 3 lines
  7. A fat demo usually means a broken component
  8. Anticipate customisation scenarios
  9. More properties, fewer actions
  10. Use controls in your controls
  11. Convenient for you is convenient for me
  12. Magic is OK. Numbers aren’t.
  13. Limit ‘required’ delegate methods
  14. Design for accessibility
  15. Use semantic objects for parameters
  16. Enhance the API if semantics don’t fit
  17. Highlighting is interesting
  18. Optional methods aren’t a commitment
  19. Always say who’s talking
  20. Put distinguishing params first in query methods
  21. Put the sender first in notification methods
  22. If a convention is broken, throw it away
  23. Notifications follow delegate methods
  24. Be generous with notifications’ userInfo
  25. Test the hell out of it

Komentáře

Subscribe
Upozornit na
guest
0 Komentářů
Inline Feedbacks
View all comments

Enum a statická analýza kódu

Mám jednu univerzální radu pro začínající programátorty. V učení sice neexistují rychlé zkratky, ovšem tuhle radu můžete snadno začít používat a zrychlit tak tempo učení. Tou tajemnou ingrediencí je statická analýza kódu. Ukážeme si to na příkladu enum.