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
// | |
// VoiceOverVC.swift | |
// Created by Pasca Alberto, IT on 10/08/18. | |
// Copyright © 2018 albertopasca.it. All rights reserved. | |
// | |
import UIKit | |
class VoiceOverVC: UIViewController { |
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
// | |
// LowPowerVC.swift | |
// Created by Pasca Alberto, IT on 10/08/18. | |
// Copyright © 2018 albertopasca.it. All rights reserved. | |
// | |
import UIKit | |
class LowPowerVC: UIViewController { |
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
// | |
// PasteboardVC.swift | |
// Created by Pasca Alberto, IT on 10/08/18. | |
// Copyright © 2018 albertopasca.it. All rights reserved. | |
// | |
import UIKit | |
class PasteboardVC: UIViewController { |
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
// | |
// ProximityVC.swift | |
// Created by Pasca Alberto, IT on 10/08/18. | |
// Copyright © 2018 albertopasca.it. All rights reserved. | |
// | |
import UIKit | |
class ProximityVC: UIViewController { |
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
// | |
// FontSizeVC.swift | |
// Created by Pasca Alberto, IT on 10/08/18. | |
// Copyright © 2018 albertopasca.it. All rights reserved. | |
// | |
import UIKit | |
class FontSizeVC: UIViewController { |
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
override func motionEnded(_ motion: UIEventSubtype, with event: UIEvent?) { | |
if motion == .motionShake { | |
if (<#textField#>.undoManager?.canUndo)! { | |
self.<#textField#>.undoManager?.undo() | |
} | |
} | |
} |
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 BrightnessVC: UIViewController { | |
var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
timer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { (t) in |
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
func screenshotDetector() { | |
NotificationCenter.default.addObserver(forName: .UIApplicationUserDidTakeScreenshot, object: nil, queue: OperationQueue.main) { notification in | |
print("Screenshot taken!") | |
} | |
} |
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 AVFoundation | |
import MediaPlayer | |
// [...] | |
private func headphones() { | |
let currentRoute = AVAudioSession.sharedInstance().currentRoute | |
if currentRoute.outputs.count != 0 { | |
for description in currentRoute.outputs { |
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 BatteryVC: UIViewController { | |
var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
UIDevice.current.isBatteryMonitoringEnabled = true |