Swiftpack.co -  swiftui-packages/url-image-module as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
swiftui-packages/url-image-module
The url image allows you to show graphical content from remote sources via a url. This packe also provides useful http-request-lifecycle-specific content.
.package(url: "https://github.com/swiftui-packages/url-image-module.git", from: "1.0.0")

URL Image Module

build test swiftlint swiftpackageindex swift versions swiftpackageindex platforms License: GPL v3

Usage

A URLImage is separted in three logical separated states:

  1. loading, during the download process
  2. default, in case the download did fail
  3. content, after the successful download

The constructor comes with the option to either use a URL or a plain String to define the resources origin. In case the String does not represent a valid URL, the content will fallback to default.

if let url = URL(string: "www.abc.com/image") {
    URLImage(url: url)
}
URLImage(url: "www.abc.com/image")

Integration

  1. Copy the resource url:
https://github.com/swiftui-packages/url-image-module.git
  1. Open your Xcode project

  2. Two options a and b for step 3
    a)   At the menu bar navigate to File / Swift Packages / Add Package Dependency
    b1) Select the project's root folder
    b2) select your app name under PROJECT
    b3) Open Swift Packages tab on the right side of Info and Build Settings
    b4) Hit the + button at the bottom of the list

  3. Here you should be prompted to "Choose Package Repository:"

  4. Paste the resource url

  5. Select Next to go with the latest version or select a specific version or branch

  6. After a short loading period of package resolution you get prompted to Choose package products and targets (the default should be fine)

  7. The complete hit the Finish button

  8. Import URLImageModule into the files where you want to use it


Can also be found here


ToDos

  • maintaining README.md file

    • GIF of importing Swift Package Manager Packages into Xcode Projects
    • phrasing an introduction text
    • writing usage instructions with code examples
  • feature: optionally allow tho bind to the optional downloaded image

  • possible feature: headers parameter in case that multiple headers are required

GitHub

link
Stars: 0
Last commit: 3 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Release Notes

3 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics