{"id":2292,"url":"https://github.com/Swiftify-Corp/IHProgressHUD","last_synced_at":"2025-08-02T23:32:45.461Z","repository":{"id":33763928,"uuid":"158723037","full_name":"Swiftify-Corp/IHProgressHUD","owner":"Swiftify-Corp","description":"A clean and lightweight progress HUD based on SVProgressHUD, converted to Swift with the help of Swiftify.","archived":false,"fork":false,"pushed_at":"2023-10-08T03:34:15.000Z","size":672,"stargazers_count":254,"open_issues_count":7,"forks_count":46,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-04-24T14:46:47.984Z","etag":null,"topics":["activity-indicator","cocoapods","hud","ios","progress-circle","svprogresshud","swift4","tvos"],"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/Swiftify-Corp.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-11-22T16:04:59.000Z","updated_at":"2024-03-26T20:50:55.000Z","dependencies_parsed_at":"2024-04-24T11:01:30.897Z","dependency_job_id":"aa6c49b6-1328-4494-ba29-7526fd13dc1e","html_url":"https://github.com/Swiftify-Corp/IHProgressHUD","commit_stats":{"total_commits":61,"total_committers":9,"mean_commits":6.777777777777778,"dds":0.3770491803278688,"last_synced_commit":"516a4102f01425a3a3d5f7be397986da93ebd09a"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftify-Corp%2FIHProgressHUD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftify-Corp%2FIHProgressHUD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftify-Corp%2FIHProgressHUD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swiftify-Corp%2FIHProgressHUD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swiftify-Corp","download_url":"https://codeload.github.com/Swiftify-Corp/IHProgressHUD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228503168,"owners_count":17930527,"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","cocoapods","hud","ios","progress-circle","svprogresshud","swift4","tvos"],"created_at":"2024-01-05T20:16:10.028Z","updated_at":"2024-12-06T17:30:56.966Z","avatar_url":"https://github.com/Swiftify-Corp.png","language":"Swift","readme":"# IHProgressHUD\n\n`IHProgressHUD` is a clean and easy-to-use HUD meant to display the progress of an ongoing task on iOS and tvOS. `IHProgressHUD` is based on [SVProgressHUD](https://github.com/SVProgressHUD/SVProgressHUD) and ported to Swift with the [help of Swiftify](https://medium.com/swiftify/converting-svprogresshud-to-swift-using-swiftify-27be1817b7f6),\nwith improvements like added thread safety and not using complier flag for use in iOS App Extension. \n\nIf you are interested in learning more about the conversion process, please [checkout](https://medium.com/swiftify/converting-svprogresshud-to-swift-using-swiftify-27be1817b7f6).\n\n![IHProgressHUD](https://www.mobintouch.com/wp-content/uploads/2019/05/SVProgressHUD.gif)\n\n## Demo        \n\nTry `IHProgressHUD` on [Appetize.io](https://appetize.io/app/hn358rg7zc8uyethqayub23h2c).\n\n\n## Installation\n\n### From CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C and Swift, which automates and simplifies the process of using 3rd-party libraries like `IHProgressHUD` in your projects. First, add the following line to your [Podfile](http://guides.cocoapods.org/using/using-cocoapods.html):\n\n```ruby\npod 'IHProgressHUD'\n```\n\nIf you want to use the latest features of `IHProgressHUD` use normal external source dependencies.\n\n```ruby\npod 'IHProgressHUD', :git =\u003e 'https://github.com/Swiftify-Corp/IHProgressHUD.git'\n```\n\nThis pulls from the `master` branch directly.\n\nSecond, install `IHProgressHUD` into your project:\n\n```ruby\npod install\n```\n\n### From SwiftPM\n\nUnder your project from the `File` menu, go to `Swift Packages` and select `Add Package Dependency`\n\nEnter the address of the repository for the package you wish to add.\n- https://github.com/Swiftify-Corp/IHProgressHUD.git\n\nAfter you hit `Next`, you’ll see another form. From here you’re able to specify which `version`, `branch`, or `commit hash` you’d like to add as a dependency.\n\nAfter you click `Next`, Xcode will fetch the dependency. In this final window, make sure the package you want to add is checked and the target you wish to add it to is selected from the dropdown.\n\nAfter you click Finish, you’ll see that the added package is now listed in the navigator under a new section titled `Swift Package Dependencies`.\n\n#### To Remove the package\n\nIf you need to remove a SwiftPM package from your project, you can select the project at the top of the navigator, then look for the tab titled `Swift Packages`. (It’s next to `Build Settings`). \n\n## Usage\n\n`IHProgressHUD` is created as a singleton (i.e. it doesn't need to be explicitly allocated and instantiated; you directly call `IHProgressHUD.method()`). It can be accessed from even the background thread.\n\n**Use `IHProgressHUD` wisely! Only use it if you absolutely need to perform a task before taking the user forward. Bad use case examples: pull to refresh, infinite scrolling, sending message.**\n\nUsing `IHProgressHUD` in your app will usually look as simple as this (using Grand Central Dispatch):\n\n```Swift\nIHProgressHUD.show()\nDispatchQueue.global(qos: .default).async(execute: {\n// time-consuming task\nIHProgressHUD.dismiss()\n})\n```\n\n### Showing the HUD\n\nYou can show the status of indeterminate tasks using one of the following:\n\n```Swift\nclass func show()\nclass func show(withStatus status: String?)\n```\n\nIf you'd like the HUD to reflect the progress of a task, use one of these:\n\n```Swift\nclass func show(progress: CGFloat)\nclass func show(progress: CGFloat, status: String?)\n```\n\n### Dismissing the HUD\n\nThe HUD can be dismissed using:\n\n```Swift\nclass func dismiss()\nclass func dismissWithCompletion(_ completion: (() -\u003e Void)?)\nclass func dismissWithDelay(_ delay: TimeInterval)\nclass func dismissWithDelay(_ delay: TimeInterval, completion: (() -\u003e Void)?)\n```\n\nIf you'd like to stack HUDs, you can balance out every show call using:\n\n```\nclass func popActivity()\n```\n\nThe HUD will get dismissed once the popActivity calls will match the number of show calls.\n\nOr show a confirmation glyph before before getting dismissed a little bit later. The display time depends on `minimumDismissTimeInterval` and the length of the given string.\n\n```Swift\nclass func showInfowithStatus(_ status: String?)\nclass func showSuccesswithStatus(_ status: String?)\nclass func showError(withStatus status: String?)\nclass func showImage(_ image: UIImage, status: String?)\n```\n\n## Customization\n\n`IHProgressHUD` can be customized via the following methods:\n\n```Swift\nclass func set(defaultStyle style: IHProgressHUDStyle) // default is IHProgressHUDStyle.light\n\nclass func set(defaultMaskType maskType: IHProgressHUDMaskType) // default is IHProgressHUDMaskType.none\n\nclass func set(defaultAnimationType type: IHProgressHUDAnimationType) // default is IHProgressHUDAnimationType.flat\n\nclass func set(containerView: UIView?) // default is window level\n\nclass func set(minimumSize: CGSize) // default is CGSize.zero, can be used to avoid resizing\n\nclass func set(ringThickness: CGFloat) // default is 2 pt\n\nclass func set(ringRadius : CGFloat) // default is 18 pt\n\nclass func setRing(noTextRingRadius radius: CGFloat) // default is 24 pt\n\nclass func set(cornerRadius: CGFloat) // default is 14 pt\n\nclass func set(borderColor color : UIColor) // default is nil\n\nclass func set(borderWidth width: CGFloat)  // default is 0\n\nclass func set(font: UIFont) // default is UIFont.preferredFont(forTextStyle: .subheadline)\n\nclass func set(foregroundColor color: UIColor) // default is nil\n\nclass func set(backgroundColor color: UIColor) // default is nil\n\nclass func set(backgroundLayerColor color: UIColor) // default is UIColor(white: 0, alpha: 0.4), only used for IHProgressHUDMaskType.custom\n\nclass func set(imageViewSize size: CGSize) // default is 28x28 pt\n\nclass func set(shouldTintImages: Bool) // default is true\n\nclass func set(infoImage image: UIImage) // default is the bundled info image provided by Freepik\n\nclass func setSuccessImage(successImage image: UIImage) // default is bundled success image from Freepik\n\nclass func setErrorImage(errorImage image: UIImage) // default is bundled error image from Freepik\n\nclass func set(viewForExtension view: UIView) // default is nil, only used for App Extension\n\nclass func set(graceTimeInterval interval: TimeInterval) // default is 5.0 seconds\n\nclass func set(maximumDismissTimeInterval interval: TimeInterval) // default is TimeInterval(CGFloat.infinity)\n\nclass func setFadeInAnimationDuration(fadeInAnimationDuration duration: TimeInterval) // default is 0.15 seconds\n\nclass func setFadeOutAnimationDuration(fadeOutAnimationDuration duration: TimeInterval) // default is 0.15 seconds\n\nclass func setMaxSupportedWindowLevel(maxSupportedWindowLevel windowLevel: UIWindow.Level) // default is UIWindowLevelNormal\n\nclass func setHapticsEnabled(hapticsEnabled: Bool) // default is NO\n```\n\n### Hint\n\nAs standard `IHProgressHUD` offers two preconfigured styles:\n\n* `IHProgressHUDStyle.light`: White background with black spinner and text\n* `IHProgressHUDStyle.dark`: Black background with white spinner and text\n\nIf you want to use custom colors use `setForegroundColor` and `setBackgroundColor:`. These implicitly set the HUD's style to `IHProgressHUDStyle.custom`.\n\n## Haptic Feedback\n\nFor users with newer devices (starting with the iPhone 7), `IHProgressHUD` can automatically trigger haptic feedback depending on which HUD is being displayed. The feedback maps as follows:\n\n* `showSuccessWithStatus:` \u003c-\u003e `UINotificationFeedbackTypeSuccess`\n* `showInfoWithStatus:` \u003c-\u003e `UINotificationFeedbackTypeWarning`\n* `showErrorWithStatus:` \u003c-\u003e `UINotificationFeedbackTypeError`\n\nTo enable this functionality, use `setHapticsEnabled:`.\n\nUsers with devices prior to iPhone 7 will have no change in functionality.\n\n## Notifications\n\n`IHProgressHUD` posts four notifications via `NSNotificationCenter` in response to being shown/dismissed:\n* `NotificationName.IHProgressHUDWillAppear` when the show animation starts\n* `NotificationName.IHProgressHUDDidAppear` when the show animation completes\n* `NotificationName.IHProgressHUDDidDisappear` when the dismiss animation starts\n* `NotificationName.IHProgressHUDDidAppear` when the dismiss animation completes\n\nEach notification passes a `userInfo` dictionary holding the HUD's status string (if any), retrievable via `[NotificationName.IHProgressHUDStatusUserInfoKey.getNotificationName()]`.\n\n`IHProgressHUD` also posts `IHProgressHUDDidReceiveTouchEvent` when users touch on the overall screen or `IHProgressHUDDidTouchDownInside` when a user touches on the HUD directly. For this notifications `userInfo` is not passed but the object parameter contains the `UIEvent` that related to the touch.\n\n## App Extensions\n\nWhen using `IHProgressHUD` in an App Extension,  use the `class func set(viewForExtension view: UIView)` there is no need to set any complier flag.  \n\n## Contributing to this project\n\nIf you have feature requests or bug reports, feel free to help out by sending pull requests or by [creating new issues](https://github.com/ibrahimhass/IHProgressHUD/issues/new). Please take a moment to\nreview the guidelines written by [Nicolas Gallagher](https://github.com/necolas):\n\n* [Bug reports](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md#bugs)\n* [Feature requests](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md#features)\n* [Pull requests](https://github.com/necolas/issue-guidelines/blob/master/CONTRIBUTING.md#pull-requests)\n\n## License\n\n`IHProgressHUD` is distributed under the terms and conditions of the [MIT license](https://github.com/Swiftify-Corp/IHProgressHUD/blob/master/LICENSE). The success, error and info icons are made by [Freepik](http://www.freepik.com) from [Flaticon](http://www.flaticon.com) and are licensed under [Creative Commons BY 3.0](http://creativecommons.org/licenses/by/3.0/).\n\n## Credits\n\n`IHProgressHUD` is brought to you by [Md Ibrahim Hassan](https://github.com/Ibrahimhass) and [contributors to the project](https://github.com/Swiftify-Corp/IHProgressHUD/graphs/contributors).\nIf you're using `IHProgressHUD` in your project, attribution would be very appreciated. This project is converted with the help of [Swiftify](https://swiftify.com/).\n","funding_links":[],"categories":["UI"],"sub_categories":["Activity Indicator"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftify-Corp%2FIHProgressHUD","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwiftify-Corp%2FIHProgressHUD","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwiftify-Corp%2FIHProgressHUD/lists"}