• Stars
    star
    149
  • Rank 248,619 (Top 5 %)
  • Language
    Swift
  • Created over 5 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Swift µframework for fetching images 🍊

Tangerine 🍊

Tangerine is a Swift µframework for fetching Images.

Installation

Swift Package Manager

Swift Package Manager is integrated within Xcode 11, so using Tangerine in your project is a piece of cake:

  1. File → Swift Packages → Add Package Dependency...
  2. Paste the repository URL (https://github.com/RuiAAPeres/Tangerine) and click Next.
  3. For Rules, either select version, branch or commit.
  4. Select the Target where you would like to add Tangerine. The correct one should be already selected for you.
  5. Click Finish.

Manual Installation

Drag the Tangerine.swift file into your project. 🍊

Usage

Typically a view should have a single ImageFetcher, and as such it’s not possible for one to fetch different images with only one instance of a ImageFetcher. From a code point of view:

let tangerines = URL(string: "https://www.strongertogether.coop/sites/default/files/Tangerines.jpg")!
let fetcher = ImageFetcher(urL: tangerines)
let example = ExampleView(fetcher: fetcher)
struct ExampleView: View {
  @ObservedObject var fetcher: ImageFetcher
  
  init(fetcher: ImageFetcher) {
    self.fetcher = fetcher
  }
  
  var body: some View {
    VStack {
      fetcher.image.map {
        Image(uiImage: $0)
          .resizable()
          .aspectRatio(contentMode: .fit)
      }
    }
    .onAppear(perform: fetcher.refresh)
  }
}

The actual HTTP request is done not when the ImageFetcher is created, but when the refresh method is called.

Tangerine also supports caching via NSCache. You can either supply yours, or use the default one.

More Repositories

1

UIViewController-Swizzled

Used to print the structure of your application as you use it
Objective-C
847
star
2

Receiver

Swift µframework implementing the Observer pattern 📡
Swift
239
star
3

Reactor

Powering your RAC architecture
Swift
184
star
4

OptionalExtensions

Swift µframework with extensions for the Optional Type
Swift
182
star
5

iOSArchitecture

Sample project showing a common architecture I use when creating iOS Projects
Objective-C
157
star
6

Swift-Sugar

Swift's Sugar. Heavily inspired on Objc Sugar(https://github.com/supermarin/ObjectiveSugar)
Swift
153
star
7

Rinku

A simple networking library
Swift
43
star
8

KirKos

Focus on the most important
Objective-C
34
star
9

SaferFonts

Avoiding potential mistypes while using fonts programatically in Swift
Swift
30
star
10

RPNSURLConnection-Swizzled

NSURLConnection's category for the request and stack trace output
Objective-C
26
star
11

RPDynamicWarningView

A simple warning view that takes advantage of UIKit Dynamics
Objective-C
22
star
12

NSURLConnection-Blocks

Category that allows the dev to specify blocks for the success and failure cases
Objective-C
13
star
13

UITextField-DelegationBlocks

Add blocks, as per a single instance basis, to your UITextFields
Objective-C
12
star
14

NSObject-Dealloc

Category used to know when your object has been deallocated
Objective-C
7
star
15

8472

Strava client, with focus activities analysis. 🏃‍♂️
Swift
6
star
16

JSaaS

Jaden Smith as a Service
Elixir
6
star
17

NSPortoWorkshop

A detailed description about a potential Workshop that could be organised in Porto, Portugal.
5
star
18

SliderController

Objective-C
5
star
19

fartlek

Strava Webhooks + APNS
Python
5
star
20

RPGallery

Gallery used to upload pictures
Objective-C
4
star
21

TeamGen

Generating balanced teams 🚀🏈
Swift
4
star
22

OctifyIssues

Used as Issues Tracker for the App Octo Alarm
3
star
23

FootballTeamGenerator

...because just random is not good enough
Swift
3
star
24

RuiAAPeres

2
star
25

ReversePolishNotation-Swift

Reverse Polish Notation done in Swift, based on http://learnyousomeerlang.com/functionally-solving-problems#rpn-calculator
Swift
2
star
26

but_the_android_team_uses_RxJava

this is a parody
Swift
2
star
27

OctifyPush

APNS for my iOS App (Octify)
Go
2
star
28

TestingFRP

Some benchmarks
Swift
2
star
29

SquareStock

Square Stock
Objective-C
1
star
30

Refactoring

Swift
1
star
31

Franz

Swift
1
star
32

Reading18

A list of material (articles + books) I read + wrote in 2018.
1
star
33

swiftAveiroFP

FP stuff with Argo Fun
Swift
1
star
34

principles

1
star
35

PromisesPlayground

Objective-C
1
star