Skip to content

themrandray/GiphySearchApp

Repository files navigation

Giphy Search App

A simple iOS app built with UIKit that allows users to search for GIFs using the Giphy API.

Features

  • Search GIFs by keyword
  • Debounced search input
  • Animated GIF grid
  • Pagination when scrolling
  • GIF detail screen
  • Loading indicator
  • Error handling with Retry button
  • Basic network availability handling
  • Unit tests for endpoint building, decoding, and error messages
  • Navigation handled with AppCoordinator

Technologies

  • Swift
  • UIKit
  • URLSession
  • SDWebImage
  • NWPathMonitor
  • XCTest

Project Structure

  • Features – view controllers and UI components
  • Models – response and GIF data models
  • Networking – API client, endpoint builder, and network errors
  • Core – coordinator and shared utilities

Giphy API Key Setup

You can find the official Giphy API documentation here.

To run the project, create your own Giphy API key on the Giphy Developers portal.

  1. Create a local Config.xcconfig file in the project root.

  2. Add the following line:

    GIPHY_API_KEY = your_api_key_here

  3. Make sure Config.xcconfig is selected for Debug and Release build configurations.

  4. The app reads the key through Info.plist.

Config.xcconfig is excluded from Git to keep the API key private.

How It Works

The app starts on the search screen, where the user can type a query to search for GIFs. Search requests are debounced to avoid sending a request on every keystroke. Results are displayed in a two-column animated grid. When the user scrolls near the bottom, the next page of results is loaded automatically. Selecting a GIF opens a detail screen with a larger animated preview and title.

Error Handling

The app handles:

  • invalid URLs
  • invalid server responses
  • decoding errors
  • server errors such as 429
  • network connection loss

When the internet connection is lost, the app shows a message and allows the user to retry the last search.

Testing

The project includes unit tests for:

  • Giphy endpoint URL building
  • readable server error messages
  • readable 429 error message
  • GIF response decoding

Notes

  • Third-party library usage is limited to GIF rendering and display support.
  • Networking is implemented with URLSession.
  • The app was built as a learning project and improved step by step during development.
  • During development, automatic retry after reconnect was tested, but iOS Simulator network recovery proved inconsistent. A stable manual Retry flow was kept instead.

About

iOS GIF search application built with UIKit and the Giphy API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages