-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from isavynskyi/feature/shake-gesture-polishing
Polish new shake gesture trigger type
- Loading branch information
Showing
28 changed files
with
607 additions
and
568 deletions.
There are no files selected for viewing
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
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
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
29 changes: 29 additions & 0 deletions
29
Example/LayoutInspectorExample/ChangeAutoTriggerProtocol.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// ChangeAutoTriggerProtocol.swift | ||
// LayoutInspectorExample | ||
// | ||
// Created by Igor Savynskyi on 9/29/19. | ||
// Copyright © 2019 Ihor Savynskyi. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
import LayoutInspector | ||
|
||
protocol ChangeAutoTriggerProtocol { | ||
func changeAutoTrigger() | ||
} | ||
|
||
extension ChangeAutoTriggerProtocol where Self: UIViewController { | ||
func changeAutoTrigger() { | ||
let alert = UIAlertController(title: nil, message: "Select auto trigger", preferredStyle: .actionSheet) | ||
alert.addAction(UIAlertAction(title: "Screenshot", style: .default, handler: { (_) in | ||
LayoutInspector.shared.setAutoTrigger(.screenshot) | ||
})) | ||
alert.addAction(UIAlertAction(title: "Shake", style: .default, handler: { (_) in | ||
LayoutInspector.shared.setAutoTrigger(.shake) | ||
})) | ||
alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) | ||
present(alert, animated: true, completion: nil) | ||
} | ||
} |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.