#ios_tip_for_today
Have you ever wondered what is the difference between UITextView / UITextField ?
#simple digram shows where and when you better use each of them
๐.
#ios#xcode
In the Foundation framework we have an NSCache class which acts as a Dictionary but also encapsulates a logic of purging its content after reaching the max elements.
Hereโs the example of using NSCache to construct in-memory image cache for your application.
Only few can guess right ;)
Do you know what will happed if you tried to present an alert with two cancel buttons?
Tell me your guess before trying it on xcode.
Learn how you can use the incredibly powerful image manipulation frameworks on iOS to use image depth maps with only a few lines of code in our newly updated Image Depth Maps Tutorial for iOS: Getting Started! https://t.co/bfVQFpKOYH
๐ก #SwiftTip: Using Result<T, Never> to represent impossible code flow
Set Result.Failure type to Never in case error is impossible or can be replaced with a value.
The compiler is smart enough and does not require us to handle the failure case in the switch statement.
New Basics article about a heavily requested topic: Protocols! ๐
Using protocols to reduce code duplication, creating protocol-based abstractions, and extending the standard libraryโs protocols โ all with many examples and an attached playground ๐
https://t.co/JPnCQLIy6o
Specification pattern to handle boolean logic, this example to handle single input have a two regex pattern for a phone number or email address.
Credit: @almasri_ahmed
I highly recommend the following book.
This is in regards to penetration testing of the applications & the phone but you can use the same knowledge to write secure code for your applications. https://t.co/bNdKXqfdqK