Skip to content

Commit

Permalink
Add style to which the background can be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
krimpedance committed Mar 3, 2017
1 parent 3d2a6e8 commit 02e72cb
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 133 deletions.
2 changes: 1 addition & 1 deletion DEMO/KRProgressHUDDemo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion KRProgressHUD.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "KRProgressHUD"
s.version = "2.1.0"
s.version = "2.2.0"
s.summary = "A beautiful progress HUD for your iOS."
s.description = "KRProgressHUD is a beautiful and easy-to-use HUD meant to display the progress on iOS."
s.homepage = "https://github.com/krimpedance/KRProgressHUD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import UIKit
KRActivityIndicatorView's style

- Normal size(20x20)
- **Black:** the color is a gradation to `.lightGrayColor()` from `.blackColor()`.
- **White:** the color is a gradation to `UIColor(white: 0.7, alpha:1)` from `.whiteColor()`.
- **Color(startColor, endColor):** the color is a gradation to `endColor` from `startColor`.
- **black:** the color is a gradation to `.lightGray` from `.black`.
- **white:** the color is a gradation to `UIColor(white: 0.7, alpha:1)` from `.white`.
- **color(startColor, endColor):** the color is a gradation to `endColor` from `startColor`.


- Large size(50x50)
- **LargeBlack:** the color is same `.Black`.
- **LargeWhite:** the color is same `.White`.
- **LargeColor(startColor, endColor):** the color is same `.Color()`.
- **largeBlack:** the color is same `.black`.
- **largeWhite:** the color is same `.white`.
- **largeColor(startColor, endColor):** the color is same `.color()`.
*/
public enum KRActivityIndicatorViewStyle {
case black, white, color(UIColor, UIColor?)
Expand Down
222 changes: 121 additions & 101 deletions KRProgressHUD/Classes/KRProgressHUD.swift

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion KRProgressHUD/Classes/KRProgressHUDExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ extension UIApplication {
}
}

extension Thread {
extension DispatchQueue {
static func afterDelay(_ delayTime: Double, completion: @escaping () -> Void) {
let when = DispatchTime.now() + delayTime
DispatchQueue.global().asyncAfter(deadline: when, execute: completion)
Expand Down
2 changes: 1 addition & 1 deletion KRProgressHUD/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<string>2.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,9 @@
<img src="./Images/styles.png" height=300>

## Requirements
#### ver. 2.\* (current branch)
- iOS 9.0+
- Xcode 8.0+
- Swift 3.\*

#### ver. 1.\*(1.7.0 and over)
- iOS 8.0+
- Xcode 8.0+
- Swift 2.3.\*
- Swift 3.0+

## DEMO
To run the example project, clone the repo, and open `KRProgressHUDDemo.xcodeproj` from the DEMO directory.
Expand Down Expand Up @@ -54,7 +48,6 @@ github "Krimpedance/KRProgressHUD"
**If you want to use it with other cases (ex. pull to refresh), I suggest using [KRActivityIndicatorView](https://github.com/krimpedance/KRActivityIndicator).**



`KRProgressHUD` is created as a singleton.

At first, import `KRProgressHUD` in your swift file.
Expand Down Expand Up @@ -149,9 +142,10 @@ public class func set(centerPosition: CGPoint) // Default is center of device s

## Contributing to this project
I'm seeking bug reports and feature requests.
(And please teach me if my English is wrong :| )

## Release Note
- 2.2.0 : Add `KRProgressHUDStyle.color(background: UIColor, contents: UIColor)`.
This can set custom color of HUD's background and contents(text, glyph icon).
- 2.1.0 : Add function to which indicate HUD with only message.
Default font was changed to system font.
- 2.0.0 : Corresponding to Swift3.
Expand Down
17 changes: 4 additions & 13 deletions README_Ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,9 @@
<img src="./Images/styles.png" height=300>

## 必要環境
#### ver. 2.\*系 (現在のバージョン)
- iOS 9.0+
- Xcode 8.0+
- Swift 3.\*

#### ver. 1.\*系(1.7.0以上)
- iOS 8.0+
- Xcode 8.0+
- Swift 2.3.\*

#### ver. 1.\*系(1.7.0未満)
- iOS 8.0+
- Xcode 7.\*
- Swift 2.2.\*
- Swift 3.0+

## デモ
`DEMO/`以下にあるサンプルプロジェクトから確認してください.
Expand Down Expand Up @@ -62,7 +51,7 @@ github "Krimpedance/KRProgressHUD"

**PullRefreshなど,他の場面で使用したい場合は,[KRActivityIndicatorView](https://github.com/krimpedance/KRActivityIndicator)を使用することをお勧めします**

  

`KRProgressHUD`はシングルトンパターンで作られています.

まず,`KRProgressHUD`をインポートします.
Expand Down Expand Up @@ -155,6 +144,8 @@ public class func set(centerPosition: CGPoint) // デフォルト: デバイス
バグや機能のリクエストがありましたら,気軽にコメントしてください.

## リリースノート
- 2.2.0 : `KRProgressHUDStyle.color(background: UIColor, contents: UIColor)` を追加しました.
このスタイルを用いることで, HUDの背景, コンテンツ(テキスト, アイコン)の色をカスタマイズできます.
- 2.1.0 : テキストだけのHUDを表示する機能を追加.
標準フォントをシステムフォントに変更しました.
- 2.0.0 : Swift3に対応
Expand Down

0 comments on commit 02e72cb

Please sign in to comment.