• Swift 5 replaces IntroSort with TimSort in the 'sort()' method

    When we hear the term ‘Sorting,’ the algorithms which come to our mind are quicksort, insertion sort, merge sort, bubble sort, heap sort, and other sorting algorithms. We would have used the method sort() to sort elements in an array, in our day to day programming tasks. However, have you ever wondered what algorithm does the method uses to sort the items in Swift? Before Swift 5, it was ‘Introsort,’ but after Swift 5, it is ‘Timsort.’ Timsort is a sorting algorithm, used in programming languages like Python, and Java. I am going to cover mostly about ‘Timsort’ in this article.

    Read on →

  • Generate URLSession code in Swift using Postman

    Almost every iOS developer would have had to make a network call from their app. Swift uses URLSession to make network calls. URLSessionTask includes DataTask, UploadTask, DownloadTask, and WebsocketTask (WebsocketTask is lately introduced in iOS13.0 check this article to know more about it.) I was testing a multipart data request API using the [Postman app.]https://www.getpostman.com/ The API worked, the file got uploaded, and the results came in. However, I needed to write the Swift code to make a multipart request from the iOS app. Writing code for data task can be simple, but the complexity increases when we write code for multipart requests. I was wondering whether Postman can generate the multipart data request code for me, turns out that it could!

    Read on →

  • Introducing URLSessionWebSocketTask - Native WebSocket implementation using Swift 5

    We all love WebSockets, don’t we? They have a vast range of applications such as chat applications, push notifications, and much more. I got excited when I stumbled upon “URLSessionWebSocketTask”. That’s right, in addition to data task, download task, and upload task, we have websocketTask! in URLSession. Websockets are now first-class citizens in the foundation framework. Before websocket tasks, we had to use third-party libraries like Star Scream or Socket Rocket, but it is not the case anymore.

    Read on →

  • Swift bit #4 - Swifty ways of typecasting objects

    Often we find ourselves in a situation where we need to check whether an object belongs to a particular class or not. For example, consider there is a UIView, and there are many subviews like UITextView, UILabel, and UIStepper. Now you have to find the UILabel from the parent view and change its text value. So how do we do that? Well, there are multiple ways of doing it.

    Read on →

  • Enabling 'Sign in with Apple'in developer account

    Sign in with Apple’ is an exciting feature announced in WWDC 2019. You must be wondering how to get started. Well, this article is about completed the configuration, Click here to know how to integrate ‘Sign in with Apple’ feature in your iOS apps.

    Read on →

  • Integrating 'Sign in with Apple' in iOS apps

    The WWDC 2019 gave us many features to look forward. One of the most exciting features and my favorite is the ‘Sign In with Apple’ feature in iOS 13. The users can sign in securely, and their privacy is guaranteed. Apple is holding up their biggest promise of privacy with this feature. It is available for web and other platforms as well. We will be exploring and learning the integration of ‘Sign In with Apple’ on different platforms in the upcoming articles. Now, let us get started with how we can integrate it into our iOS app.

    Read on →

  • Swift bit #3 — Unwrap optional values using for in loop

    One of the most widely used features in Swift are the optionals. Optionals are types that can hold either a value or a nil value i.e nil.

    Read on →

  • Swift bit #2 - Using Booleans the right way, in Swift

    Boolean is one of the most frequently used and simplest data type in any programming language.It is common to want to toggle the state of the boolean variable. So, we normally do it like this,

    Read on →

  • Swift bit #1 — Using “where” clause in “for in” loops

    We all would have written a piece of code similar to this, The usual way,

    Read on →

  • Humble beginnings

    Blogging has always been my favorite exercise. I started creating websites using Wordpress, PHP, and PHPBB nearly ten years back. After a point, I took the path of iOS development. I became an iOS developer. Learning things in iOS was challenging as well as it was fun at the same time. As I discovered new things, I thought, why shouldn’t I share my knowledge with other fellow developers? And this is the reason why I have started the blog. So much has evolved since then. With the introduction of new technologies and frameworks, there are so many ways to set up a website. The challenge is to select the right technology for the intended purpose. After doing in-depth research, I made up my mind to set up a blog using Jekyll. Yes, Jekyll powers ohmyswift.com. Thanks to the developer community, which helped me in choosing the right framework to set up my blog.

    Read on →