weak references

https://softwareengineering.stackexchange.com/questions/229287/what-use-is-a-non-zeroing-weak-reference weak reference – a reference that DOES NOT affect the reference count. Simply put, a weak reference is a reference (pointer, in Objective-C land) to an object which does not participate in keeping that object alive. Weak references are useful for things like avoiding retain cycles, but their utility is limited due to their […]

where to remove observer in swift

https://stackoverflow.com/questions/28689989/where-to-remove-observer-for-nsnotification-in-swift/40339926#40339926 https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Deinitialization.html

Swift automatically deallocates your instances when they are no longer needed, to free up resources. Deinitializers are called automatically, just before instance deallocation takes place. You are not allowed to call a deinitializer yourself. deinitializion in class hierarchy Superclass deinitializers are inherited by their subclasses, and the superclass deinitializer (parent) is called […]

AutoLayout, constraints, with xib/storyboards

A Beginner’s Guide to Auto Layout with Xcode 8 auto-constraints Why Auto Layouts? Say we put a label in the middle of our xib with “hello world”. If you run it in on different iPhone devices, the label will appear in different positions. This is because each device is a different size. If we were […]

loading and showing images for Tables and Collections in swift

https://github.com/DigitalLeaves/FlawlessTablesAndCollectionViews Flawless UICollectionViews and UITableViews https://medium.com/capital-one-developers/smooth-scrolling-in-uitableview-and-uicollectionview-a012045d77f Image flashes demo (The problem) no flashes demo (The solution) First, some background tableView:cellForRowAtIndexPath: and collectionView:cellForItemAtIndexPath: are called whenever a new cell has to be displayed The cells have an NSIndexPath[section-row] to identify its position. In order to get the NSIndexPath of the cell, use

There is an […]

Backstory on Unicode and UTF8

The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) All you need to know about memory is that it’s one large array. But one large array containing what? The array contains bytes. In computer organization, people don’t use the term “index” to refer to the array locations. […]