{"id":13342751,"url":"https://github.com/ornwoo96/GIFO","last_synced_at":"2025-03-12T02:32:36.995Z","repository":{"id":191913606,"uuid":"610236800","full_name":"ornwoo96/GIFO","owner":"ornwoo96","description":"[iOS Library] GIF 이미지","archived":false,"fork":false,"pushed_at":"2023-04-22T10:21:13.000Z","size":73,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-30T21:05:17.204Z","etag":null,"topics":["cadisplaylink","gif-animation","ios","swift","uikit","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ornwoo96.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-06T11:21:51.000Z","updated_at":"2023-04-20T14:54:13.000Z","dependencies_parsed_at":"2023-09-01T13:59:23.218Z","dependency_job_id":"cd4e0eb0-e4e6-46c5-b119-207a7a006cc2","html_url":"https://github.com/ornwoo96/GIFO","commit_stats":null,"previous_names":["ornwoo96/gifo"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ornwoo96%2FGIFO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ornwoo96%2FGIFO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ornwoo96%2FGIFO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ornwoo96%2FGIFO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ornwoo96","download_url":"https://codeload.github.com/ornwoo96/GIFO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221265581,"owners_count":16788059,"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":["cadisplaylink","gif-animation","ios","swift","uikit","xcode"],"created_at":"2024-07-29T19:30:03.287Z","updated_at":"2024-10-24T02:30:30.072Z","avatar_url":"https://github.com/ornwoo96.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GIFO\n\u003cimg src = \"https://user-images.githubusercontent.com/73861795/231753782-a3fa9ef3-40b8-4d46-becb-8c678461f41d.gif\" width=\"320\" height=\"153\"/\u003e\n\nGIFO is a GIF library made with UIKit.\n\n\u003cimg src=\"https://img.shields.io/badge/Swift-5.4-orange?style=gor-the-badge\u0026logo=Swift\u0026logoColor=F05138\"/\u003e \u003cimg src=\"https://img.shields.io/badge/Platforms-iOS-blue?style=gor-the-badge\u0026logo=\u0026logoColor=\"/\u003e\n\n\u003cbr/\u003e\n\n## Install\nSwift Package Manager\n\nAdd the following to your `Package.swift` file:\n~~~Swift\nlet package = Package(\n    dependencies: [\n    .package(url: \"https://github.com/ornwoo96/GIFO.git\", from: \"1.0.0\")\n    ],\n)\n~~~\n\n\u003cbr/\u003e\n\n## How it Works\nGIFO uses an `Animator` with CADisplayLink and a `FrameFactory` to implement GIF animation. The GIF data is passed to the `FrameFactory`, which creates multiple frames. The `Animator` updates the image at a set timing for each frame according to the device's environment, allowing the GIF animation to be displayed.\n\nGIFO 라이브러리는 CADisplayLink를 가지고 있는 `Animator`와 `FrameFactory`로 GIF Animation을 구현하였습니다. \nGIF 데이터는 `FrameFactory`에 전달되어 여러 프레임을 생성합니다.\n`Animator`는 기기 환경에 따라 `FrameFactory`에 있는 이미지들를 설정된 타이밍에 업데이트하여 GIF 애니메이션을 보여줍니다. \n\n\n\u003cbr/\u003e\n\nGIFO implements GIF animation in two ways:\n\n\u003e### UIImage.animatedImage\n\n~~~Swift\n@available(iOS 5.0, *)\nopen class func animatedImage(with images: [UIImage], duration: TimeInterval) -\u003e UIImage?\n~~~\n\n\u003cimg src = \"https://user-images.githubusercontent.com/73861795/211813537-14e1f41b-2c61-4832-bd74-0390a24be38b.gif\" width=\"231\" height=\"500\"/\u003e\n\n- The first method uses UIImage.animatedImages to create an animation using multiple GIFs, which is useful in environments where multiple GIFs need to be used.\n\n- 첫 번째 방법은 UIImage.animatedImages를 사용하여 애니메이션을 보여주는 것입니다. 이는 여러 개의 GIF를 사용해야 하는 환경에서 유용합니다.\n\n\u003cbr/\u003e\n\n\u003e### CADisplayLink\n\n~~~Swift\n@available(iOS 3.1, *)\nopen class CADisplayLink : NSObject { ... }\n~~~\n\n\u003cimg src = \"https://user-images.githubusercontent.com/73861795/211813909-371ff687-5169-4dd1-8383-e3ac1cf44219.gif\" width=\"231\" height=\"500\"/\u003e\n\n- The second method uses CADisplayLink to display high-quality GIFs. This method is used when displaying high-quality GIFs is a priority.\n\n- 두 번째 방법은 CADisplayLink를 사용하여 고품질 GIF를 표시합니다. 이 방법은 고품질 GIF 표시가 우선 순위인 경우에 사용됩니다.\n\n\u003cbr/\u003e\n\n## Example Code\n\n\u003e### UIImage.animatedImage - Animation Setup\n~~~Swift\nlet imageView = GIFOImageView()\n\nimageView.setupGIFImageWithUIImage(url: ImageURL,\n                                   cacheKey: CacheKey,\n                                   isCache: true,\n\t\t                   resize: CGSize(width: 100, height: 100),\n\t\t                   level: GIFFrameReduceLevel = .highLevel) {\n\t// animation autoplay Infinity\n}\n~~~\n\n- The setupGIFImageWithUIImage function can reduce the number of frames by level and reduce data by resizing. The animation of this function cannot be stopped or started at will. The animation will automatically start as soon as the setup is complete.\n\n- setupGIFImageWithUIImage 함수는 레벨에 따라 프레임 수를 줄이고 크기를 조정하여 데이터를 줄일 수 있습니다. 이 함수의 애니메이션은 원하는 대로 중지하거나 시작할 수 없습니다. 설정이 완료되면 애니메이션은 자동으로 시작됩니다.\n\n\u003cbr/\u003e\n\n\u003e### UIImage.animatedImage - clear\n~~~Swift\nimageView.clearWithUIImage()\n~~~\n\n\u003cbr/\u003e\n\n\u003e### CADisplayLink - setup\n~~~Swift\nlet imageView = GIFOImageView()\n\nimageView.setupGIFImageWithDisplayLink(url: ImageURL,\n                                       cacheKey: CacheKey,\n                                       isCache: true,\n\t\t                       resize: CGSize(width: 100, height: 100),\n\t\t                       loopCount: Int = 0, // 0 == Infinity\n\t\t                       level: GIFFrameReduceLevel = .highLevel) {\n\t// animation autoplay\n}\n~~~\n\n- The setupGIFImageWithDisplayLink function also uses level and resize to reduce the number of frames, and additionally allows setting the number of animation loops with loopCount. Like the setupGIFImageWithUIImage function, it also automatically starts the animation upon setup.\n\n- setupGIFImageWithDisplayLink 함수는 level과 resize를 사용하여 프레임 수를 줄이는 것 외에도 loopCount를 사용하여 애니메이션 루프 수를 설정할 수 있습니다. UIImage로 구성된 애니메이션과 마찬가지로 설정이 완료되면 애니메이션은 자동으로 시작됩니다.\n\n\u003cbr/\u003e\n\n\u003e### CADisplayLink - Animation Start / Stop\n~~~Swift\nimageView.stopAnimationWithDisplayLink() // start GIF Animation\n~~~\n\n~~~Swift\nimageView.startAnimationWithDisplayLink() // stop GIF Animation\n~~~\n\n\u003cbr/\u003e\n\n## Documentation\nSee the Full API Documentation\n\n\u003cbr/\u003e\n\n## Compatibility\n- iOS 9.0+\n- Swift 5.4\n- Xcode 12.5\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fornwoo96%2FGIFO","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fornwoo96%2FGIFO","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fornwoo96%2FGIFO/lists"}