Published inLevel Up Coding·Apr 25How to write concurrent code in SwiftIn a previous article, we learned how to request data from the web, handle JSON data, and make custom models using Codable. We also learned how to write a completion handler while making network requests. You can also learn how to use NSCache to cache or store temporary data and…Programming3 min readProgramming3 min read
Apr 4How to cache data in Swift using NSCacheWhen we develop apps for iOS, we need to perform heavy tasks such as loading images from the network, loading files, etc. It’s a very time-consuming task, which affects the performance of the application. Therefore, we cache or store temporary data for them and reuse them appropriately. Swift uses NSCache…IOS App Development2 min readIOS App Development2 min read
Mar 30How to use Property observers in SwiftIt’s a common pattern or technique in various programming languages when we want to perform some action when a value is changed. Property observers are used in Swift when we want to perform an action when the value of a property changes. …Swift Programming2 min readSwift Programming2 min read
Published inLevel Up Coding·Mar 22How to hit an API and parse json dataIn the world of apps, practically all apps use web services to get data from the internet. It enables user to send and receive data from the web. Swift uses URLSession to fetch data from the web and uses JSONDecoder to decode it. …Jsondecoder4 min readJsondecoder4 min read
Mar 7How to use enum in SwiftEnumerations defines a type for group of related values. Enumerations (enum) enables you to write code in a type safe way. Enum is very useful while defining common type of values. You don’t have to provide value while defining enum. Syntax You can declare enumerations with enum keyword. enum SomeEnumerations {…Swift2 min readSwift2 min read
Published inLevel Up Coding·Aug 5, 2022How to integrate AdMob to an iOS appYou successfully created an app and uploaded it to the app store. You want to finally reap the rewards of your work. You have a variety of ways to monetize your app, including the premium model and freemium. In the premium model, you can generate income through in-app purchases or…IOS4 min readIOS4 min read
Jun 15, 2022Optional unwrapping syntax in Swift 5.7Optional unwrapping is one of the most used patterns in iOS development. Swift 5.7 introduces new features included a new way to unwrap optional values using if let and guard let statements. It eliminates duplication to make writing and reading code easier. …Swift Programming2 min readSwift Programming2 min read
Published inMac O’Clock·Apr 13, 2021The closures in Swift are explained with examplesClosures are a difficult topic to grasp in Swift, but they are simple to grasp if well described. Closures are functional blocks that can be used or passed around in code. Closures are an old term that is identical to C and Objective-C blocks. Closures are similar to functions, but…Swift3 min readSwift3 min read
Published inMac O’Clock·Apr 10, 2021How to use guard in Swift to make your code more readableThe cleaner your code is, the easier it is to maintain — When your project becomes more complex, you’ll need to write more stable and simple code. Every line of code you write is important because the cleaner your code is, the easier it is to maintain. We’ll use the guard statement to help handle control flow in this post. The provided…Swift2 min readSwift2 min read
Apr 10, 2021How to implement app ratings and reviews in SwiftWhen creating an app, bear in mind that it is important to engage users and solicit input in order to enhance the app’s experience. Your app’s feedback and ratings will appear on the App Store, helping to boost sales and ensuring your app’s popularity. From iOS 10.3, Apple implements a…Swift2 min readSwift2 min read