| ### Typical use: Determinate |
| |
| MDCActivityIndicator instances can be shown as determinate by modifying the `indicatorMode` |
| property and setting a percentage progress with `progress`. `progress` must be set to a floating |
| point number between 0 and 1. Values beyond this range will be capped within the range. |
| |
| Note: Activity indicators are hidden unless they are animating, even if the indicator is determinate |
| progress. |
| |
| <!--<div class="material-code-render" markdown="1">--> |
| #### Swift |
| ```swift |
| let activityIndicator = MDCActivityIndicator() |
| activityIndicator.sizeToFit() |
| activityIndicator.indicatorMode = .determinate |
| activityIndicator.progress = 0.5 |
| view.addSubview(activityIndicator) |
| |
| // To make the activity indicator appear: |
| activityIndicator.startAnimating() |
| |
| // To make the activity indicator disappear: |
| activityIndicator.stopAnimating() |
| ``` |
| |
| #### Objective-C |
| |
| ```objc |
| MDCActivityIndicator *activityIndicator = [[MDCActivityIndicator alloc] init]; |
| [activityIndicator sizeToFit]; |
| activityIndicator.indicatorMode = MDCActivityIndicatorModeDeterminate; |
| activityIndicator.progress = 0.5; |
| [view addSubview:activityIndicator]; |
| |
| // To make the activity indicator appear: |
| [activityIndicator startAnimating]; |
| |
| // To make the activity indicator disappear: |
| [activityIndicator stopAnimating]; |
| ``` |
| <!--</div>--> |