Ilker Furkan Kahyalar

Ilker Furkan Kahyalar

Software Engineer


Home

Podcast

Projects

References

Contact


Subscribe


TIL - 20 January 2021

Hello everyone! Let’s take a look what I learned in 20 January 2021, shall we?

#1 - Weak self and unowned self explained in Swift

Source: https://www.avanderlee.com/swift/weak-self/

“Reference counting applies only to instances of classes. Structures and enumerations are value types, not reference types, and are not stored and passed by reference.”

weak references are always declared as optional variables as they can automatically be set to nil by ARC when its reference is deallocated.”

“For many of us, it’s best practice to always use weak combined with self inside closures to avoid retain cycles. However, this is only needed if self also retains the closure. By adding weak by default you probably end up working with optionals in a lot of cases while it’s actually not needed.”

“Property observers aren’t called when ARC sets a weak reference to nil.”


#2 - print() tricks

Source: @tiborbodecs

# Default seperator between words is space " "

print("kebap", "case", separator: "-")
// kebap-case

print("kebap", "case", separator: "-", terminator: "->")
// kebap-case->

Other Findings

Today about SSL Pinning, I found two great sources, will take more time to go through them:

  1. Securing iOS Applications with SSL Pinning by Batuhan Saka
  2. Identity Pinning by Apple

Closing Notes

I hope you liked what you heard and I am really looking forward to seeing you in the next one!

  • Keep up to date and follow @kahyalar.xyz on Instagram. DMs are always welcome! 🔥

  • You can reach out to me via Contact Form, Email and social media icons in the left. 💌

Buy Me A Coffee

Until next one,
Furkan