This file contains hidden or 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
private struct AssociatedKeys { | |
static var highlightAnimation = "VIV_highlightAnimation" | |
} | |
extension HighlightAnimatable where Self: UIView { | |
private var animationAvailable: Bool { | |
get { return (objc_getAssociatedObject(self, &AssociatedKeys.highlightAnimation) as? Bool) ?? true } | |
set { objc_setAssociatedObject(self, &AssociatedKeys.highlightAnimation, newValue, .OBJC_ASSOCIATION_ASSIGN) } | |
} |
This file contains hidden or 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
struct HighlightAnimatableSettings { | |
var duration: TimeInterval = 0.5 | |
var delay: TimeInterval = 0.0 | |
var springDamping: CGFloat = 1.0 | |
var springVelocity: CGFloat = 0.0 | |
var options: UIView.AnimationOptions = [.allowUserInteraction] | |
var transform: CGAffineTransform = .init(scaleX: 0.90, y: 0.90) | |
} |
This file contains hidden or 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
protocol HighlightAnimatable: class { | |
var settings: HighlightAnimatableSettings { get } | |
func lockAnimation() | |
func unlockAnimation() | |
func highlight(_ touched: Bool) | |
func highlight(_ touched: Bool, completion: ((Bool) -> Void)?) | |
} |
This file contains hidden or 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 window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// Setup Fetch Interval |
This file contains hidden or 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 | |
final class ViewController: UIViewController { | |
@IBAction func photoLibraryDidTap(_ sender: Any) { | |
let imagePickerController = UIImagePickerController() | |
imagePickerController.delegate = self | |
present(imagePickerController, animated: true, completion: nil) | |
} | |
This file contains hidden or 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
// Define new Notification.Name | |
extension Notification.Name { | |
static let ButtonDidTap = Notification.Name(rawValue: "com.vialyx.ButtonDidTap") | |
This file contains hidden or 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
keyboardWillHide: Optional([AnyHashable("UIKeyboardFrameBeginUserInfoKey"): NSRect: {{0, 711}, {768, 313}}, AnyHashable("UIKeyboardFrameEndUserInfoKey"): NSRect: {{0, 1024}, {768, 313}}, AnyHashable("UIKeyboardBoundsUserInfoKey"): NSRect: {{0, 0}, {768, 313}}, AnyHashable("UIKeyboardIsLocalUserInfoKey"): 1, AnyHashable("UIKeyboardCenterEndUserInfoKey"): NSPoint: {384, 1180.5}, AnyHashable("UIKeyboardCenterBeginUserInfoKey"): NSPoint: {384, 867.5}, AnyHashable("UIKeyboardAnimationCurveUserInfoKey"): 7, AnyHashable("UIKeyboardAnimationDurationUserInfoKey"): 0.25]) |
This file contains hidden or 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
keyboardWillShow: Optional([AnyHashable("UIKeyboardFrameBeginUserInfoKey"): NSRect: {{0, 1024}, {768, 313}}, AnyHashable("UIKeyboardFrameEndUserInfoKey"): NSRect: {{0, 711}, {768, 313}}, AnyHashable("UIKeyboardBoundsUserInfoKey"): NSRect: {{0, 0}, {768, 313}}, AnyHashable("UIKeyboardIsLocalUserInfoKey"): 1, AnyHashable("UIKeyboardCenterEndUserInfoKey"): NSPoint: {384, 867.5}, AnyHashable("UIKeyboardCenterBeginUserInfoKey"): NSPoint: {384, 1180.5}, AnyHashable("UIKeyboardAnimationCurveUserInfoKey"): 7, AnyHashable("UIKeyboardAnimationDurationUserInfoKey"): 0.25]) |
This file contains hidden or 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class MyViewController: UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white |
This file contains hidden or 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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class MyViewController: UIViewController { | |
override func loadView() { | |
let view = UIView() | |
view.backgroundColor = .white |