Posts

Showing posts from 2017

What's new in Xcode 9?

Image
1. Refactoring in Swift ðŸ”¨ Ahh finally! This is something I was expecting since as long as Swift has been around, and they finally delivered! Gone are the  Cmd + Shift + F  where you miss out on a few variable rename, or accidentally modify an unrelated one. Gone are the cut + paste + modify to extract methods. We finally have access to those! Although there’s still a long way for Xcode to offer advanced refactoring tools like JetBrains does today, it offers the most common ones like adding code snippets, extracting methods and variables, and global renaming which works with Swift, Objective-C and even Storyboard files. We have to start somewhere right? 2. Smarter Fix its ðŸ˜Œ Another nice improvement of Xcode are the smarter “Fix its”. Remember the time when you implement  UICollectionViewDataSource ,  CMD + Click  on it, and then copy paste the methods that you need from it? Well, with the new Xcode, you can get all of that with a sing...

Apple Event 2017

Image
1. No introductory remarks on politics   Play Video   2:53 Tim Cook honors Steve Jobs at first event in new Apple headquarters Tim Cook gave tribute to the man who preceded him during the Apple event September 12. (Apple) While chief executive Tim Cook used Apple's stage to defend the company's position last year during the high-profile legal battle with the FBI, there were no such remarks Tuesday. Cook has recently taken a vocal stance against anti-immigration efforts, and Apple has pledged to provide support to the company's DACA-status employees. 2. Watch Series 3 The new Apple Watch Series 3 is displayed during an Apple special event at the Steve Jobs Theater on the Apple Park campus. (Justin Sullivan/Getty Images) Apple unveiled its next-generation watch, the Series 3. The new Apple Watch, priced at $399, can be used for calling, messaging and streaming music from the wrist without being linked to an iPhone. The ope...

How to setup Xcode Swift Project to use LLVM C APIs

Image
What is LLVM? “The LLVM compiler infrastructure project (formerly Low Level Virtual Machine) is a “collection of modular and reusable compiler and toolchain technologies” used to develop compiler front ends and back ends.” —  Wikipedia This is what Wikipedia says about LLVM. What does it mean? In order to understand this, you should know very high-level picture of what is happening during compilation of Swift or any other programming language. Compilation Phases LLVM reduces the effort to make a compiler lot easier by abstracting optimization, code generation etc. LLVM Intermediate Representation (LLVM IR) is the one which makes it popular. LLVM IR is a machine independent representation which can be later converted to instruction for targeted architecture like x86, arm etc. Many popular programming languages like Swift, Objective-C, Haskell, Rust, Julia uses LLVM under the hood. Refer this video for more information related to LLVM Why should I use LLVM ...

Implementing delegates in Swift

Image
So, what are delegates? …in software development, there are general reusable solution architectures that help to solve commonly occurring problems within a given context, these “templates”, so to speak, are best known as design patterns. Delegates are a design pattern that allows one object to send messages to another object when a specific event happens. Imagine an object A calls an object B to perform an action. Once the action is complete, object A should know that B has completed the task and take necessary action, this can be achieved with the help of delegates!      For a better explanation, I am going to show you how to create a custom delegate that passes data between classes, with Swift in a simple application, start by downloading or cloning this   starter project   and run it! You can see an app with two classes, ViewController A and ViewController B. B has two views that on tap changes the background color of the ViewController, ...