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 ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
@IBOutlet var tableView: UITableView! | |
var headerView = UIView() | |
var selectedSections = NSMutableArray() | |
override func 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
import UIKit | |
class CircleChartVC: UIViewController { | |
let Points:String = "652" | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let outerCirc = SwiftyCircle(frame: CGRect(x: 100, y: 20, width: 250, height: 250)) |
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
//Datasource | |
var categories:[String : [Product]] = [ | |
"Category 1": [ | |
Product(pTitle: "Product 1", pRate: "45"), | |
Product(pTitle: "Product 2", pRate: "55"), | |
], | |
"Category 2": [ | |
Product(pTitle: "Product 3", pRate: "3"), | |
Product(pTitle: "Product 4", pRate: "33"), | |
], |
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
Option 1 : | |
override func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) { | |
let offset:CGPoint = scrollView.contentOffset; | |
let bounds:CGRect = scrollView.bounds; | |
let size:CGSize = scrollView.contentSize; | |
let inset:UIEdgeInsets = scrollView.contentInset; | |
let y:CGFloat = offset.y + bounds.size.height - inset.bottom; | |
let h:CGFloat = size.height; | |
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
extension Alamofire.Request { | |
/** Response serializer for images from: http://www.raywenderlich.com/85080/beginning-alamofire-tutorial */ | |
class func imageResponseSerializer() -> GenericResponseSerializer<UIImage> { | |
return GenericResponseSerializer { request, response, data in | |
guard let validData = data else { | |
let failureReason = "Data could not be serialized. Input data was nil." | |
let error = Error.errorWithCode(.DataSerializationFailed, failureReason: failureReason) | |
return .Failure(data, error) |