Integrate Google Sign In on MacOS App in Swift


As an iOS developer, you might have chances to write applications on Mac os. And sometimes, your applications require users to authenticate before they can use your app. Enabling Google Sign in helps you save a lot of time to implement authentication flow. Unfortunately, it is a lack of documentation on how to integrate Google Sign in on Macos app, particularly in Swift. I once had a chance to implement this feature to my app. Now I want to share with you how we can do it. Let’s get started.

Read More

Crash early in Swift


Last night, I read a chapter of a book as one of my favorite books: "The pragmatic programmer" (By Andrew Hunt and David Thomas). This chapter discusses how to use assertion to make the code easier for debugging. We all know that assertion is an essential tool for writing tests, but It does more than that. Let’s go with me to meet this guy: Assertion.

Read More

ANCS: Apple Notification Center Service

Preface

ANCS, stands for Apple Notification Center Service, is designed by Apple. It allows Bluetooth accessories that connect to iOS devices via BLE a simple way to access notifications that happend on iOS devices.

Read More

Big Endian vs Little Endian


In computer science, a bit is the smallest piece of information. It represents a digit of the binary numeral system. A string of 8 bits called a byte. There are two ways to store a string of data in computers: Big Endian and Little Endian. If your tasks are working with data in a piece of bytes, you ought to know how to deal with bytes in these two formats. In this post, I will explain how data is stored in computers, what are the main differences between these two, then provide some useful code to work with bytes in Swift and Objective-C.

Read More

Asynchronous Programming in Swift

Promise Kit, one of the best frameworks to deal with asynchronous programming in Swift

In this post, I will use these following third parties to complete the project:

  • Alamofire: A HTTP networking framework in Swift.
  • SwiftyJSON: To process JSON data.
  • SwiftGifOrigin: An UIImage extension to display Gif files.
  • Bolts-Swift: Was designed by Parse and Facebook, I use it to create asynchronous methods.
  • PromiseKit: A framework helps us to simplify asynchronous programming.
  • Giphy’s APIs for searching and downloading gif images.
Read More