When you start building apps in Swift or SwiftUI, you’ll often hear the term “Copy-on-Write” — or CoW for short. It sounds fancy, but the idea is actually very simple and smart. Let’s break it down. Swift uses value types like struct , Array , Dictionary , and String . Normally, when you copy a value type, you’d expect it to create a new copy in memory. But copying big data every time can be slow and wasteful. So Swift uses a trick called Copy-on-Write — it pretends to copy the data, but it doesn’t actually do it until you change something. var numbers = [1, 2, 3] var moreNumbers = numbers // No real copy yet! moreNumbers.append(4) // Now Swift makes a real copy here. At first, both variables share the same data. Only when you modify moreNumbers, Swift creates a separate copy so that the original numbers stays safe. This is how Swift gives you safe, independent data but still keeps things fast and memory-friendly. How It Connects to SwiftUI Now he...
Long waiting is over. !! iOS 12 brings Autofill for OTP text field which is close to Android provided a decade back. Previously in iOS we used to toggle between OTP text screen and message inbox. Which was hard to remember and time consuming resulting a bad user experience. Personally, I have been asked from the client/customer couple of times to implement autocompletion for OTP field and took me a lot of time to convey that it is not possible in iOS. Why Autofill was not possible previously? We all know that Apple gives at most care for user privacy. When we see iOS architecture, each individual app is like a separate island. There is no inter-app bridge between apps (exception for Keychain and URLSchemes APIs which gives very limited scope). Thus we cannot read message content from inbox. Where to start Autofilling? First of all, the target SMS need to have the OTP Code with prefix string "Code" or "Passcode"on its message content. Beware of OTP c...