diff --git a/Assets/completion_types.gif b/Assets/completion_types.gif new file mode 100644 index 0000000..7d96479 Binary files /dev/null and b/Assets/completion_types.gif differ diff --git a/Assets/custom_pattern.gif b/Assets/custom_pattern.gif new file mode 100644 index 0000000..f9a1837 Binary files /dev/null and b/Assets/custom_pattern.gif differ diff --git a/Assets/format.gif b/Assets/format.gif new file mode 100644 index 0000000..a9505ae Binary files /dev/null and b/Assets/format.gif differ diff --git a/README.md b/README.md index ea7af28..dfd96d2 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,13 @@ Four completion types have been built to display extra useful information to the ``` swift mySpinner.succeed("Passed") ``` +

+
+ +
+
+

+ #### Spinner Format The spinner object has a default format of `{S} {T}`, this renders the animated pattern before the text with a space between. By passing a string with a new format to the initializer or calling `.updateFormat(String)` you can use a custom format. Any String character can be used within the format string and will be permanently rendered, only the following will be replaced: - `{S}` Renders the animated pattern @@ -97,12 +104,26 @@ The spinner object has a default format of `{S} {T}`, this renders the animated ``` swift let mySpinner = Spinner(.dots, "My Spinner", format : "{T} - {S}") ``` +

+
+ +
+
+

+ #### Creating Custom Patterns We have **60** animated spinner patterns, however to create your own, define a new `SpinnerPattern(multiFrame: [String])`. The default speed for multi frame patterns is 0.08, to change this pass a double into the spinner initializer. ``` swift let customPattern = SpinnerPattern(multiFrame: ["1","2","3","4","5"]) let mySpinner = Spinner(customPattern, "My Spinner", speed: 0.3) ``` +

+
+ +
+
+

+ ## Community Many thanks for the 60 plus spinner frames that can be found over at [sindresorhus](https://github.com/sindresorhus/cli-spinners) repo built in `JavaScript`.