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
private static let sharedView : IHProgressHUD = { | |
var localInstance : IHProgressHUD? | |
if Thread.current.isMainThread { | |
if IHProgressHUD.isNotAppExtension { | |
if let window = UIApplication.shared.delegate?.window { | |
localInstance = IHProgressHUD.init(frame: window?.bounds ?? CGRect.zero) | |
} else { | |
localInstance = IHProgressHUD() | |
} | |
} |
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
//MARK: - ActivityIndicatorView Functions | |
extension IndefiniteAnimatedView { | |
func removeAnimationLayer() { | |
for view in self.subviews { | |
if let activityView = view as? UIActivityIndicatorView { | |
activityView.removeFromSuperview() | |
} | |
} | |
getIndefinteAnimatedLayer().removeFromSuperlayer() |
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
class IndefiniteAnimatedView : UIView { | |
private var activityIndicator : UIActivityIndicatorView? | |
private var strokeThickness : CGFloat? | |
private var strokeColor : UIColor? | |
private var indefinteAnimatedLayer : CAShapeLayer? | |
private var radius : CGFloat? | |
//MARK: - Setter Functions | |
@objc func setIndefinite(radius: CGFloat) { |
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
#if os(OSX) | |
import AppKit | |
public typealias View = NSView | |
public typealias Color = NSColor | |
public typealias Label = NSTextField | |
#else | |
import UIKit | |
public typealias View = UIView |
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
//: Append data to linked List | |
extension LinkedList { | |
func append(_ node : Node) { | |
//Check for empty Linked List and assign the node to head if empty | |
guard head != nil else { | |
head = node | |
return | |
} | |
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
//: Get Node at Index | |
extension LinkedList { | |
func getNode(atPosition position: Int) -> Node? { | |
guard position > 0 else { | |
return nil | |
} | |
var counter = 1 | |
var current = head | |
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
//: Insert Node at Index | |
extension LinkedList { | |
func insertNode(_ node: Node, at position: Int) { | |
guard position > 0 else { | |
return | |
} | |
var counter = 1 | |
var current = head | |
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
#import "ViewController.h" | |
@interface ViewController () | |
@property (weak, nonatomic) IBOutlet UIImageView *logoImageView; | |
@end | |
@implementation ViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; |
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
//http://swiftify.me/0ivnnp | |
import UIKit | |
class SwiftViewController: UIViewController { | |
@IBOutlet weak var logoImageView: UIImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
var logo: UIImage? = logoImageView.image |
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
import UIKit | |
class SwiftViewController: UIViewController { | |
@IBOutlet weak var logoImageView: UIImageView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
if let logo = logoImageView.image { | |
let colorLessLogo = logo.withRenderingMode(.alwaysTemplate) | |
logoImageView.image = colorLessLogo |
OlderNewer