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 MainNavigationController: UINavigationController { | |
// autorotate by top viewController | |
override var shouldAutorotate: Bool { | |
if !viewControllers.isEmpty { | |
return self.topViewController!.shouldAutorotate | |
} else { | |
return true | |
} |
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 UIView { | |
var heightWithConstraint: CGFloat { | |
get { | |
for constraint in constraints where constraint.firstAttribute == .height { | |
return constraint.constant | |
} | |
return 0 | |
} | |
set (newHeight){ |
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 Pet { | |
} | |
class Cat: Pet { | |
} |
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 A { | |
private foo() { | |
} | |
} |