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
// instead of creating and destroying constraints all the time we can just | |
// add multiple constraints on the same object and then change the priority | |
// and indicate which one is active | |
if feedItem!.prototypeUpdate?.media.count <= 1 { | |
mediaViewWidthConstraintLarge.priority = 995 | |
mediaViewWidthContraint.priority = 999 | |
mediaViewWidthConstraintLarge.isActive = true | |
mediaViewWidthContraint.isActive = false | |
} else { | |
mediaViewWidthConstraintLarge.priority = 999 |
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 UITextView { | |
func sizeThatWillFitAllText()->CGFloat { | |
return self.sizeThatFits((self.frame.size)).height | |
} | |
} | |
self.textViewHeightConstraintOutlet.constant = desiredTextViewHeight < CGFloat(75) ? desiredTextViewHeight : CGFloat(75) | |
let textViewWantsHeightObservable = self.textViewHeightConstraintOutlet |
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 | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var isFullScreen = false | |
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | |
// create notifications from wherever to signal fullscreen |
NewerOlder