iOS How to get the iOS App Metadata in Swift Working on a new app could be exciting. However, there are certain things or information which you might want to get as a part of the core feature. One of them is the
Swift When to weakify Today I am going to talk about one of the discussion prone topics on iOS platforms. Detecting memory leaks and when to apply weakify. The topic came up while I was recently performing
Monty-Hall problem Visualizing Monty-Hall problem Today, I am going to write about the Monty-Hall problem simulation I ran programmatically. What is this Monty-Hall problem you may ask? According to Wikipedia, The Monty Hall problem is a brain teaser,
Swift Closure Trick in Swift Today I learned a closure trick in Swift. Usually when expression is assigned to a variable on left, it is evaluated instantly. For example, let value = complexCalculation() func complexCalculation() -> String { return
MVVM 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
Apple 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 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
iOS 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
Swift 3.0 Pass data with iOS Notifications - Swift 3.0 We all have used Notifications on iOS. (I would not call them NSNotifications though, since this post is about Swift 3.0). I used them long ago when I was yet a newcomer.
Swift Swift - Testing singletons In this post we will see how you can test swift singletons easily. Disclaimer: I haven't discovered it myself, but I found it a while back on StackOverflow while looking for how to
Swift Swift testing with protocols In this post, we shall see how protocols work with unit testing. Say, you have a downloader class DownloadFileClass for fetching network data. It follows the protocol DownloadFileProtocol. The whole class and protocol
Xcode Search and Replace in Xcode with Regular Expressions Recently I ran into problem where I wanted to search a pattern through project and replace it with another one. In the past I have really hard time dealing with Regular expressions. This
iOS Manually scrolling UIScrollView (iOS/Swift) Recently while working with one of my libraries, I realized that I wanted to manually scroll UIScrollView in any direction. (Viz. Top, Right, Bottom, Left). It took me quite time to find examples
Swift Debugging iOS Autolayout (iOS/Swift) Last week I had weird issue while applying autolayout rules to UITableViewCell. TableViewCell has two components attached to it. An UIImageView Two variable length UILabels stacked vertically on the top of each other
Objective-C Thinking MVVM way with Objective-C Today I am going to write about one of my most favorite iOS patterns lately. MVVM (Model-View-ViewModel). They say MVC has been in iOS realm for quite a bit. However, if you ask
Tutorial Simulate View Controller Transitions - iOS/Objective-C We all have dealt with push transition of UINavigationController as well as presentViewController and dismissViewController transitions of typical UIViewController. However, today we will learn how to emulate the transition from one viewController to
iOS iOS Add spacing to line of text - Swift This week while working on one of our internal apps (Again), I came across an interesting problem to add spacing to line labels. I never knew iOS could do it. My first and
iOS Add image to UILabel with Swift (iOS) This week while working on one of our client apps I came across interesting problem of embedding images with text. To give a little idea, we wanted to display text somewhat like emojis
Xcode Xcode - Quickly fix the fixable errors Today I am going to write about a neat trick I learned about automatically fixing fixable error in Xcode. We usually come across the error which are easily fixable. These include typo'ed method/
Xcode Swifty UITableViewController with generics and structs Disclaimer - This post along with code supporting is inspired by Chris Eidhof's talk at trySwift. I took the liberty to slightly update the code as per my own logic. There is no
iOS iOS Testing - Testing asynchronous code (Part 4) This is the part 4 in the series of articles on 'Unit Testing on iOS'. Below is the list of all articles and respective links to them. iOS Unit Tests - Testing models
iOS iOS Unit Testing - Switching method implementations with OCMock (Part 3) This is the part 3 in the series of articles on 'Unit Testing on iOS'. Below is the list of all articles and respective links to them. iOS Unit Tests - Testing models
AutoLayout Debugging Autolayout issues in the Xcode With the release of new iPhone devices in addition to older models iPhone4 and iPhone5, we developers are all forced to switch to autolayout instead of using manual frames to update view layout.
Objective-C Using NS_DESIGNATED_INITIALIZER with Xcode6 One day I was working on one of my side projects. I came to know about NS_DESIGNATED_INITIALIZER Apple introduced in Xcode6. When you have choice of multiple initializers and still you
iOS iOS UI Testing with Fastlane snapshot tool This week I played a little bit with UI testing on Xcode. This goes without saying that I had to go through some ordeal. (More about it in later paragraphs) So the app