This file contains hidden or 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
class AsanaLoadingView: UIView { | |
// MARK: Properties | |
private struct Colors { | |
static let pink = #colorLiteral(red: 0.9294117647, green: 0.5215686275, blue: 0.568627451, alpha: 1) | |
static let beige = #colorLiteral(red: 0.968627451, green: 0.8274509804, blue: 0.6666666667, alpha: 1) | |
} | |
let gradientLayer = CAGradientLayer() |
This file contains hidden or 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
private func setup() { | |
layer.addSublayer(gradientLayer) | |
gradientLayer.colors = [Colors.pink.cgColor, Colors.beige.cgColor, Colors.pink.cgColor] | |
gradientLayer.startPoint = CGPoint(x: 0, y: 0.5) | |
gradientLayer.endPoint = CGPoint(x: 1, y: 0.5) | |
} |
This file contains hidden or 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
private func setup() { | |
// ... | |
gradientLayer.colors = [Colors.pink.cgColor, Colors.beige.cgColor, Colors.pink.cgColor] | |
gradientLayer.locations = [0.7, 0.9, 1] | |
} |
This file contains hidden or 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
private func setup() { | |
// ... | |
gradientLayer.locations = [0.0, 0.0, 0.4] | |
} |
This file contains hidden or 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
private func setup() { | |
// ... | |
NotificationCenter.default.addObserver(self, selector: #selector(startLoading), name: UIApplication.willEnterForegroundNotification, object: nil) | |
startLoading() | |
} |
This file contains hidden or 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
@objc func startLoading() { | |
let animation = CABasicAnimation(keyPath: "locations") | |
animation.duration = 1.3 | |
animation.fromValue = [0.0, 0.0, 0.4] | |
animation.toValue = [0.4, 0.9, 1] | |
animation.repeatCount = .infinity | |
gradientLayer.add(animation, forKey: "AsanaLoadingView") | |
} |
This file contains hidden or 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
class SearchView: UIView { | |
// MARK: Properties | |
// ... | |
enum AnimationState: CGFloat { | |
case start = 0.0, full = 0.7, finalBigSize = 1 | |
} | |
This file contains hidden or 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
// Profile/Profile.swift | |
enum Profile {} | |
// Timeline/Timeline.swift | |
enum Timeline {} | |
// Messaging/Messaging.swift | |
enum Messaging {} | |
// Profile/Profile.ViewController.swift |