Fresh Beginning
  • Home
  • Speaking
  • Reading
  • Github
  • Alma Mater
  • Contact

Tips

A collection of 69 posts

Travel, Tips, Experience, Europe, USA

Useful Travel tips from my experience

I have been traveling quite a bit recently. It's generally for tech conferences, business visit, or visiting a family overseas. After all the travel in last 8 years I have learned so many

  • Jayesh Kawli
6 min read
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

  • Jayesh Kawli
3 min read
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

  • Jayesh Kawli
1 min read
Swift 4.0, Objective-C, Swift, Tips, Tricks, structs, classes, variables, Bridging header

Using Swift variables in Objective-C : Swift 4 Edition

Today I ran into weird problem which prompted me to write this blog post on Objective-C and Swift interconnectedness. Before Swift 4 came along, the sure way to access Swift variables in Objective-C

  • Jayesh Kawli
2 min read
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

  • Jayesh Kawli
6 min read
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

  • Jayesh Kawli
4 min read
Swift, Objective-C, Interaction, Interoperability, Bridging header, generated header file, gap, Bridging, Mix and Match, MixMatch, Github, Example, Tips, Gotchas

Swift and Objective-C Interaction

In this post I am going to write how you can use Swift code in Objective-C and vice versa. I have run into this problem multiple times and every time I hit the

  • Jayesh Kawli
4 min read
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,

  • Jayesh Kawli
4 min read
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

  • Jayesh Kawli
3 min read
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

  • Jayesh Kawli
4 min read
JavaScript, Tips, Tricks, Tutorial, Web page, Live Editing, Browser, Chrome, Google Chrome, WebPage

How to live edit any webpage

I learned this trick to edit any web page on the fly long time ago. It was fun in the beginning and good technique to prank friends. With this technique when you type

  • Jayesh Kawli
2 min read
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

  • Jayesh Kawli
2 min read
Github, Mac OS X, Tips, Tutorial, Git, Gitignore, Ignore, Global, Gitlab

Using Global .gitignore on Mac

If you're a Git user, there is high chance you might be using .gitignore file to ignore certain files from being committed into your remote repo. Now, .gitignore file differs for different languages,

  • Jayesh Kawli
2 min read
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

  • Jayesh Kawli
2 min read
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

  • Jayesh Kawli
4 min read
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

  • Jayesh Kawli
4 min read
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

  • Jayesh Kawli
4 min read
JavaScript, Tutorial, Tips, Interview, Closures, First class functions

JavaScript Closures Fun

JavaScript closures are fun. Not just because they're are sometimes hard to understand, but they make interview questions interesting to tackle. Today I am going to write about one such JavaScript interview question

  • Jayesh Kawli
2 min read
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

  • Jayesh Kawli
4 min read
UI Testing, Testing, iOS, Tips, Tricks, Gotchas, UI Tests, Command Line, Terminal

Running UI tests from command line

Recently I ran into an interesting problem of writing UI tests. More interesting thing lied ahead when I had to run these tests on the command line. Here are some of the tips

  • Jayesh Kawli
1 min read
iOS, iOS8, Tips, Swift 3.0, Swift, UITextView, Padding

Removing padding for UITextView

Last week I was working on one of the projects that required using UITextView instead of more standard UILabel instance. Don't get me wrong, but there were some compelling reasons for me to

  • Jayesh Kawli
2 min read
Swift, Testing, Unit Tests, Unit-testing, Xcode, Tips, Protocols

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

  • Jayesh Kawli
1 min read
Xcode, Tips, Search and Replace, Search, Replace, Tricks, RegEx, Regular Expressions

Search and Replace in Xcode with Regular Expressions

Recently I ran into problem where I wanted to search a pattern in the Xcode project and replace the found string with another one. In the past I had had  hard time dealing

  • Jayesh Kawli
4 min read
Swift, Swift 3.0, Tips, Example, Phantom Types, Obscured Features, Phantom

Using Phantom Types in Swift

Phantom types are special types in Swift. They are useful when you want to pass the variable with same structure but with different types. I would like to thank to This blog post

  • Jayesh Kawli
3 min read
Objective-C, Blocks, iOS, Gotchas, Tips, Example

Objective-C blocks - Example and a Quick reference

This post is inspired by following Tweet when it was mentioned after years of experience, developer still could not remember the blocks syntax. After years of iOS development, I finally caved & made

  • Jayesh Kawli
1 min read
Fresh Beginning © 2021
Latest Posts Ghost