> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# Best iOS Development Tips and Tricks - Part 3
- URL: https://developerinsider.co/best-ios-development-tips-and-tricks-part-3/
- Published: 2020-01-31T11:30:30.000Z
- Updated: 2026-10-10T07:04:52.000Z
- Author: Vineet Choudhary
- Tags: iOS, Xcode, Tips and Tricks

## 1\. Clean iOS app launch screen cache

You might have noticed when you tried to change something in the launch screen on the iOS application, you still see the old launch screen. Because the system caches launch images and it's not cleared even after deleting the application.

For cleaning the launch screen, all you have to do to completely clear your app’s launch screen cache is run this code inside your app:

```swift
import UIKit

public extension UIApplication {
    func clearLaunchScreenCache() {
        #if DEBUG
        do {
            let launchScreenPath = "\(NSHomeDirectory())/Library/SplashBoard"
            try FileManager.default.removeItem(atPath: launchScreenPath)
        } catch {
            print("Failed to delete launch screen cache - \(error)")
        }
        #endif
    }
}

```

To use this, add the following lines in the app's `didFinishLaunchingWithOptions` delegate method:

```swift
UIApplication.shared.clearLaunchScreenCache()

```

Checkout sample project on [Github](https://github.com/developerinsider/iOSClearAppLaunchScreenCacheDemo?ref=developerinsider.co).

## 2\. Add Function Documentation

You can use `⌥` \+ `⌘` \+ `/` (option + command + ) to add function documentation.

## 3\. 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.  
![](https://github.com/developerinsider/developer-insider-content/blob/master/POST/iOS/TipsAndTricks/BuildSettingDocs.png?raw=true)

## 4\. 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 -

```bash
xed .

```

If your project only has a project(`.xcodeproj`) the file then the same command will open your project.

You can also open/edit a single file from your Xcode project without launching the complete Xcode workspace or project. Like if you want to open your `Podfile` then we can open using -

```bash
xed Podfile

```

xed was introduced in Mac OS X 10.5 with Xcode 3.0.

## 5\. Using #function for 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.

```swift
extension UserDefaults {
    var accessToken: String? {
        get {
            return string(forKey: #function)
        }
        set {
            set(newValue, forKey: #function)
            synchronize()
        }
    }
}

```

## 6\. Strongly Typed Info.plist

You can easily access `info.plist` strongly typed by create a struct this way -

```swift
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 use above `InfoPlist<T>` struct like this -

```swift
let bundleIdentifier = InfoPlist<String>["CFBundleDisplayName"]
```

## 7\. Generate Strongly-Typed Swift or Objective-C Data Models directly from JSON

[Quicktype](https://app.quicktype.io/?ref=developerinsider.co) 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 instances of the generated types. You can also use any other way.

![](https://github.com/developerinsider/developer-insider-content/blob/master/POST/iOS/TipsAndTricks/QuickType.png?raw=true)

## 8\. Create Empty Commits

Sometimes we need to make empty commits on some testing branch so that we can trigger various kinds of things like Jenkins build etc. So, here the way to make an empty commit which will trigger a push event on GitHub/GitLab, etc. This is more convenient than adding spaces to your README.md file.

```bash
git commit --allow-empty -m "Trigger Jenkins Build"

```

## 9\. UIRefreshControl for any UIScrollView

Apple documentation shows us how we can use an `UIRefreshControl` in an `UITableViewController`, but do you know, we can add it to any `UIScrollView `?

```swift
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`.

```swift
let refreshControl = UIRefreshControl()
refreshControl.addTarget(self, action: #selector(handleRefresh), for: .valueChanged)
webView.scrollView.addSubview(refreshControl)

```

## 10\. Explore Private Framework with iPad Swift Playground App

[Swift Playground](https://apps.apple.com/us/app/swift-playgrounds/id908519492?ref=developerinsider.co) 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/?ref=developerinsider.co).

This was the part 3 of *Best iOS Development Tips and Tricks* series. Here the part 1 and 2 of the same series.

- [Best iOS Development Tips and Tricks - Part 1](https://developerinsider.co/best-ios-development-tips-and-tricks/)
- [Best iOS Development Tips and Tricks - Part 2](https://developerinsider.co/best-ios-development-tips-and-tricks-part-2/)