Skip to content

Instantly share code, notes, and snippets.

View ilandbt's full-sized avatar

Ilan Ben Tal ilandbt

View GitHub Profile
@ilandbt
ilandbt / ViewController.Swift
Last active May 23, 2017 12:05
disabling autorotate
class MainNavigationController: UINavigationController {
// autorotate by top viewController
override var shouldAutorotate: Bool {
if !viewControllers.isEmpty {
return self.topViewController!.shouldAutorotate
} else {
return true
}
@ilandbt
ilandbt / UIView+Constraints.swift
Last active February 13, 2017 14:13
getting height constraint
extension UIView {
var heightWithConstraint: CGFloat {
get {
for constraint in constraints where constraint.firstAttribute == .height {
return constraint.constant
}
return 0
}
set (newHeight){
import UIKit
class Pet {
}
class Cat: Pet {
}
extension A {
private foo() {
}
}