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
// | |
// UITextViewPlaceholder.swift | |
// TextViewPlaceholder | |
// | |
// Original work Copyright (c) 2017 Tijme Gommers <[email protected]> | |
// Modified work Copyright (c) 2017 Yuval Tal <[email protected]> | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights |
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
/* | |
Usage example: | |
// MARK - UIImagePickerControllerDelegate | |
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) { | |
if let pickedImage = info[UIImagePickerControllerOriginalImage] as? UIImage { | |
let cropRect = info[UIImagePickerControllerCropRect]?.CGRectValue | |
let croppedImage = pickedImage.crop(cropRect) | |
self.anImage.contentMode = .ScaleAspectFit |
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
/* Usage: | |
// This is in your viewcontroller, which implements UINavigationControllerDelegate | |
func navigationController(navigationController: UINavigationController, willShowViewController: UIViewController, animated: Bool) { | |
if isImageViewer(navigationController) { | |
addCircleOverlayToImageViewer(willShowViewController) | |
} | |
} | |
*/ | |
func isImageViewer(navigationController: UINavigationController) -> Bool { |