5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

NSProgressIndicatorの使い方(Swift)

Last updated at Posted at 2016-03-04

設定

progressBar.minValue = 0 //最小値の設定
progressBar.maxValue = 1 //最大値の設定
progressBar.doubleValue = 0.5 //現在の数値を設定

値が変わらない時はperformSelectorInBackgroundで実行すると上手く動く。

//この関数で操作
func progress(value:Double){
	let num = NSNumber(double: value)
   	performSelectorInBackground("setProgress:", withObject: num)
}

//上の関数の中身
func setProgress(value:NSNumber){
	progressBar.doubleValue = value.doubleValue
}

色を変えてみる

UIKitのようなtintColorのようなプロパティのでInterface Builderでエフェクト?をかける。

  1. ProgressBarを選択
  2. View Effects Inspector を選択
  3. Content FilterにHue Ajustを追加
  4. Angleを変えて好きな色が出るまで頑張る

ちゃんとした設定方法がよく分からないのでご存知のかた、教えて下さい。

Screen Shot 2016-03-04 at 15.09.22.png

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?