{"id":15038838,"url":"https://github.com/anelad/anactivityindicator","last_synced_at":"2025-04-10T00:03:31.226Z","repository":{"id":56900818,"uuid":"116611731","full_name":"anelad/ANActivityIndicator","owner":"anelad","description":"ANActivityIndicator is a pre-built indicator animations library written is Swift 5","archived":false,"fork":false,"pushed_at":"2022-01-05T07:21:03.000Z","size":87,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T15:51:45.881Z","etag":null,"topics":["activity-indicator","animation-library","framework","ios","swift4"],"latest_commit_sha":null,"homepage":"","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/anelad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-08T00:57:19.000Z","updated_at":"2024-09-04T12:16:12.000Z","dependencies_parsed_at":"2022-08-20T18:20:37.051Z","dependency_job_id":null,"html_url":"https://github.com/anelad/ANActivityIndicator","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anelad%2FANActivityIndicator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anelad%2FANActivityIndicator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anelad%2FANActivityIndicator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anelad%2FANActivityIndicator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anelad","download_url":"https://codeload.github.com/anelad/ANActivityIndicator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239084401,"owners_count":19578773,"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":["activity-indicator","animation-library","framework","ios","swift4"],"created_at":"2024-09-24T20:40:25.138Z","updated_at":"2025-02-16T03:31:37.036Z","avatar_url":"https://github.com/anelad.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"ANActivityIndicator\n============\n![iOS 12.0+](https://img.shields.io/badge/iOS-10.0%2B-blue.svg)\n![Swift 5.0+](https://img.shields.io/badge/Swift-4.0%2B-blue.svg)\n[![Version](https://img.shields.io/cocoapods/v/ANActivityIndicator.svg)](http://cocoapods.org/pods/ANActivityIndicator)\n\n\nANActivityIndicator is pre-built indicator animations library, based on [DGActivityIndicatorView](https://github.com/gontovnik/DGActivityIndicatorView) by [gotnovik](https://github.com/gontovnik) and [GTMActivityIndicatorView](https://github.com/GTMYang/GTMActivityIndicatorView) by [GTMYang](https://github.com/GTMYang) inspired from [loaders.css](https://github.com/ConnorAtherton/loaders.css) by [CONNOR ATHERTON](https://connoratherton.com).\n\n## Why did I create ANActivityIndicator in a seperate repo?\n\nFirst of all, I don't mean to get all the credits on this project. I did not do anything worthy comparing gotnovik's \u0026 GTMYang's works.\n\nSo why did I created ANActivityIndicator in a seperate repo?\n\nIt looks like gotnovik is not updating his repo and GTMYang's repo focuses on a bit different usage approach comparing mine.\n\n## General Differences\n\n### between DGActivityIndicatorView\n- Implemented with Swift\n\n### between GTMActivityIndicatorView\n- Implemented with Swift 5\n- Ready to use pre-built indicator animations. With GTMActivityIndicatorView, you have to add animations into your project manually.\n\n## Added Features\n- Custom animations structure (a struct like [NSNotification.Name](https://developer.apple.com/documentation/foundation/nsnotification.name)).\n- Custom loading message margin.\n\n# Demo\nCheck [Pre-Built Animation Types](#pre-built-animation-types) section to see animations' type.\n\n![demo-gif](https://user-images.githubusercontent.com/5767654/34675823-d101708e-f49b-11e7-9b65-94c1a844ba3d.gif)\n# Requirements\n- Swift 5\n- iOS 12.0 or higher\n\n# Installation\n\n## CocoaPods\n\n```ruby\npod 'ANActivityIndicator'\n```\n\n## Manually\n1. Download the [repo](https://github.com/anelad/ANActivityIndicator/archive/master.zip).\n\n### As Framework\n2. Copy `ANActivityIndicator` and `Source` folders into your workspace directory.\n3. Add `[workspace directory]/ANActivityIndicator/ANActivityIndicator.xcodeproj` into your \"workspace\".\n4. In `Project settings -\u003e General` add `ANActivityIndicator.framework` to `Embedded Binaries` \u0026 `Linked Framework and Libraries`\n\n### As SubProject\n2. Copy `ANActivityIndicator` and `Source` folders into your project directory.\n3. Add `ANActivityIndicator/ANActivityIndicator.xcodeproj` into your \"project\".\n\n### As Code\n2. Copy `ANActivityIndicator` and `Source` folders into your workspace / project directory.\n3. Add contents of `[workspace / project directory]/Source` folder into your workspace / project.\n\n# Usage\n\n## Import\nIf you installed as framework or subproject; first\n```swift\nimport ANActivityIndicator\n```\n\n## Initialization\n### As view\n```swift\nlet indicator = ANActivityIndicatorView.init(\n        frame: CGrect,\n        animationType: ANAnimationIndicatorType,\n        color: UIColor,\n        padding: CGFloat)\n\naView.addSubview(indicator)\n```\n ### For initialization as fullscreen; refer to [Show / Hide Indicator -\u003e As Full-Screen](#as-full-screen) section.\n\n## Show / Hide Indicator\nYou have to ways to show ANActivityIndicator\n\n### As view\n```swift\nlet indicator = ANActivityIndicatorView.init(...)\n\nindicator.startAnimating()\n\nindicator.stopAnimating()\n```\n\n\n### As Full-Screen\nYou can show full-screen indicator in every class.\n\n#### In UIViewController or its subclasses\n```swift\n//default\nshowIndicator()\n\nhideIndicator()\n```\n```swift\n//custom\nshowIndicator(\n        CGSize,\n        message: String,\n        messageFont: UIFont,\n        messageTopMargin: CGFloat,\n        animationType: ANActivityIndicatorAnimationType,\n        color: UIColor,\n        padding: CGFloat,\n        displayTimeThreshold: TimeIntervalInNanoseconds,\n        minimumDisplayTime: TimeIntervalInNanoseconds)\n\nhideIndicator()\n```\n\n#### In every class\n```swift\n//default\nANActivityIndicatorPresenter.shared.showIndicator()\n\nANActivityIndicatorPresenter.shared.hideIndicator()\n```\n```swift\n//custom\nANActivityIndicatorPresenter.shared.showIndicator(\n        CGSize,\n        message: String,\n        messageFont: UIFont,\n        messageTopMargin: CGFloat,\n        animationType: ANActivityIndicatorAnimationType,\n        color: UIColor,\n        padding: CGFloat,\n        displayTimeThreshold: TimeIntervalInNanoseconds,\n        minimumDisplayTime: TimeIntervalInNanoseconds)\n\nANActivityIndicatorPresenter.shared.hideIndicator()\n```\n\n## Pre-Built Animation Types\n\nHere are the list of pre-built animations. You can see their look in [Demo](#demo) section. (Ordered with numbers)\n\n1. .audioEqualizer\n2. .ballBeat\n3. .ballClipRotate\n4. .ballClipRotateMultiple\n5. .ballClipRotatePulse\n6. .ballGridBeat\n7. .ballGridPulse\n8. .ballPulse\n9. .ballPulseRise\n10. .ballPulseSync\n11. .ballRotate\n12. .ballRotateChase\n13. .ballScale\n14. .ballScaleMultiple\n15. .ballScaleRipple\n16. .ballScaleRippleMultiple\n17. .ballSpinFadeLoader\n18. .ballTrianglePath\n19. .ballZigZag\n20. .ballZigZagDeflect\n21. .blank\n22. .cubeTransition\n23. .lineScale\n24. .lineScaleParty\n25. .lineScalePulseOut\n26. .lineScalePulseOutRapid\n27. .lineSpinFadeLoader\n28. .orbit\n29. .pacman\n30. .semiCircleSpin\n31. .squareSpin\n32. .triangleSkewSpin\n\n## Custom Animations\n\nANActivityIndicator has a custom animation structure like `NSNotification.Name`.\n\n -  First create a class inherits from `ANActivityIndicatorAnimation` protocol:\n ```swift\nclass CustomIndicatorAnimation : ANActivityIndicatorAnimation{\n        required init() { }\n\n        func setUpAnimation(in layer: CALayer, size: CGSize, color: UIColor) {\n                ......\n                //implement your animation\n                //to learn how to implement, check example project or source codes.\n                .....\n        }\n}\n ```\n\n - Then add `ANActivityIndicatorAnimationType` for your custom animation:\n\n```swift\nextension ANActivityIndicatorAnimationType{\n        public static let customIndicatorAnimation = ANActivityIndicatorAnimationType.init(animation: CustomIndicatorAnimation.self)\n}\n```\n\n- Now you can call your custom animation via its type:\n```swift\nANActivityIndicatorAnimationType.customIndicatorAnimation\n```\n\n# Defaults\n\n- Animation type: \n```swift\nANActivityIndicatorAnimationType.ballSpinFadeLoader\n```\n- Color of indicator:\n```swift\nUIColor.white\n```\n- Padding of indicator:\n```swift\nCGFloat = 0\n```\n- Message:\n```swift\nString = \"\"\n```\n- Message font:\n```swift\nUIFont.boldSystemFont(ofSize: 20)\n```\n- Message margin to indicator:\n```swift\nCGFloat = 8\n```\n\n- Display time threshold:\n\u003eDefault time that has to be elapsed (between calls of startAnimating() and stopAnimating()) in order to actually display UI blocker. It should be set thinking about what the minimum duration of an activity is to be worth showing it to the user. If the activity ends before this time threshold, then it will not be displayed at all.\n```swift\nCGFloat = 0\n```\n- Minimum display time:\n\u003eDefault minimum display time of UI blocker. Its main purpose is to avoid flashes showing and hiding it so fast. For instance, setting it to 200ms will force UI blocker to be shown for at least this time (regardless of calling stopAnimating() ealier).\n```swift\nCGFloat = 0\n```\n- Fullscreen indiator default size:\n```swift\nCGSize.init(width: 60, height: 60)\n```\n# License\nThis project is under MIT License. Check [LICENSE](https://github.com/anelad/ANActivityIndicator/LICENSE) file.\n\n# Contribute\nI'm very welcome any contributions. Please read the [CONTRIBUTING](https://github.com/anelad/ANActivityIndicator/CONTRIBUTING.md) file.\n\n- Be sure you fulfill the `pull request template`.\n- Be sure your code passes TravisCI. (Not implemented yet.)\n\n# Issues\nPlease fulfill `issue template` before posting.\n\n# Authors\n- Base project created by [gotnovik](https://github.com/gontovnik).\n- Swift version implemented by [GTMYang](https://github.com/GTMYang).\n- Project inspired from [CONNOR ATHERTON](https://connoratherton.com)'s [project](https://github.com/ConnorAtherton/loaders.css).\n\n#### ANActivityIndicator implemented by\n\nArda Oğul Üçpınar.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanelad%2Fanactivityindicator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanelad%2Fanactivityindicator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanelad%2Fanactivityindicator/lists"}