Essential Feed App – Image Feed Feature

Overview

Essential Feed App – Image Feed Feature

Build Status

BDD Specs

Story: Customer requests to see their image feed

Narrative #1

As an online customer
I want the app to automatically load my latest image feed
So I can always enjoy the newest images of my friends

Scenarios (Acceptance criteria)

Given the customer has connectivity
 When the customer requests to see their feed
 Then the app should display the latest feed from remote
  And replace the cache with the new feed

Narrative #2

As an offline customer
I want the app to show the latest saved version of my image feed
So I can always enjoy images of my friends

Scenarios (Acceptance criteria)

Given the customer doesn't have connectivity
  And there’s a cached version of the feed
  And the cache is less than seven days old
 When the customer requests to see the feed
 Then the app should display the latest feed saved

Given the customer doesn't have connectivity
  And there’s a cached version of the feed
  And the cache is seven days old or more
 When the customer requests to see the feed
 Then the app should display an error message

Given the customer doesn't have connectivity
  And the cache is empty
 When the customer requests to see the feed
 Then the app should display an error message

Use Cases

Load Feed From Remote Use Case

Data:

  • URL

Primary course (happy path):

  1. Execute "Load Image Feed" command with above data.
  2. System downloads data from the URL.
  3. System validates downloaded data.
  4. System creates image feed from valid data.
  5. System delivers image feed.

Invalid data – error course (sad path):

  1. System delivers invalid data error.

No connectivity – error course (sad path):

  1. System delivers connectivity error.

Load Feed Image Data From Remote Use Case

Data:

  • URL

Primary course (happy path):

  1. Execute "Load Image Data" command with above data.
  2. System downloads data from the URL.
  3. System validates downloaded data.
  4. System delivers image data.

Cancel course:

  1. System does not deliver image data nor error.

Invalid data – error course (sad path):

  1. System delivers invalid data error.

No connectivity – error course (sad path):

  1. System delivers connectivity error.

Load Feed From Cache Use Case

Primary course:

  1. Execute "Load Image Feed" command with above data.
  2. System retrieves feed data from cache.
  3. System validates cache is less than seven days old.
  4. System creates image feed from cached data.
  5. System delivers image feed.

Retrieval Error course (sad path):

  1. System delivers error.

Expired cache course (sad path):

  1. System delivers no feed images.

Empty cache course (sad path):

  1. System delivers no feed images.

Load Feed Image Data From Cache Use Case

Data:

  • URL

Primary course (happy path):

  1. Execute "Load Image Data" command with above data.
  2. System retrieves data from the cache.
  3. System delivers cached image data.

Cancel course:

  1. System does not deliver image data nor error.

Retrieval error course (sad path):

  1. System delivers error.

Empty cache course (sad path):

  1. System delivers not found error.

Validate Feed Cache Use Case

Primary course:

  1. Execute "Validate Cache" command with above data.
  2. System retrieves feed data from cache.
  3. System validates cache is less than seven days old.

Retrieval Error course (sad path):

  1. System deletes cache.

Expired cache course (sad path):

  1. System deletes cache.

Cache Feed Use Case

Data:

  • Image Feed

Primary course (happy path):

  1. Execute "Save Image Feed" command with above data.
  2. System deletes old cache data.
  3. System encodes image feed.
  4. System timestamps the new cache.
  5. System saves new cache data.
  6. System delivers success message.

Deleting error course (sad path):

  1. System delivers error.

Saving error course (sad path):

  1. System delivers error.

Flowchart

Feed Loading Feature

Architecture

Feed Loading Feature

Model Specs

Feed Image

Property Type
id UUID
description String (optional)
location String (optional)
url URL

Payload contract

GET *url* (TBD)

200 RESPONSE

{
    "items": [
        {
            "id": "a UUID",
            "description": "a description",
            "location": "a location",
            "image": "https://a-image.url",
        },
        {
            "id": "another UUID",
            "description": "another description",
            "image": "https://another-image.url"
        },
        {
            "id": "even another UUID",
            "location": "even another location",
            "image": "https://even-another-image.url"
        },
        {
            "id": "yet another UUID",
            "image": "https://yet-another-image.url"
        }
        ...
    ]
}
You might also like...
Image-cropper - Image cropper for iOS

Image-cropper Example To run the example project, clone the repo, and run pod in

An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.
An instagram-like image editor that can apply preset filters passed to it and customized editings to a binded image.

CZImageEditor CZImageEditor is an instagram-like image editor with clean and intuitive UI. It is pure swift and can apply preset filters and customize

Phimp.me - Photo Image Editor and Sharing App. Phimp.me is a Photo App for iOS that aims to replace proprietary photo applications. It offers features such as taking photos, adding filters, editing images and uploading them to social networks. Lightbox is a convenient and easy to use image viewer for your iOS app
Lightbox is a convenient and easy to use image viewer for your iOS app

Lightbox is a convenient and easy to use image viewer for your iOS app, packed with all the features you expect: Paginated image slideshow. V

An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.
An image cropper / photo cropper for iOS like in the Contacts app with support for landscape orientation.

RSKImageCropper An image cropper for iOS like in the Contacts app with support for landscape orientation. Installation RSKImageCropper requires iOS 9.

Image gallery similar to Adidias' app, built in SwiftUI
Image gallery similar to Adidias' app, built in SwiftUI

TripleStackGallery TripleStackGallery is a image gallery component, which displays a set of images as a stack of three images, always displaying the i

Image Editor iOS App - CLEAN Architecture + MVP Pattern
Image Editor iOS App - CLEAN Architecture + MVP Pattern

Image Editor iOS Application - Built using UIKit, CoreData, CoreImage, and URLSession Frameworks with CLEAN Architecture and MVP UI design pattern.

Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.
Agrume - 🍋 An iOS image viewer written in Swift with support for multiple images.

Agrume An iOS image viewer written in Swift with support for multiple images. Requirements Swift 5.0 iOS 9.0+ Xcode 10.2+ Installation Use Swift Packa

AlamofireImage is an image component library for Alamofire

AlamofireImage AlamofireImage is an image component library for Alamofire. Features Image Response Serializers UIImage Extensions for Inflation / Scal

Comments
  • Image Comments UI

    Image Comments UI

    • Created a Shared UI module for reusable UI elements to avoid duplication
    • Renamed FeedViewController to ListViewController as it's now a reusable list controller for any type of cell
    • Added Dynamic Type support for scaling fonts automatically
    • Migrated to Diffable Data Sources
    opened by grav0211 0
  • Reusable 'Resource loading' presentation

    Reusable 'Resource loading' presentation

    • Introduce reusable LoadResourcePresenter.
    • Replace custom FeedPresenter and FeedImagePresenter logic with LoadResourcePresenter to eliminate duplication.
    opened by grav0211 0
Owner
Alexandre Gravelle
iOS Developer - Triathlete - Vipassana Meditator
Alexandre Gravelle
A photo gallery for iOS with a modern feature set. Similar features as the Facebook photo browser.

EBPhotoPages ”A photo gallery can become a pretty complex component of an app very quickly. The EBPhotoPages project demonstrates how a developer coul

Eddy Borja 1.7k Dec 8, 2022
A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image.

QRDecode A complete Mac App: drag an image file to the top section and the bottom section will show you the text of any QRCodes in the image. QRDecode

David Phillip Oster 2 Oct 28, 2022
RSS-Feed App template

RSS-Feed RSS-Feed App template This project is powered by DSKit a Design System Kit for iOS 13+, an iOS SDK written in Swift with a collection of reus

imodeveloperlab 3 Aug 28, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 3, 2023
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 330 Sep 9, 2022
📷 A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.8k Jan 2, 2023
AsyncImage before iOS 15. Lightweight, pure SwiftUI Image view, that displays an image downloaded from URL, with auxiliary views and local cache.

URLImage URLImage is a SwiftUI view that displays an image downloaded from provided URL. URLImage manages downloading remote image and caching it loca

Dmytro Anokhin 1k Jan 4, 2023
AYImageKit is a Swift Library for Async Image Downloading, Show Name's Initials and Can View image in Separate Screen.

AYImageKit AYImageKit is a Swift Library for Async Image Downloading. Features Async Image Downloading. Can Show Text Initials. Can have Custom Styles

Adnan Yousaf 11 Jan 10, 2022
Convert the image to hexadecimal to send the image to e-paper

ConvertImageToHex Convert the image to hexadecimal to send the image to e-paper Conversion Order // 0. hex로 변환할 이미지 var image = UIImage(named: "sample

Hankyeol Park 0 Feb 26, 2022
Twitter Image Pipeline is a robust and performant image loading and caching framework for iOS clients

Twitter Image Pipeline (a.k.a. TIP) Background The Twitter Image Pipeline is a streamlined framework for fetching and storing images in an application

Twitter 1.8k Dec 17, 2022