-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorginzation of directories etc. finishing up profile view/settings …
…tonight
- Loading branch information
Showing
16 changed files
with
163 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// | ||
// File.swift | ||
// LearnLab | ||
// | ||
// Created by Siddharth Kucheria on 5/27/19. | ||
// Copyright © 2019 Siddharth Kucheria. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class ProgressHUD: UIVisualEffectView { | ||
|
||
var text: String? { | ||
didSet { | ||
label.text = text | ||
} | ||
} | ||
|
||
let activityIndictor: UIActivityIndicatorView = UIActivityIndicatorView(style: .gray) | ||
let label: UILabel = UILabel() | ||
let blurEffect = UIBlurEffect(style: .light) | ||
let vibrancyView: UIVisualEffectView | ||
|
||
init(text: String) { | ||
self.text = text | ||
self.vibrancyView = UIVisualEffectView(effect: UIVibrancyEffect(blurEffect: blurEffect)) | ||
super.init(effect: blurEffect) | ||
self.setup() | ||
} | ||
|
||
required init?(coder aDecoder: NSCoder) { | ||
self.text = "" | ||
self.vibrancyView = UIVisualEffectView(effect: UIVibrancyEffect(blurEffect: blurEffect)) | ||
super.init(coder: aDecoder) | ||
self.setup() | ||
} | ||
|
||
func setup() { | ||
contentView.addSubview(vibrancyView) | ||
contentView.addSubview(activityIndictor) | ||
contentView.addSubview(label) | ||
activityIndictor.startAnimating() | ||
} | ||
|
||
override func didMoveToSuperview() { | ||
super.didMoveToSuperview() | ||
|
||
if let superview = self.superview { | ||
|
||
let width = superview.frame.size.width / 2.3 | ||
let height: CGFloat = 50.0 | ||
self.frame = CGRect(x: superview.frame.size.width / 2 - width / 2, | ||
y: superview.frame.height / 2 - height / 2, | ||
width: width, | ||
height: height) | ||
vibrancyView.frame = self.bounds | ||
|
||
let activityIndicatorSize: CGFloat = 40 | ||
activityIndictor.frame = CGRect(x: 5, | ||
y: height / 2 - activityIndicatorSize / 2, | ||
width: activityIndicatorSize, | ||
height: activityIndicatorSize) | ||
|
||
layer.cornerRadius = 8.0 | ||
layer.masksToBounds = true | ||
label.text = text | ||
label.textAlignment = NSTextAlignment.center | ||
label.frame = CGRect(x: activityIndicatorSize + 5, | ||
y: 0, | ||
width: width - activityIndicatorSize - 15, | ||
height: height) | ||
label.textColor = UIColor.gray | ||
label.font = UIFont.boldSystemFont(ofSize: 16) | ||
} | ||
} | ||
|
||
func show() { | ||
self.isHidden = false | ||
} | ||
|
||
func hide() { | ||
self.isHidden = true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-6.85 KB
(90%)
LearnLab.xcworkspace/xcuserdata/siddharth.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.