Skip to content

Instantly share code, notes, and snippets.

View MickaelCruzDB's full-sized avatar

Mickaël Cruz MickaelCruzDB

View GitHub Profile
override func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
let location:CGPoint? = touches.anyObject()?.locationInView(self)
if let loc = location {
if (!CGRectContainsPoint(ScaleRect(self.bounds, n: 2.0), loc))
{
self.highlighted = false
}
}
}
override func touchesMoved(touches: Set<NSObject>, withEvent event: UIEvent) {
if let touch = touches.first as? UITouch {
let location = touch.locationInView(self)
if (!CGRectContainsPoint(ScaleRect(self.bounds, n: 2.0), location))
{
self.highlighted = false
}
}
}
func itemTouched(item: PathMenuItem) {
let tag: Int = self.flag!
if (item.tag == 1000) {
println("item1 touched")
ViewController().goToNextView()
}
}
@IBAction func goToNextView() {
println("test")
self.performSegueWithIdentifier("test", sender:self)
}
@IBInspectable var backgroundImage: UIImage? {
didSet {
frontSideView.backgroundColor = UIColor(patternImage: UIImage(named: "product-title")!)
}
}
@IBInspectable var backgroundImage: UIImage = UIImage() {
didSet {
self.frontSideView.backgroundColor = UIColor(patternImage: UIImage(named: "product-title")!)
}
}
private let iconImageView = UIView()
internal var iconImage: UIImageView!
@IBInspectable var imageName: String {
didSet {
self.imageTitle.text = imageName
}
}
private let iconImageView = UIView()
internal var iconImage: UIImageView!
@IBInspectable var imageName: String {
didSet {
self.imageTitle.text = imageName
}
}
@IBInspectable var backgroundImage: UIImage = UIImage() {
convenience init() {
let sessionConfig:NSURLSessionConfiguration = NSURLSessionConfiguration.defaultSessionConfiguration()
sessionConfig.allowsCellularAccess = true
sessionConfig.HTTPAdditionalHeaders = ["Content-Type": "application/json"]
sessionConfig.timeoutIntervalForRequest = 30
sessionConfig.timeoutIntervalForResource = 60
sessionConfig.HTTPMaximumConnectionsPerHost = 1
self.init()
let socket = SocketIOClient(socketURL: "192.168.1.19:5260")
override func viewDidLoad() {
super.viewDidLoad()
self.socket.connect()
}