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 tonil
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:
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. 💌
Until next one,
Furkan