{"id":19608944,"url":"https://github.com/davecom/dkasyncimageview","last_synced_at":"2025-04-27T20:33:11.384Z","repository":{"id":21692387,"uuid":"25013700","full_name":"davecom/DKAsyncImageView","owner":"davecom","description":"A Swift subclass of NSImageView for loading remote images asynchronously.","archived":false,"fork":false,"pushed_at":"2023-11-19T08:38:31.000Z","size":54,"stargazers_count":47,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-18T00:44:54.254Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davecom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-10T00:12:28.000Z","updated_at":"2023-11-19T08:21:11.000Z","dependencies_parsed_at":"2023-01-14T10:00:25.082Z","dependency_job_id":null,"html_url":"https://github.com/davecom/DKAsyncImageView","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FDKAsyncImageView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FDKAsyncImageView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FDKAsyncImageView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davecom%2FDKAsyncImageView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davecom","download_url":"https://codeload.github.com/davecom/DKAsyncImageView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251204786,"owners_count":21552292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:18:42.015Z","updated_at":"2025-04-27T20:33:10.984Z","avatar_url":"https://github.com/davecom.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"DKAsyncImageView\n================\n\n[![Swift Versions](https://img.shields.io/badge/Swift-1%2C2%2C3%2C4%2C5-green.svg)](https://swift.org)\n[![CocoaPods Version](https://img.shields.io/cocoapods/v/DKAsyncImageView.svg)](https://cocoapods.org/pods/DKAsyncImageView)\n[![SPM Supported](https://img.shields.io/badge/SPM-supported-DE5C43.svg?style=flat)](https://swift.org/package-manager/)\n[![CocoaPods Platforms](https://img.shields.io/cocoapods/p/DKAsyncImageView.svg)](https://cocoapods.org/pods/DKAsyncImageView)\n[![Twitter Contact](https://img.shields.io/badge/contact-@davekopec-blue.svg?style=flat)](https://twitter.com/davekopec)\n\nDKAsyncImageView is a Swift subclass of NSImageView for loading remote images asynchronously and displaying them on OS X.\n\nThis class was originally a port of [PVAsyncImageView](https://github.com/pedrovieira7/PVAsyncImageView) by [@pedrovieira7](https://github.com/pedrovieira7) from Objective-C to Swift.\n\nFeatures\n----------------\n* Download images from the Web to DKAsyncImageView asynchronously with just 1 line of code\n* Set a 'Placeholder Image' to be displayed until the image is downloaded\n* Set an 'Error Image' to be displayed when an error occurs while downloading the image\n* Set ToolTips for each state -\u003e Loading Image / Image Loaded / Error Loading Image\n* Display a Spinning Wheel on top of DKAsyncImageView while it's downloading the image\n* No external dependencies beyond AppKit\n\nDocumentation\n----------------\nInclude `DKAsyncImageView.swift` in your project, use the CocoaPod `DKAsyncImageView`, or use SPM with this repository as your dependency. Set an IB NSImageView's class as DKAsyncImageView or create it programmatically. In the latter case, use the standard NSImageView init methods. \n\n\u003e Note: DKAsyncImageView 1.0.3/1.0.4 supports Swift 4 and Swift 5. Version 1.0.2 supports Swift 3. Version 1.0.1 supports Swift 2. Version 1.0 supports Swift 1.2.\n\n**Download an Image**\n```\nfunc downloadImageFromURL(url: String, placeHolderImage: NSImage? = nil, errorImage: NSImage? = nil, usesSpinningWheel: Bool = false, completion: ((Data?, Error?) -\u003e Void)? = nil) \n```\nAt minimum, you simply must provide the URL of the image you want to asynchronously download. However, you also have the option of providing a `placeHolderImage` that displays while the download is taking place, and an `errorImage` that displays if the download is unsuccessful.\n\n`usesSpinningWheel` specifies whether a spinning NSProgressIndicator appears over the NSImageView while the image is being downloaded.\n`completion` is a block to be executed when the download task finishes\n\n**Set Tool Tips**\n```\nfunc setToolTipWhileLoading(ttip1: String?, whenFinished ttip2:String?, andWhenFinishedWithError ttip3: String?)\n```\n\n**Cancel a Download**\n```\ncancelDownload()\n```\n\nThere are no external dependencies other than the AppKit framework.\n\nFuture Direction/Ideas\n----------------\n* Make property based instead of method based\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fdkasyncimageview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavecom%2Fdkasyncimageview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavecom%2Fdkasyncimageview/lists"}