{"id":13714722,"url":"https://github.com/liuzhiyi1992/WaveLoadingView","last_synced_at":"2025-05-07T03:30:55.552Z","repository":{"id":100099613,"uuid":"48898976","full_name":"liuzhiyi1992/WaveLoadingView","owner":"liuzhiyi1992","description":"a loading indicator like water wave","archived":false,"fork":false,"pushed_at":"2016-02-21T15:36:38.000Z","size":5348,"stargazers_count":569,"open_issues_count":1,"forks_count":74,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-06T04:12:12.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","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/liuzhiyi1992.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}},"created_at":"2016-01-02T04:48:17.000Z","updated_at":"2025-03-12T15:14:44.000Z","dependencies_parsed_at":"2023-05-06T00:01:21.584Z","dependency_job_id":null,"html_url":"https://github.com/liuzhiyi1992/WaveLoadingView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhiyi1992%2FWaveLoadingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhiyi1992%2FWaveLoadingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhiyi1992%2FWaveLoadingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuzhiyi1992%2FWaveLoadingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuzhiyi1992","download_url":"https://codeload.github.com/liuzhiyi1992/WaveLoadingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252806382,"owners_count":21807195,"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-08-03T00:00:39.909Z","updated_at":"2025-05-07T03:30:52.075Z","avatar_url":"https://github.com/liuzhiyi1992.png","language":"Objective-C","funding_links":[],"categories":["Project List"],"sub_categories":["WaveLoadingView"],"readme":"# WaveLoadingView\nA loading indicator like water wave\n\n###You can play a demo with [appetize.io](https://appetize.io/app/9upnjbk9hwjaz9hjyzuz41788c?device=iphone5s\u0026scale=75\u0026orientation=portrait\u0026osVersion=9.2)\n\n\n\u003cbr\u003e\n#**Features：**\n\n![](https://raw.githubusercontent.com/liuzhiyi1992/WaveLoadingView/master/WaveLoadingView/2016-01-19%2010_26_10.gif)\n\n\u003cbr\u003e\n#**Property：**\n- cycle —— 循环次数，在控件宽度范围内，该正弦函数图形循环的次数，数值越大控件范围内看见的正弦函数图形周期数越多，波长约短波浪也越陡。  \n- term —— 正弦周期，在layoutSubviews中根据cycle重新计算，==修改无效==  \n- phasePosition —— 正弦函数相位，==不可修改==，否则图形错乱  \n- amplitude —— 波幅，数值越大，波浪幅度越大，波浪越陡，反之越平缓，可通过代码调用`waveAmplitude`修改  \n- position —— 正弦曲线的X轴 相对于 控件Y坐标的位置，在-drawRect中通过progress计算，==修改无效==  \n- waveMoveSpan —— 波浪移动的单位跨度，数值越大波浪移动越快，数值过大会出现不连续动画现象  \n- animationUnitTime —— 重画单位时间，数值越小，重画速度越快频率越大  \n- heavyColor —— demo中较深的绿色部分  \n- lightColor —— demo中较浅的绿色部分  \n- clipCircleColor —— 玻璃球边界颜色  \n- clipCircleLineWidth —— 玻璃球边线宽度，可通过代码调用`borderWidth`修改  \n- progressTextFontSize —— 中央进度提示百分比字号大小\n\n\n\u003cbr\u003e\n#**Usage：**\n1. include the file WaveLoadingView.swift to your project, and about objectiveC, you can create a bridge Header and import it\n2. creat a waveLoadingIndicator instance\n```swift\nlet waveLoadingIndicator: WaveLoadingIndicator = WaveLoadingIndicator(frame: CGRectZero)\n```\n3. add waveLoadingIndicator to your imageView, equal bounds here i do , and FlexibleWidth,height\n```swift\nself.displayImageView.addSubview(self.waveLoadingIndicator)  \nself.waveLoadingIndicator.frame = self.displayImageView.bounds  \nself.waveLoadingIndicator.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]\n```\n4. and your can used combine with SDWebImage:\n```swift\nself.displayImageView.sd_setImageWithURL(url, placeholderImage: nil, options: .CacheMemoryOnly, progress: {\n    [weak self](receivedSize, expectedSize) -\u003e Void in\n    \n    guard let weakSelf = self else {\n        return\n    }\n    \n    weakSelf.waveLoadingIndicator.progress = Double(CGFloat(receivedSize)/CGFloat(expectedSize))\n    }) {\n        [weak self](image, error, _, _) -\u003e Void in\n        // 不要忘记在完成下载回调中，移除waveLoadingIndicator\n        guard let weakSelf = self else {\n            return\n        }\n        \n        weakSelf.waveLoadingIndicator.removeFromSuperview()\n}\n```\n\u003e \u003cbr\u003e\n\u003e Don't worry， after -removeFromSuperview(), the animation have been stop\n  \n##Relation  \n[@liuzhiyi1992](https://github.com/liuzhiyi1992) on Github  \n[WaveLoadingIndicator](http://zyden.vicp.cc/waveloadingindicator/) in my Blog  \n\n\n\u003cbr\u003e\n#**License：** \nWaveLoadingIndicator is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuzhiyi1992%2FWaveLoadingView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuzhiyi1992%2FWaveLoadingView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuzhiyi1992%2FWaveLoadingView/lists"}