Welcome to the documentation for HGPlaceholders – a library that provides functionality for managing placeholders in your iOS applications. With HGPlaceholders, developers can easily handle scenarios where content is being loaded or updated, improving the user experience.


  • Efficient handling of placeholder states
  • Customizable appearance for placeholders
  • Support for different types of placeholders
  • Flexible integration with existing UI components
  • Seamless integration with popular networking libraries


To install HGPlaceholders in your iOS project, you can choose one of the following methods:


Add the following line to your Podfile:

pod ‘HGPlaceholders’

Then, run the command:

$ pod install

Manual Installation

  1. Download the latest version of HGPlaceholders.
  2. Drag and drop the HGPlaceholders.xcodeproj into your Xcode project.
  3. In your project’s settings, select your target and go to General > Frameworks, Libraries, and Embedded Content.
  4. Add HGPlaceholders.framework using the ‘+’ button.


To start using HGPlaceholders in your iOS application, follow these steps:


In the file where you want to use HGPlaceholders, import the framework:

import HGPlaceholders

Create a PlaceholderManager

Create an instance of PlaceholderManager to handle your placeholders. Make sure to configure your PlaceholderManager according to your app’s requirements.

let placeholderManager = PlaceholderManager()
placeholderManager.configure(with: .defaultConfiguration) // Customize as needed

Displaying a Placeholder

Use the showLoadingPlaceholder(on:) method of the PlaceholderManager to display a loading placeholder on a specific view:

placeholderManager.showLoadingPlaceholder(on: myView)

Updating a Placeholder

If you need to update the state or appearance of a placeholder, you can use the update(placeholder:) method:

placeholderManager.update(placeholder: myPlaceholder)

Hiding a Placeholder

When your content has finished loading and is ready to be displayed, you can hide the placeholder using the hidePlaceholder(on:) method:

placeholderManager.hidePlaceholder(on: myView)

Customizing Placeholders

HGPlaceholders provides various customization options to match your app’s design. You can configure global placeholder styles using the PlaceholderConfiguration struct:

let customConfiguration = PlaceholderConfiguration(
loadingViewClass: MyCustomLoadingView.self,
errorViewClass: MyCustomErrorView.self,
emptyViewClass: MyCustomEmptyView.self
placeholderManager.configure(with: customConfiguration)


HGPlaceholders simplifies the management of placeholders in your iOS app, providing an intuitive way to handle loading, error, or empty states. By using HGPlaceholders, you can enhance the user experience and ensure a seamless display of content.

Have Questions?

If you have any questions, feel free to reach out to our support team at support@hgplaceholders.com. We’re here to help!