Swift How to measure function execution time in Swift? Runtime code execution duration monitoring is crucial. Swift provides ContinuousClock to measures the time that always increments. The ContinuousClock acts like a stopwatch, measuring time relative to when a program starts or some other specific reference point. This is suitable for high resolution measurements of execution. 1. Measure function execution...
Swift Execute async/await method from Swift Command Line (CLI) Application Call an async/await function (with or without throws) from the Swift Command Line Application using the spacial @main attribute to prevent the CLI application from exiting before the asynchronous operation completes....
SwiftUI Add AppDelegate to SwiftUI app When we create a new SwiftUI project in Xcode then it doesn't include the AppDelegate which we might need for different functionality like push notifications. The new SwiftUI main app file looks like this - import SwiftUI @main struct SampleApp: App { var body: some Scene { WindowGroup { ContentView() } } } In...
iOS How to get a unique device identifier in iOS devices? As you might be aware, Apple puts lots of restrictions on unique identifiers because of privacy concerns. But in this article, we will look at some of the available options which can use to uniquely identify Apple (iOS, tvOS, and macOS) devices. 1. Store unique device identifier in KeyChain We...
Apple TV Apple TV App and Universal Search Video Integration Guide The Apple TV app lets you browse content from a variety of video services without switching from one app to the next. It provides movies, shows, and handpicked recommendations. The app is on iOS and tvOS devices— so you can watch wherever you go....
Tips How to Explore Private Framework with iPad Swift Playground App? Swift Playground [https://apps.apple.com/us/app/swift-playgrounds/id908519492] app is the best way to explore iOS private APIs. You can browse iOS Private Headers for latest version from here. [https://developer.limneos.net/]....
Tips An easy way to maintain UserDefaults key You can use #function literal to get the property name as UserDefault key. In the following example, #function will get replaced by accessToken. Be aware, changing the property names may break functionality for the existing users. extension UserDefaults { var accessToken: String? { get { return string(forKey: #function) } set { set(newValue, forKey:...
Tips How to improve the Swift project build time? The Xcode 9.2 release notes mentioned an experimental feature that may improve Swift build times, enabled with the "BuildSystemScheduleInherentlyParallelCommandsExclusively" user default. defaults write com.apple.dt.Xcode BuildSystemScheduleInherentlyParallelCommandsExclusively -bool NO Note: According to the release notes it's an experimental feature which can "increase memory...
Interview Zomato iOS Interview Experience and Question Round 1 - Profile Screening Zomato HR contacted me via LinkedIn. After expressing my interest in the position HR set up a quick phone call. In this call, HR told me about the Zomato Z products and it's existence. HR told me about different kinds of Z product...
Interview Grab iOS Interview Experience and Question Round 1 - Profile Selection My profile selection was very unique experience for me. Grab Head of Engineering message me on LinkedIn about his experience and about the massive impact, results through innovation and collaboration, continuous learning and growth in the company. Then he told me about Steve (and ex-Google...
Interview GoJek Address Book Problem Assignment for iOS iOS Contact App build for Gojek iOS Developer interview process. Disclaimer This solution is for reference purpose. Please, do not copy-paste it. Companies are smart enough to catch if you are cheating. If your solution got rejected due to this we're not responsible for it. GO-JEK iOS Problem...
Interview GoJek iOS Interview Experience and Question Round 1 - Profile Selection Go-Jek HR contacted me via LinkedIn. After expressing my interest in the position HR set up a quick phone call. In this call, HR told me about the Go-Jek products and it's existence. Also, HR asked me about my experience and some basic...
iOS Best way to check if your iOS App is running on a Jailbroken Phone Sometimes, for security reasons, we need to check if our iOS app (like banking apps, OTT apps, etc) is running on a jailbroken phone or not. Most people suggest, check if "Cydia" is installed or not. But there might be some chances that the device doesn't...
Swift Create a Library using Swift Package Manager - Stepwise Tutorial The Swift Package Manager (SPM) is a tool for managing the distribution of source code, aimed at making it easy to share your code and reuse others code. Swift Package Manager provides a convention-based system for building libraries and executables, and sharing code across different packages....
Swift How to use SwiftLint with Xcode to enforce Swift style and conventions? SwiftLint [https://github.com/realm/SwiftLint] is a tool to enforce Swift style and conventions. Keeping a codebase consistent and maintainable in a project with a team of developers sometimes may be very hard, different conventions and styles, plus different levels of experience with the language across developers may result...