Lightweight framework for Unsplash in Swift

Overview

UnsplashFramework

📷 Introduction

The idea behind this project is to make an easy-to-use, well tested and well documented client framework for Unsplash.

Currently in early development stage 🍼

🛠 Plan

  • List photos
  • Search photos
  • Search collections
  • Search user
  • List collections
  • Users

Requirement

  • iOS 14.5+
  • XCode 13.0+

⬇️ Installation

CocoaPods

Add the following to your Podfile:

pod 'UnsplashFramework', '~> 0.1'

Carthage

Add the following to your Cartfile:

0.1 ">
github "camiletti/UnsplashFramework" ~> 0.1

🎛 Use

import UnsplashFramework

Credentials

Before doing any request, the Unsplash client credentials should be set. If you haven't registered yet, you can do so here.

let credentials = UNCredentials(appID: "Your_AppID", secret: "Your_Secret"
let client = UNClient(with: credentials)

Listing photos

client.listPhotos(page: 1,
                  photosPerPage: 10,
                  sortingBy: .popular)
    { result in
        switch result {
        case .success(let photos):
            photos.forEach({ (photo) in
                print("Photo with ID: \(photo.id) from user: \(photo.user.username) main color: \(photo.hexColor)")
            })

        case .failure(let error):
            print("Error: \(error.reason)")
    }
}

Searching photos

client.searchPhotos(query: "Forest",
                    page: 1,
                    photosPerPage: 10,
                    collections: nil,
                    orientation: .landscape)
    { result in
        switch result {
        case .success(let searchResult):
        searchResult.photos.forEach { (photo) in
            print("Photo with ID: \(photo.id) from user: \(photo.user.username) main color: \(photo.hexColor)")
        }
        
        case .failure(let error):
            print("Error: \(error.reason)")
        }
    }

📖 Documentation

Full documentation here

🐦 Contact

@camiletti_p

📄 License

UnsplashFramework is under MIT license.

Copyright 2021 Pablo Camiletti

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You might also like...
A framework that provides CurtainController. CurtainController is a container view controller that implements a content-curtain interface. You can find a similar implementation in applications like Apple Maps, Find My, Stocks, etc. Someone calls it UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS
UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

UIPheonix is a super easy, flexible, dynamic and highly scalable UI framework + concept for building reusable component/control-driven apps for macOS, iOS and tvOS

A framework which helps you attach observers to `UIView`s to get updates on its frame changes

FrameObserver is a framework that lets you attach observers to any UIView subclass and get notified when its size changes. It doesn't use any Method S

List tree data souce to display hierachical data structures in lists-like way. It's UI agnostic, just like view-model and doesn't depend on UI framework
List tree data souce to display hierachical data structures in lists-like way. It's UI agnostic, just like view-model and doesn't depend on UI framework

SwiftListTreeDataSource List tree data souce to display hierachical data structures in lists-like way. It's UI agnostic, just like view-model, so can

The Napp Drawer module extends the Appcelerator Titanium Mobile framework.
The Napp Drawer module extends the Appcelerator Titanium Mobile framework.

Titanium Napp Drawer Module Description The Napp Drawer module extends the Appcelerator Titanium Mobile framework. The module is licensed under the MI

📹 Framework to Play a Video in the Background of any UIView
📹 Framework to Play a Video in the Background of any UIView

SwiftVideoBackground is an easy to use Swift framework that provides the ability to play a video on any UIView. This provides a beautiful UI for login

Shadow - Syntactic sugar for shadows in the SwiftUI framework

Shadow Syntactic sugar for shadows in the SwiftUI framework. import SwiftUI impo

SwiftCrossUI - A cross-platform SwiftUI-like UI framework built on SwiftGtk.

SwiftCrossUI A SwiftUI-like framework for creating cross-platform apps in Swift. It uses SwiftGtk as its backend. This package is still quite a work-i

UI framework that allows developers to integrate an amazing selection interface into their applications

UI framework that allows developers to integrate an amazing selection interface into their applications! Each bubble has a set of parameters, which could be configured individually.

Releases(0.4.0)
  • 0.4.0(Oct 1, 2022)

    ✨ Added

    • All photo related functionality

      • List editorial photos
      • Get a photo
      • Get a random photo
      • Get a photo’s statistics
      • Track a photo download
      • Update a photo
      • Like a photo
      • Unlike a photo
    • All collection related functionality

      • List collections
      • Get a collection
      • Get a collection’s photos
      • List a collection’s related collections
      • Create a new collection
      • Update an existing collection
      • Delete a collection
      • Add a photo to a collection
      • Remove a photo from a collection
    • All topic related functionality

      • List topics
      • Get a topic
      • Get a topic’s photos

    ♻️ Updated

    • All search related functionality
      • Search photos
      • Search collections
      • Search user
    Source code(tar.gz)
    Source code(zip)
  • 0.3.0(Aug 14, 2022)

    ✨ Added

    • All user fetching functionality
      • Get a user’s public profile
      • Get a user’s portfolio link
      • List a user’s photos
      • List a user’s liked photos
      • List a user’s collections
      • Get a user’s statistics
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Jul 31, 2022)

    ♻️ Refactored

    • Move from Cocoapods to SPM
    • Move from completion block based functions to Swift's structured concurrency
    • Move from Jazzy to DocC
    Source code(tar.gz)
    Source code(zip)
  • 0.1(Dec 7, 2017)

    ✨ Added

    • Incorporates the basic functionality such as listing public photos (popular, latest and oldest) and downloading specific photos in the given size (thumb, small, regular, full and raw).
    Source code(tar.gz)
    Source code(zip)
Owner
Pablo Camiletti
Lead iOS Developer at @dicefm, self-taught designer, voxel artist as hobby
Pablo Camiletti
High performance and lightweight UIView, UIImage, UIImageView, UIlabel, UIButton, Promise and more.

SwiftyUI High performance and lightweight UIView, UIImage, UIImageView, UIlabel, UIButton and more. Features SwiftyView GPU rendering Image and Color

Haoking 336 Nov 26, 2022
📖 A lightweight, paging view solution for SwiftUI

Getting Started | Customization | Installation Getting Started Basic usage Using Pages is as easy as: import Pages struct WelcomeView: View { @S

Nacho Navarro 411 Dec 29, 2022
A super lightweight popView.

SNAugusPopView Features High performance: The library's dependencies all use system libraries and files , only a instance global. Automatic layout: Th

Augus 11 Sep 1, 2022
Protocol oriented, type safe, scalable design system foundation swift framework for iOS.

Doric: Design System Foundation Design System foundation written in Swift. Protocol oriented, type safe, scalable framework for iOS. Features Requirem

Jay 93 Dec 6, 2022
Swift extensions for UIKit.framework.

XUIKit Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation XUIKit is a

FITZ 0 Oct 22, 2021
Flexible UI Framework Designed for Swift

Overlay Overlay is a very flexible UI framework designed for Swift. Note: Overlay is still under development and many things are subject to change. Fe

TintPoint 52 Sep 4, 2022
A child view controller framework that makes setting up your parent controllers as easy as pie.

Description Family is a child view controller framework that makes setting up your parent controllers as easy as pie. With a simple yet powerful publi

Christoffer Winterkvist 246 Dec 28, 2022
Material, a UI/UX framework for creating beautiful iOS applications

Material Welcome to Material, a UI/UX framework for creating beautiful applications. Material's animation system has been completely reworked to take

Cosmicmind 12k Jan 2, 2023
Neumorphism framework for UIKit.

NeumorphismKit is neumorphism framework for UIKit. Requirements iOS 12.0+ Swift 5.1+ Versions NeumorphismKit version Xcode version 1.0.0 Xcode 11+ 1.1

y-okudera 42 Dec 13, 2022
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

kishikawakatsumi/SpreadsheetView has moved! It is being actively maintained at bannzai/SpreadsheetView. This fork was created when the project was mov

Kishikawa Katsumi 34 Sep 26, 2022