Getting Started with Search APIs and SFSafariViewController in iOS 9

With iOS 9’s public launch earlier this week, it’s never been a better time to understand how to take advantage of the new and exciting APIs!

When Apple Senior Vice President Craig Federighi announced Search APIs at WWDC 2015 in June, many extolled them as the most powerful feature in iOS 9.

Search APIs offer an exciting new way to interact with users. With iOS 9, Apple has optimized Spotlight with incredible new features that indexes more content than ever. For instance users can fire up spotlight to search web content or data deep within apps. Using popular keywords they can easily access apps (even if they’re not certain the name of the app)! Search APIs help you do this.


Search in iOS 9 will be a major feature for developers. With the release of iOS 9, it’s never been a better time to jump on. Apple’s never been known to be big in the search engine industry, but with Search APIs in iOS 9, that might be about to change!

[Read more…]

Beginner’s Guide: Using Social Framework and UIActivityViewController

So, you are just about to get finished with the new super-app of yours, or the one that your boss or a customer have asked you to make, and you realize that there’s one more important requirement, to make it capable of posting content to Facebook or Twitter. You are a breath away from the deadline, and after having spent endless hours in implementation you find it too hard, or even objectively impossible, to stay in front of your computer several more hours in order to integrate the Facebook or Twitter SDK. So, what are you supposed to do? Maybe it’s time to start thinking of twenty or more different excuses that you will use when you’ll tell your boss or the customer that you are not going to deliver the app? Maybe it’s time to start sweating or feeling suffocated? Or, on the other hand, there’s a nice and easy way to add sharing capabilities to your application in no time at all?


Well, my dear readers, hoping that nobody will ever find himself or herself to that awful situation that I just described, it indeed exists a wonderful and quick solution to that problem. Actually, this solution has a name, and it’s called Social framework, embedded in the iOS SDK. It’s quite possible that many of you have already worked with it, however, I’d bet that there are also many developers that are not aware of that framework and how to use it in order to add sharing features to an app in just a few minutes! Literally!

As you all know, Apple has added the option to post to Facebook and to Twitter as a built-in functionality in iOS since a long time ago. Obviously, it’s good enough to do the basics, but definitely you need to use the proper SDKs if you want or need to add more advanced operations to your app. In this tutorial though this is not the case. We’ll focus on the first one, and to be precise, we’ll focus on how to use the built-in post capabilities that iOS supports straight into our own application. As we are about to see next, all we’ll do is just to use the Social framework so the default post view controller become available in our demo app, and all the rest will be left to be handled by iOS. We won’t deal at all with aspects like getting logged in, acquiring authentication tokens, creating custom views, etc. Putting it simply, we will grab a “black box”, we will assemble it along with the rest of the code, and we’re good to go.

[Read more…]

How To Create a Custom Search Bar Using UISearchController

Quite often it’s required from iOS applications to be capable of performing search in specific data that is displayed in a tableview. Undoubtably, most of developers have faced that situation, and the most usual approach to that is to use the default controls that the iOS SDK provides. Up to iOS 8, Apple was providing a special control for performing searches in tableviews named UISearchDisplayController. This controller, in conjunction with the UISearchBar was making possible to add search features quite easily in an application. Nevertheless, this belongs to history now.

Since iOS 8 coming, things changed a bit. First of all, the UISearchDisplayController has been deprecated, even though it’s provided as an available control in the Interface Builder’s controls collection in Xcode. A new controller named UISearchController has been given in its place. In spite of this change though, no visual control exists for it in the controls collection in Interface Builder; instead, it must be initialized and configured programmatically, but this is a really easy task, and you’ll see that later on.


Besides all the above, there’s another interesting point regarding the searching in a tableview datasource. iOS SDK provides a predefined appearance for the search bar, and that bar is suitable in many cases. However, when the UI of the app is highly customized, then it’s quite possible the default search bar format not to fit in the whole look and feel of the app. In that case the search bar must be customized appropriately so as to be a non-distinguishable part of the app ecosystem.

So, having said all the above, it’s time to present shortly what this tutorial is all about. I could say that through this text I’m aiming in two things: My first goal is to demonstrate how the new UISearchController presented in iOS 8 can be used so it’s possible to search and filter data using the default iOS search bar. You’ll see through the sample code we are about to write that configuring it it’s an easy process, regardless the fact that a visual control in the Interface Builder doesn’t exist.

[Read more…]

Building a Simple Weather App using JSON and WatchKit

Editor’s note: This is a guest post by Gregory Tareyev, a co-founder and iOS developer of Chill (, the first wearable communication tool that lets you interact with your friends with a tap. In this tutorial, Gregory will share his experience on Apple Watch development and show you how to build a simple weather app using a third-party API and WatchKit. We have written a couple of tutorials about WatchKit. All of them are in Swift. Some readers mentioned if we can provide a tutorial in Objective-C. So here it is.

Enter Gregory’s tutorial.

Hello everybody! My name is Gregory Tareyev ( for any contacts). I am a co-founder and iOS developer of Chill (, the first wearable communication tool that finally makes sense. Recently we had a great experience on launching Chill on Product Hunt which gave us a lot of visibility in the community and attracted major tech blogs to cover the release. We are also discussing our involvement with a few accelerators and considering the best one. We worked really hard to build the app, but I assure you that everybody can do something like that.


Here, I want to share some experience on the app development for Apple Watch. It’ll be easy and fun.

[Read more…]

An Introduction to Stack Views in iOS 9 and Xcode 7

Earlier, we’ve talked about the new features of Swift 2. Starting from this tutorial, we will cover some cool new features in iOS 9. The upcoming version of iOS comes with a lot of new features. For developers, the introduction of Stack View deserves the first mention. I know some developers find it difficult to use auto layout to design complex user interfaces. Stack views are here to help and make our developers’ job much easier.

The stack view provides a streamlined interface for laying out a collection of views in either a column or a row. For views embedded in a stack view, you no longer need to define auto layout constraints. The stack view manages the layout of its subviews and automatically applies layout constrants for you. That means, the subviews are ready to adapt to different screen sizes. Furthermore, you can embed a stack view in another stack view to build more complex user interfaces. Don’t get me wrong. It doesn’t mean you do not need to deal with auto layout. You still need to define the layout constrants for the stack view. It just saves you time from creating constraints for every UI element and makes it super easy to add/remove views from the layout.

Stack View Introduction

Xcode 7 provides two ways to use stack view. You can drag a Stack View (horizontal / vertical) from the object library, and put it right into the storyboard. You then drag and drop view objects such as labels, buttons, image views into the stack view. Alternatively, you can use the Stack option in the auto layout bar. For this approach, you simply select two or more view objects, and then click the Stack option. Interface Builder will embed the objects into a stack view and resize it automatically. If you still have no ideas about how to use a stack view, no worries. We’ll go through both approaches in this tutorial. Just read on and you’ll understand what I mean in a minute.

[Read more…]

Creating a Slide Down Menu Using View Controller Transition

Navigation is an important part of every user interface. There are multiple ways to present a menu for your users to access the app’s features. The sidebar menu that we discussed in the earlier tutorial is an example. Slide down menu is another common menu design. When a user taps the menu button, the main screen slides down to reveal the menu. If you have no idea about how a slide-down menu works, no worries. Just read on and you’ll see an animated demo.

Before showing you how to implement the menu, this tutorial assumes that you have a basic understanding of custom view controller transition. For those who are new to view controller transition, you can check out this beginner tutorial written by Joyce.

Okay, let’s get started.


[Read more…]

A Swift Tutorial for Stripe: Taking Credit Card Payments in iOS Apps

In this tutorial we will talk about Stripe integration. Stripe provides one of the most powerful libraries for accepting payments online and mobile apps. If you are planning to sell products in your iOS apps and searching for a payment solution, Stripe should be on the top of your list.

I get asked a lot about why iOS developers need to use Stripe rather than In-App Purchase. According to Apple, you’re required to use In-App Purchase to sell digital content such as extra game levels for your game, and bonus content for your apps. For physical goods like clothing, you’re allowed to use other payment solutions such as Stripe. So, in this tutorial, I will give you a brief introduction of Stripe, explain how it works and show you how to build a demo app using Stripe’s API for accepting credit card payments.


[Read more…]

Building a Video Search App with YouTube API

It’s a well-known fact that Google provides a big number of electronic products and services that can be used from the simplest end-user, to the most sophisticated one. But further than those who just use the Google services as they’re provided, there are people who need to have a different kind of access to them; developers. Indeed, Google gives great assistance to developers of all kind to create multi-platform applications that use their services, as it provides various Application Protocol Interfaces (APIs) that can be used in many ways, as well as already-made libraries and SDKs for various programming languages.

As the Google APIs and services can be utilized in mobile platforms as well, apparently we could not just be left uninterested here, and as a matter of fact, we’ve already dealt with Google technologies in the past. For example, here’s a tutorial about the Google Maps SDK. Now, in this tutorial, we’re going to see for first time a totally different service, the YouTube API.


Working with that specific API is fairly easy, but there are a few certain aspects you should already know about, otherwise your life could become a bit difficult. Let me give you some clues: First of all, we won’t use any SDK, or iOS-specific library. Instead, we’ll make simple HTTP requests (GET requests actually) to fetch data from Google. The results are in JSON format, so it’s required you already know how data is formed in JSON. You don’t have to be a JSON expert; just to understand the format. If you need assistance, here you can find some valuable information.

The Google documentation regarding the YouTube API is really big, so my intention here is to gather information from various pages into one place and help you get started with this API fast and easily. Even though we are about to cover just a small portion of the YouTube API, what you will learn will show you the way for the rest of it. However, I have to mandatorily mention a few facts before we continue.

[Read more…]