Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- override func viewDidLoad() {
- super.viewDidLoad()
- /* 諸々の設定(省略) */
- let navigationBarHeight = navigationController?.navigationBar.frame.size.height
- let statusBarHeight = UIApplication.shared.statusBarFrame.height
- progressView = UIProgressView(frame: CGRect(x: 0, y: navigationBarHeight! + statusBarHeight, width: self.view.frame.size.width, height: 5)) // プログレスバー
- progressView.progressViewStyle = .default
- progressView.progressTintColor = appleBlueColor
- progressView.trackTintColor = .white
- progressView.transform = CGAffineTransform(scaleX: 1.0, y: 2.0) // 長さと太さの設定
- self.view.addSubview(progressView)
- }
- override func viewDidAppear(_ animated: Bool) {
- super.viewDidAppear(animated)
- fetchData()
- self.table.reloadData()
- }
- func fetchData() {
- /* データを取得(省略) */
- // データ整形
- for d in Data:
- // 整形処理(省略)
- self.items.append(d) // 配列にデータを格納(これをtableviewで表示する)
- progressView.setProgress(Float(self.items.count)/10, animated: true)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement