Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework ImageRequest #245

Merged
merged 6 commits into from May 20, 2019

Conversation

@kean
Copy link
Owner

kean commented May 19, 2019

Changes

  • Move advanced options into separate ImageRequestOptions struct
  • Remove the entire zoo of processing API, leaves a single one - processors: [ImageProcessing]
  • Initializers now accept every single option that request might have

Examples

Settings processor:

let request = ImageRequest(url: URL(string: "http://..."), processors: [
    ImageProcessor.Resize(size: CGSize(width: 44, height: 44))
])

Setting priority:

let request = ImageRequest(url: URL(string: "http://..."), priority: .high)

Setting everything:

let request = ImageRequest(
    url: URL(string: "http://..."),
    processors: [
        ImageProcessor.Resize(size: CGSize(width: 44, height: 44), crop: true),
        ImageProcessor.RoundedCorners(radius: 16)
    ],
    priority: .high,
    options: .init(
        memoryCacheOptions: .init(
            isReadAllowed: false,
            isWriteAllowed: false
        ),
        cacheKey: "1",
        loadKey: "2",
        userInfo: "hello"
    )
)
kean added 6 commits May 19, 2019
  - Add remaining options like priority to ImageRequest init
  - Move more advanced options in a separate ImageRequestOptions struct
@kean kean merged commit 60e0263 into nuke8 May 20, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/push The Travis CI build passed
Details
@kean kean deleted the rework-image-request branch May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.