Microblogging for devs
This is a safe space to dump everything you have learned in bite-sized chunks.
Popular topics 🔥
Latest posts
Principle of least astonishment (POLA): When designing an interface (a component, an API), always design it in a way that the user will expect it to behave. When creating a toolbar view it should ONLY contain functionality of a toolbar view, and not say, also handles logic to show a Settings view.
Principle of least astonishment (POLA): When designing an interface (a component, an API), always design it in a way that the user will expect it to behave. When creating a toolbar view it should ONLY contain functionality of a toolbar view, and not say, also handles logic to show a Settings view.
Likewise, l10n is called l10n because l_ocalizatio_n has 10 letters between l and n.
Likewise, l10n is called l10n because l_ocalizatio_n has 10 letters between l and n.
Fun fact, the reason why i18n is called i18n is because there are 18 characters in between i and n: i_nternationalisatio_n!
Fun fact, the reason why i18n is called i18n is because there are 18 characters in between i and n: i_nternationalisatio_n!
Every IOS app should be usable by everyone. Accessibility in IOS is done through Screen Readers. So placing accessibility modifiers **intentionally** matters a lot. To do so, use the .accessibilityLabel and .accessibilityHint modifiers on your views to modify what the screen reader would read.
See full code
Every IOS app should be usable by everyone. Accessibility in IOS is done through Screen Readers. So placing accessibility modifiers **intentionally** matters a lot. To do so, use the .accessibilityLabel and .accessibilityHint modifiers on your views to modify what the screen reader would read.
See full code
@EnvironmentObject is like React's context provider. Rather than passing down data across view hierarchies (prop-drilling in React), we can define it once and access it across child views. The example below shows how to initialise and share CoreData's viewContext on load:
See full code
@EnvironmentObject is like React's context provider. Rather than passing down data across view hierarchies (prop-drilling in React), we can define it once and access it across child views. The example below shows how to initialise and share CoreData's viewContext on load:
See full code
ArrayList or a Linked List? It depends. If you're doing stack-like operations, both will be fine. ArrayList might be slightly better because it offers indexing at constant time cost. Queues with ArrayLists are bad, because we'll have to shift every item whenever we enqueue or dequeue.
ArrayList or a Linked List? It depends. If you're doing stack-like operations, both will be fine. ArrayList might be slightly better because it offers indexing at constant time cost. Queues with ArrayLists are bad, because we'll have to shift every item whenever we enqueue or dequeue.