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

Xcode

A collection of 47 posts

iOS, Swift, Xcode 10.1, Xcode, Drag and Drop, DragDrop, Postmates, Interview Questions, Interview

Drag and Drop on iOS using Swift

Hello folks, it's been a while since I wrote my last article. Today we're going to learn how to implement drag and drop feature on iOS using Swift. To see in advance what

  • Jayesh Kawli
5 min read
Xcode, debugger, Debugging, symbolic breakpoints, Advanced debugging, Swift, Objective-C, lldb, Command Line, symbolic

Xcode symbolic breakpoints - Break at method call

Today I am going to write about the big advanced debugging feature of LLDB. I am calling it advanced because I myself didn't know about it for a long time. It allows you

  • Jayesh Kawli
4 min read
iOS, Swift, Xcode, Metadata, plist

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

  • Jayesh Kawli
2 min read
Swift, Memory Leak, Memory, weakify, unowned, retain cycle, KrakenDev, StackOverflow, iOS, Xcode, App Development, iOS Developer

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

  • Jayesh Kawli
9 min read
Monty-Hall problem, Monty hall, monty, hall, Probability, Simulation, Swift, Xcode

Implementing 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,

  • Jayesh Kawli
4 min read
Swift, Xcode 9, Xcode, Closure, Closures, iOS, Example, Demo

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

  • Jayesh Kawli
1 min read
MVVM, iOS, Swift, Swift 3.0, Xcode, VIPER, Architectures, iOS Architectures

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

  • Jayesh Kawli
1 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
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
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, Xcode, iOS, Notifications, Data, Payload, NSNotifications

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.

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

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

  • Jayesh Kawli
1 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
iOS, Xcode, Swift, UIScrollView, Tutorial, How To

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

  • Jayesh Kawli
1 min read
Swift, iOS, Tutorial, Xcode, AutoLayout, Tips, Game of Thrones, Debugging, lldb, Breakpoints, debugger, Breakpoint

iOS - Autolayout and Resizing UILabel (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

  • Jayesh Kawli
3 min read
Objective-C, Xcode, Reactive Cocoa, Github, Tutorial, MVVM, ViewModel, iOS Pattern, Sample

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

  • Jayesh Kawli
4 min read
Tutorial, Tips, Xcode, Animation, Core Animation, Objective-C

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

  • Jayesh Kawli
3 min read
iOS, Swift, Tips, Xcode, Line Spacing, Tutorial, UIKit

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

  • Jayesh Kawli
2 min read
iOS, Swift, Tutorial, Tips, NSAttributedString, NSTextAttachment, Xcode, Apple

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

  • Jayesh Kawli
3 min read
Xcode, Tips, Tutorial, Shortcut

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/

  • Jayesh Kawli
1 min read
Xcode, Swift, Chris Eidhof, trySwift, Realm, Generics, structs

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

  • Jayesh Kawli
2 min read
iOS, Xcode, Testing, Unit Tests, Specta, Tutorial, Tips, Asynchronous, Async, Unit-testing

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

  • Jayesh Kawli
1 min read
iOS, Xcode, Testing, Unit Tests, OCMock, Specta, Unit-testing

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

  • Jayesh Kawli
2 min read
AutoLayout, Constraints, Tips, Tutorial, Gotchas, Xcode, Debugging, lldb, debug, debugger, Breakpoints, Breakpoint

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.

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