Sound, AVAudio, iOS11, Swift 4.1, Swift 3.0, Tutorial, Tips, Audio File, Audio Playing audio file on iOS in Swift 4 Playing media file in apps is fun. Media usually puts constraints on system resources, but it is ok to indulge in fun once in a while. In this post we will see how
Xcode 9, Swift 3.0, Swift, Tricks, Tips, Tutorial, Xcode Preferences Random Xcode Trick Despite my regular rantings on Xcode and Apple software, I still love them. In past few years, I have used so many IDEs and trust me, Xcode is one of the best I
Regular Expressions, Swift 3.0, iOS, Swift 4.0, RegEx, Example, Demo Regular Expressions in Swift and iOS I didn't actually plan on writing this post. However, things didn't go as I expected them to go. Today I was helping someone with Regular Expression which I thought was my forte and
Swift 3.0, Swift, map, flatMap, First class functions, Functional Programming, Functional, Functional Swift, for-loop Functional magic with Swift Last few days I have been experimenting with functional magic in Swift. Especially how map and flatMaps work. I was so amazed to know how hassle-free my life became after I understood and
UIKit, iOS, Swift 3.0, Tutorial, Tips, UILabel, AutoLayout, Dynamic, Resize, Dynamic height, Dynamic width Using Autolayout to Dynamically Resize UILabel We all love Autolayout, don't we? I had a less than ideal experience with it when I started. However, after continuous practice and reading a Book - iOS Auto Layout Demystified I got
iOS, Swift 3.0, VIPER, Architectures, iOS Architectures, Example, Examples, Github Writing an app with VIPER architecture - Part 2 I have written a part 1 of writing an iOS app using VIPER architecture. This covers fundamentals and basic example of using VIPER, creating models, entities and utilizing them in the app. This
MVVM, iOS, Swift, Swift 3.0, Xcode, VIPER, Architectures, iOS Architectures Comparing VIPER vs. MVVM Recently I started playing with VIPER architecture. Although I was quite hesitant trying it out, it turns out it's not all that bad as I expected. It'e certainly better than traditional MVC iOS
Touch, Authentication, iOS8, Swift, Swift 3.0, App, Touch ID, iOS 8, Credentials, Password, Demo, Example, Tips, Github Touch ID Authentication in the app Today I am going to write about implementing and using Touch ID authentication in an iOS app. Touch ID authentication API was introduced in iOS 8 release. It is a part of LocalAuthentication
Core Data, Migration, Swift 3.0, attributes, Persistency, Database, Core data migration Core Data Migration - Part 2 (Removing Attributes) Disclaimer: I have taken a code example to show how to migrate data from Migrating a data model with Core data. So if you are interested in learning more about core data, please
Objective-C, Swift 3.0, Tips, available, attributes, attribute, hidden gems How to use @available attribute in Swift Today I am going to write about attributes that Swift offers. Attribute is nothing but the construct which provides more information about declaration or type. As long as this blog post is concerned,
Swift 3.0, Operators, Protocols, Downcasting, Upcasting, Casting, protocol conformance, Swift Swift 3.0 - What's is, as, as? and as! operators? We all have been there where language offers plethora of options. However, I have quite experienced that bunch of features sometimes cause confusion even though individual feature is easier to understand. When all
Swift 3.0, Closures, Tips, Tricks, autoclosure, @autoclosure, Closure, escaping, non-escaping What is @autoclosure in Swift? It's on very rare or never occasion that I have ever used a @autoclosure keyword while passing a closure to method - A closure which takes no parameter and returns a value (No
iOS, Interview, Questions, Interview Questions, Technical Question, Swift 3.0, Objective-C, Development, Senior, Principal, Checklist, New Job List of Interview Questions for iOS Developers Over the years of iOS development has taught me some interesting facts about Objective-C and Swift. Some of them I learned from my own experience and most of them either from senior colleagues
Speech Recognition, iOS10, Siri, Swift 3.0, Github, Open Source, Wrapper, Speech Wrapper for Siri Speech Recognition using iOS and Swift 3.0 Apple introduced the Speech framework, an useful API for speech recognition for iOS 10 in 2016. It is one of the few things to get fascinated by the new iOS release. Earlier I
iOS, iOS10, Wrapper, Github, Open Source, API, Apple, Tutorial, Tips, Swift 3.0, 3D Touch Wrapper for 3D touch preview implementation using Swift 3.0 It's been a while since I started working on 3D touch implementation on iOS 6s Plus devices. Luckily, even through it's a hardware feature iOS simulators still supports simulation of 3D touch of
iOS, JavaScript, Swift, UIWebView, Swift 3.0, Callback, delegate iOS - Communication from Javascript to iOS This is the second part of two series article. You have already read the first part which shows how to transfer data from iOS to JavaScript. In this part we will see how
JavaScript, Web page, UIWebView, Swift 3.0, iOS, InterApp iOS - Communication from iOS to JavaScript This is the first part of a series about communication between iOS and JavaScript. In this part we will see How to call JavaScript functions from iOS How to get return value of
Apple, Swift 3.0, Tutorial, Tips, Xcode 8.2.1, Xcode, Recursion, enums, Indirect Enums Indirect enums - Swift 3.0 Enums are one of my favorite parts in any language. With Swift they've got extra functionality such as adding functions, associated values and Indirect Enums. So what are indirect enums? I have learned
Swift 3.0, Custom Operators, Tutorial, Tips, Equality, Comparison, UseYourLoaf, WeHearSwift, Sorting, Swift, Xcode, Operators, Equatable Equality and Comparison with custom objects in Swift (Equatable protocol) Few weeks ago I ran into frustrating problem. I was dealing with custom objects in Swift. (Actually struct with properties). They were being stored in an array. Now, this array was going to
Swift 3.0, Xcode 8.2.1, Tips, Tutorial, Custom Operators, Beauty, Programming, Function Overloading, Associativity, BPL Beauty of Swift Today I am going to talk about couple of Swift tricks I learned recently. First one is about operator associativity and how Swift handles it gracefully to error it out during compile time
iOS, Swift 3.0, Xcode 8.2.1, Xcode 8.2, Custom Operators, Advanced Swift, Tutorial, Swift, Infix, Postfix, Prefix, Generics, Operators Custom Operators in Swift with Generics Swift introduced us a new era of custom operators. Unlike Objective-C, it will allow us to define our own operators and perform operator overloading if necessary. Although I haven't come across such use
iOS, Swift 3.0, Xcode, iOS10, UIKit, Github, Demo, Tips, Example, Crater, Hole, UIView, CALayer Making a crater in UIView with CALayer Although title sounds horrible, believe me - It's not that bad. This is a trick I learned from StackOverflow post. Although seemingly innocuous, it took me a while to figure out given the
iOS, Swift 3.0, Error Handling, try, Try-catch, Unit Tests, Unit-testing, Testing try-catch Blocks and Unit Tests - Swift 3.0 In the last post I wrote about implementing error handler in Swift 3.0 using try-catch block technique. In this post I will go over how to unit test it. Since we all
Swift 3.0, Try-catch, Tips, iOS, App, Error, Error Handling, try, catch try-catch blocks - Swift 3.0 Today, I will try to go through some of the error handling techniques Swift uses. As we all know, the standard way to report error in Objective-C is passing an error pointer such
Swift 3.0, Tutorial, Tips, Tail Recursion, Recursion, Optimization Tail Recursion Optimization Recently I came to know about amazing concept of tail recursion optimization. If you are a computer scientist, you must be knowing what recursion is. It is a function calling itself multiple times