{"id":22938635,"url":"https://github.com/szlsay/stkitswift","last_synced_at":"2025-08-12T18:33:32.695Z","repository":{"id":62454450,"uuid":"53903617","full_name":"szlsay/STKitSwift","owner":"szlsay","description":"STKitSwift is a collection of useful classes and categories to develop Apps faster. ","archived":false,"fork":false,"pushed_at":"2020-03-31T09:54:50.000Z","size":5237,"stargazers_count":55,"open_issues_count":2,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-29T21:33:48.553Z","etag":null,"topics":["ios12","swift5","xcode10"],"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/szlsay.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-15T01:07:49.000Z","updated_at":"2024-08-20T03:43:41.000Z","dependencies_parsed_at":"2022-11-01T22:46:32.525Z","dependency_job_id":null,"html_url":"https://github.com/szlsay/STKitSwift","commit_stats":null,"previous_names":["stshenzhaoliang/stkitswift"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szlsay%2FSTKitSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szlsay%2FSTKitSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szlsay%2FSTKitSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szlsay%2FSTKitSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szlsay","download_url":"https://codeload.github.com/szlsay/STKitSwift/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229701047,"owners_count":18110079,"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":["ios12","swift5","xcode10"],"created_at":"2024-12-14T12:20:04.978Z","updated_at":"2024-12-14T12:20:06.621Z","avatar_url":"https://github.com/szlsay.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STKitSwift\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"Resources/Banner.png\" alt=\"STKitSwift Banner\"\u003e\n\u003c/p\u003e\n\n[![Platform](https://img.shields.io/cocoapods/p/STKitSwift.svg?style=flat)](https://github.com/STShenZhaoliang/STKitSwift)\n![Version](https://img.shields.io/cocoapods/v/STKitSwift.svg?style=flat)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![Language](https://img.shields.io/badge/language-Swift%205.0-orange.svg)](https://swift.org/)\n[![License](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/STShenZhaoliang/STKitSwift/blob/master/LICENSE)\n\n\nSTKitSwift is a collection of useful classes, structs and extensions to **develop Apps faster**.\n\nInstalling and Usage\n====================\n\n```ruby\n\n    platform :ios, '10.0'\n    xcodeproj 'Project.xcodeproj'\n    use_frameworks!\n    pod 'STKitSwift'\n    \n```\n\nEffect Picture\n====================\n\u003cimg src=\"Resources/STAlertView01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STAlertView02.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STGradientButton01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STGradientView01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STHUD01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STHUD02.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STMoveButton01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STPhoneTextField01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STProgressView01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STSegmentedControl01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STTimerButton01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STAreaPickerView01.png\" width=\"25%\" height=\"25%\"\u003e\u003cimg src=\"Resources/STDatePickerView01.png\" width=\"25%\" height=\"25%\"\u003e\n\n\nChangelog\n====================\n\n## 1.1\n\n\n| 名称 | 功能描述 | 状态 |\n| --- | --- | --- |\n| [STAlertView](#STAlertView) | UIAlertController在alert风格下的封装 | 新增 |\n| [STGradientButton](#STGradientButton) | 支持渐变色功能的按钮 | 新增 |\n| [STGradientView](#STGradientView) | IB支持渐变色、阴影功能的视图 | 新增 |\n| [STHUD](#STHUD) | 弱提示框 | 新增 |\n| [STMoveButton](#STMoveButton) | 可移动按钮 | 新增 |\n| [STPhoneTextField](#STPhoneTextField) | 指定文本显示样式与文本正则的手机号输入框 | 新增 |\n| [STProgressView](#STProgressView) | 支持渐变色功能的进度框 | 新增 |\n| [STSegmentedControl](#STSegmentedControl) | 根据内容偏移的分段选择器 | 新增 |\n\n\n## 1.2\n\n| 名称 | 功能描述 | 状态 |\n| --- | --- | --- |\n| [STTimerButton](#STTimerButton) | 支持计时与倒计时的按钮 | 新增 |\n| [STAreaPickerView](#STAreaPickerView) | 省市区选择器 | 新增 |\n| [STDatePickerView](#STDatePickerView) | 年月日选择器 | 新增 |\n\n## 1.3\n| 名称 | 功能描述 | 状态 |\n| --- | --- | --- |\n| [STHUD](#STHUD) | 支持图片与文本提示 | 更新 |\n\n## STAlertView\n\n### Installing\n\n```ruby\npod 'STKitSwift/STAlertView'\n```\n\n### Example\n\n```swift\nlet title = \"Flutter 与 iOS 原生 WebView 对比\"\nSTAlertView.show(title: title, message: nil, cancelTitle: \"取消\", otherTitle: \"确定\") { (item) in\n    print(item)\n}\n```\n\n## STGradientButton\n\n### Installing\n\n``` ruby\npod 'STKitSwift/STGradientButton'\n```\n\n### Example\n\n```swift\n    private lazy var gradientButton: STGradientButton = {\n        let gradientButton = STGradientButton()\n        gradientButton.startColor = UIColor.init(red: 255.0/255, green: 76.0/255, blue: 21.0/255, alpha: 1)\n        gradientButton.endColor =  UIColor.init(red: 255.0/255, green: 156.0/255, blue: 121.0/255, alpha: 1)\n        gradientButton.setTitle(\"使用layer\", for: .normal)\n        gradientButton.layer.cornerRadius = 22\n        gradientButton.layer.masksToBounds = true\n        view.addSubview(gradientButton)\n        return gradientButton\n    }()\n```\n\n## STGradientView\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STGradientView'\n```\n\n## STHUD\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STHUD'\n```\n\n### Example\n\n```swift\nSTHUD.show(\"Hello World\")\n```\n\n## STMoveButton\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STMoveButton'\n```\n\n### Example\n\n```swift\nprivate lazy var moveButton: STMoveButton = {\n    let moveButton = STMoveButton()\n    moveButton.setImage(UIImage.init(named: \"icon_wheel\"), for: .normal)\n    view.addSubview(moveButton)\n    return moveButton\n    }()\n```\n\n## STPhoneTextField\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STPhoneTextField'\n```\n\n### Example\n\n```swift\nlet tf3 = STPhoneTextField()\ntf3.config.defaultConfig = STPhoneFormat.init(defaultPhoneFormat: \"(####) #######\")\ntf3.prefix = \"+86 \"\ntf3.placeholder = \"format:+86 (####) #######\"\n```\n\n## STProgressView\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STProgressView'\n```\n\n## STSegmentedControl\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STSegmentedControl'\n\n```\n\n### Example\n\n```swift\nlet titles = [\"关注\", \"推荐\", \"国际\", \"娱乐\", \"视频\", \"科技\", \"军事\", \"设计\", \"体育\", \"读书\"]\nlet segmentedControl = STSegmentedControl()\nsegmentedControl.titles = titles\nsegmentedControl.selectBlock = { (item) in\n            print(item)\n        }\nsegmentedControl.currentIndex = 3\n```\n\n## STTimerButton\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STTimerButton'\n\n```\n\n### Example\n\n```swift\nbuttonCode.startCountDown(duration: 10) { (button, type, time)  in\nprint(\"button = \\(button) type = \\(type) time = \\(time)\")\n    switch type {\n    case .start:\n        button.isEnabled = false\n        button.setTitle(time.description + \"s\", for: .normal)\n        button.backgroundColor = .gray\n    case .ongoing:\n        button.isEnabled = false\n        button.setTitle(time.description + \"s\", for: .normal)\n        button.backgroundColor = .gray\n    case .finish:\n        button.isEnabled = true\n        button.setTitle(\"重新发送\", for: .normal)\n        button.backgroundColor = .red\n    default:\n        button.isEnabled = true\n    }\n}\n```\n## STAreaPickerView\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STAreaPickerView'\n\n```\n\n### Example\n\n```swift\nSTAreaPickerView.show(inView: view) { [weak self](provinceName, provinceCode, cityName, cityCode, areaName, areaCode) in\n\n}\n```\n\n## STDatePickerView\n\n### Installing and Usage\n\n```\npod 'STKitSwift/STDatePickerView'\n\n```\n\n### Example\n\n```swift\nSTDatePickerView.show(minimumDateStr: \"1900-01-01\",\n                              maximumDateStr: \"3000-01-01\",\n                              currentDateStr: \"2019-06-04\")\n        { (year, month, day)in\n            print(\"year = \\(year)  month = \\(month)  day = \\(day)\")\n        }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszlsay%2Fstkitswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszlsay%2Fstkitswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszlsay%2Fstkitswift/lists"}