{"id":21373999,"url":"https://github.com/CoderZhuXH/XHToast","last_synced_at":"2025-07-13T08:31:56.026Z","repository":{"id":56927989,"uuid":"53716471","full_name":"CoderZhuXH/XHToast","owner":"CoderZhuXH","description":"简洁轻便提示工具,一行代码既可完成提示信息显示  - 支持自定义显示位置及停留时间","archived":false,"fork":false,"pushed_at":"2018-03-26T09:35:37.000Z","size":390,"stargazers_count":153,"open_issues_count":3,"forks_count":32,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-08T03:37:08.127Z","etag":null,"topics":["objcective-c","pod"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/CoderZhuXH.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":"2016-03-12T06:08:39.000Z","updated_at":"2023-04-14T13:22:48.000Z","dependencies_parsed_at":"2022-08-21T06:20:27.653Z","dependency_job_id":null,"html_url":"https://github.com/CoderZhuXH/XHToast","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/CoderZhuXH/XHToast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHToast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHToast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHToast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHToast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoderZhuXH","download_url":"https://codeload.github.com/CoderZhuXH/XHToast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoderZhuXH%2FXHToast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265109753,"owners_count":23712745,"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":["objcective-c","pod"],"created_at":"2024-11-22T08:29:38.103Z","updated_at":"2025-07-13T08:31:55.604Z","avatar_url":"https://github.com/CoderZhuXH.png","language":"Objective-C","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["Toast"],"readme":"# XHToast\n#### 简洁轻便提示工具,一行代码,既可完成提示信息显示.\n\n[![AppVeyor](https://img.shields.io/appveyor/ci/gruntjs/grunt.svg?maxAge=2592000)](https://github.com/CoderZhuXH/XHToast)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/CoderZhuXH/XHToast)\n[![Version Status](https://img.shields.io/cocoapods/v/XHToast.svg?style=flat)](http://cocoadocs.org/docsets/XHToast)\n[![Support](https://img.shields.io/badge/support-iOS%207%2B-brightgreen.svg)](https://github.com/CoderZhuXH/XHToast)\n[![Pod Platform](https://img.shields.io/cocoapods/p/XHToast.svg?style=flat)](http://cocoadocs.org/docsets/XHToast)\n[![Pod License](https://img.shields.io/cocoapods/l/XHToast.svg?style=flat)](https://github.com/CoderZhuXH/XHToast/blob/master/LICENSE)\n\n==============\n\n#### Swift版本请戳这里\u003e\u003e\u003e https://github.com/CoderZhuXH/XHToastSwift\n\n### 技术交流群(群号:537476189)\n\n## 效果\n![image](http://h.hiphotos.baidu.com/image/pic/item/023b5bb5c9ea15ce2973e439be003af33a87b264.jpg)\n\n## 使用方法\n### 1.普通调用\n```objc\n    \n    //您只需要调用一行代码,既可完成提示信息显示\n \n    //1.在window上显示toast\n\n    /**\n    中间显示\n    */\n    [XHToast showCenterWithText:@\"您要显示的提示信息\"];\n\n    /*\n    上方显示\n    */\n    [XHToast showTopWithText:@\"您要显示的提示信息\"];\n\n    /*\n    下方显示\n    */\n    [XHToast showBottomWithText:@\"您要显示的提示信息\"];\n\n\n    //2.你也可以这样调用,在view上显示toast\n\n    /**\n    *  中间显示\n    */\n    [self.view showXHToastCenterWithText:@\"您要显示的提示信息\"];\n\n    /**\n    *  上方显示\n    */\n    [self.view showXHToastTopWithText:@\"您要显示的提示信息\"];\n\n    /**\n    *  下方显示\n    */\n    [self.view showXHToastBottomWithText:@\"您要显示的提示信息\"];\n\n```\n### 2.自定义Toast停留时间+到屏幕上端/下端距离(见如下方法)\n\n#### 1.显示至window(通过XHToast调用)\n\n```objc\n#pragma mark-中间显示\n\n/**\n*  中间显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n+ (void)showCenterWithText:(NSString *)text duration:(CGFloat)duration;\n\n#pragma mark-上方显示\n\n/**\n*  上方显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n+ (void)showTopWithText:(NSString *)text duration:(CGFloat)duration;\n\n/**\n*  上方显示+自定义距顶端距离\n*\n*  @param text      内容\n*  @param topOffset 到顶端距离\n*/\n+ (void)showTopWithText:(NSString *)text topOffset:(CGFloat)topOffset;\n\n/**\n*  上方显示+自定义距顶端距离+自定义停留时间\n*\n*  @param text      内容\n*  @param topOffset 到顶端距离\n*  @param duration  停留时间\n*/\n+ (void)showTopWithText:(NSString *)text topOffset:(CGFloat)topOffset duration:(CGFloat)duration;\n\n#pragma mark-下方显示\n\n/**\n*  下方显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n+ (void)showBottomWithText:(NSString *)text duration:(CGFloat)duration;\n\n/**\n*  下方显示+自定义距底端距离\n*\n*  @param text         内容\n*  @param bottomOffset 距底端距离\n*/\n+ (void)showBottomWithText:(NSString *)text bottomOffset:(CGFloat)bottomOffset;\n\n/**\n*  下方显示+自定义距底端距离+自定义停留时间\n*\n*  @param text         内容\n*  @param bottomOffset 距底端距离\n*  @param duration     停留时间\n*/\n+ (void)showBottomWithText:(NSString *)text bottomOffset:(CGFloat)bottomOffset duration:(CGFloat)duration;\n\n```\n\n#### 2.在view上显示(通过view调用)\n\n```objc\n#pragma mark-中间显示\n\n/**\n*  中间显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n- (void)showXHToastCenterWithText:(NSString *)text duration:(CGFloat)duration;\n\n#pragma mark-上方显示\n\n/**\n*  上方显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n- (void)showXHToastTopWithText:(NSString *)text duration:(CGFloat)duration;\n\n/**\n*  上方显示+自定义距顶端距离\n*\n*  @param text      内容\n*  @param topOffset 到顶端距离\n*/\n- (void)showXHToastTopWithText:(NSString *)text topOffset:(CGFloat)topOffset;\n\n/**\n*  上方显示+自定义距顶端距离+自定义停留时间\n*\n*  @param text      内容\n*  @param topOffset 到顶端距离\n*  @param duration  停留时间\n*/\n- (void)showXHToastTopWithText:(NSString *)text topOffset:(CGFloat)topOffset duration:(CGFloat)duration;\n\n#pragma mark-下方显示\n\n/**\n*  下方显示+自定义停留时间\n*\n*  @param text     内容\n*  @param duration 停留时间\n*/\n- (void)showXHToastBottomWithText:(NSString *)text duration:(CGFloat)duration;\n\n/**\n*  下方显示+自定义距底端距离\n*\n*  @param text         内容\n*  @param bottomOffset 距底端距离\n*/\n- (void)showXHToastBottomWithText:(NSString *)text bottomOffset:(CGFloat)bottomOffset;\n\n/**\n*  下方显示+自定义距底端距离+自定义停留时间\n*\n*  @param text         内容\n*  @param bottomOffset 距底端距离\n*  @param duration     停留时间\n*/\n- (void)showXHToastBottomWithText:(NSString *)text bottomOffset:(CGFloat)bottomOffset duration:(CGFloat)duration;\n\n```\n\n##  安装\n### 1.手动添加:\u003cbr\u003e\n*   1.将 XHToast 文件夹添加到工程目录中\u003cbr\u003e\n*   2.导入 XHToast.h\n\n### 2.CocoaPods:\u003cbr\u003e\n*   1.在 Podfile 中添加 pod 'XHToast'\u003cbr\u003e\n*   2.执行 pod install 或 pod update\u003cbr\u003e\n*   3.导入 XHToast.h\n\n### 3.Tips\n*   1.如果发现pod search XHToast 搜索出来的不是最新版本，需要在终端执行cd desktop退回到desktop，然后执行pod setup命令更新本地spec缓存（需要几分钟），然后再搜索就可以了\n*   2.如果你发现你执行pod install后,导入的不是最新版本,请删除Podfile.lock文件,在执行一次 pod install\n\n##  系统要求\n*   该项目最低支持 iOS 7.0 和 Xcode 7.0\n\n##  许可证\nXHToast 使用 MIT 许可证，详情见 LICENSE 文件\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoderZhuXH%2FXHToast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCoderZhuXH%2FXHToast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCoderZhuXH%2FXHToast/lists"}