SwiftUI How to clear/reset SwiftUI Preview Caches? If you run into any SwiftUI Preview related issue, then there are high chance that you are facing that issue due to some cached preview data. Here are the steps to reset the SwiftUI Preview Caches: 1. Close Xcode. 2. Run the following command in the terminal: xcrun simctl --set...
Xcode Use Xcode 14 to run/debug code on iOS 17 or tvOS 17 As you might know, Apple doesn't include the iOS 17 or tvOS 17 device support files in Xcode 15. So, the old trick of copy-paste the device support files from newer Xcode to older Xcode is not possible. But there is a trick in Xcode 14 which you...
Xcode15 Fix Xcode 15 DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead In Xcode 15 Apple changed the variable which points to the default toolchain location to $TOOLCHAIN_DIR from $DT_TOOLCHAIN_DIR. If some project/target used $DT_TOOLCHAIN_DIR then it need to be replace by $TOOLCHAIN_DIR. 1. Find DT_TOOLCHAIN_DIR Reference To find out where in your...
Xcode What's new in Xcode 15? Xcode is the complete developer toolset used to create apps for Apple TV, Apple Watch, iPad, iPhone, and Mac. Xcode 15 includes everything you need to create amazing apps for all Apple platforms. Xcode 15 supports developing apps for iOS 17, iPadOS 17, tvOS 17, watchOS 10, macOS 14. Xcode...
Xcode What's new in Xcode 14? Xcode is the complete developer toolset used to create apps for Apple TV, Apple Watch, iPad, iPhone, and Mac. Xcode 14 includes everything you need to create amazing apps for all Apple platforms. Xcode 14 supports developing apps for iOS 16, iPadOS 16, tvOS 16, watchOS 9, macOS 13. Xcode...
Tips Xcode 11.5 crash on launch on macOS 11 Big Sur This is a known issues. Xcode versions prior to Xcode 11.5 crash on launch on macOS 11. Curretly there is one workaround for this. You've to run the following command in the Terminal app to avoid crashes when starting Xcode: defaults write com.apple.dt.Xcode DVTDisableMainThreadChecker...
Xcode What's new in Xcode 12? [Updated for 12.1, 12.2 and 12.3] Xcode is the complete developer toolset used to create apps for Apple TV, Apple Watch, iPad, iPhone, and Mac. Xcode 12 includes everything you need to create amazing apps for all Apple platforms. Xcode 12 also builds Universal apps by default to support upcoming Mac with Apple Silicon. Xcode 12...
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/]....
Xcode Use UIRefreshControl in any UIScrollView(UICollectionView, WebView) Apple documentation shows us how we can use an UIRefreshControl in an UITableViewController, but do you know, we can add it to any UIScrollView ? let refreshControl = UIRefreshControl() refreshControl.addTarget(self, action: #selector(handleRefresh), for: .valueChanged) scrollView.addSubview(refreshControl) In a similar way, we can add UIRefreshControl to a WKWebView. let...
Tips Generate Strongly-Typed Swift/Obj-C Data Models directly from JSON Quicktype [https://app.quicktype.io] generate Strongly-Typed Swift/Objective-C Data Models from JSON, Schema, and GraphQL. You just need to paste your JSON string in left side text box. Generated models code has comments at the top with a code sample that shows how to convert a JSON string to...
Tips How to create a Strongly Typed Info.plist? You can easily access info.plist strongly typed by create a struct this way - struct InfoPlist<T> { static func get(for key: String) -> T? { return Bundle.main.infoDictionary?[key] as? T } static subscript(key: String) -> T? { return get(for: key) } } Now you can...
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 The xed - Xcode Text Editor Invocation Tool If you are in your Xcode project folder and your project has both a workspace( .xcworkspace) and a project(.xcodeproj) the file then you can use following command to open workspace in Xcode from your terminal - xed . If your project only has a project(.xcodeproj) the file then the...
Xcode Where to find Project Build Settings Documentation? Do you know Xcode's project build setting has documentation? Just press ⌥ (option) + Double Click for complete documentation or open Quick Help Inspector....
Xcode How to Add Function Documentation in Xcode? You can use ⌥ + ⌘ + / (option + command + ) to add function documentation....