File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Example Apps/iOS Example/Scenes Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,12 @@ class PresetsController: SPDiffableTableController {
104104 message: " Try again " ,
105105 preset: . error
106106 ) ,
107+ IndicatorPresetModel (
108+ name: " Spin " ,
109+ title: " Spin " ,
110+ message: " Animatable " ,
111+ preset: . spin( . medium)
112+ ) ,
107113 IndicatorPresetModel (
108114 name: " Custom Image " ,
109115 title: " Custom Image " ,
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public enum SPIndicatorIconPreset {
2929
3030 case done
3131 case error
32-
32+ case spin ( _ style : UIActivityIndicatorView . Style )
3333 case custom( _ image: UIImage )
3434}
3535
@@ -46,6 +46,10 @@ public extension SPIndicatorIconPreset {
4646 let view = SPIndicatorIconErrorView ( )
4747 view. tintColor = UIColor . systemRed
4848 return view
49+ case . spin( let style) :
50+ let view = UIActivityIndicatorView ( style: style)
51+ view. startAnimating ( )
52+ return view
4953 case . custom( let image) :
5054 let imageView = UIImageView ( image: image)
5155 imageView. contentMode = . scaleAspectFit
@@ -57,6 +61,7 @@ public extension SPIndicatorIconPreset {
5761 switch self {
5862 case . error: return . error
5963 case . done: return . success
64+ case . spin( _) : return . none
6065 case . custom( _) : return . success
6166 }
6267 }
@@ -96,6 +101,8 @@ public extension SPIndicatorLayout {
96101 iconSize = . init( width: 14 , height: 14 )
97102 margins. left = 19
98103 margins. right = margins. left
104+ case . spin( _) :
105+ self . init ( )
99106 case . custom( _) :
100107 self . init ( )
101108 }
You can’t perform that action at this time.
0 commit comments