2

How can i prevent screenshot from being taken while my app is running? Ive looked all over and none of solutions have worked. How did the Netflix app on iOS implement a feature like this, where a screenshot would just return a black image? Thank you

rmaddy
  • 314,917
  • 42
  • 532
  • 579
calcMan
  • 111
  • 1
  • 12
  • 1
    http://stackoverflow.com/a/21198528/1489885 – HAS Nov 22 '16 at 06:04
  • You can't actually prevent user to take screenshot, however you can find if user have just taken screenshot by observing `UIApplicationUserDidTakeScreenshotNotification` notification and then you can either delete such photo from gallery(if permission have been given) though this is not good at all or you can blur the image. but my point here is, even if you, somehow manage to prevent screenshot, how you gonna prevent user to take photo from other device? – Suryakant Sharma Nov 22 '16 at 07:17
  • Possible duplicate of [iOS Detection of Screenshot?](http://stackoverflow.com/questions/13484516/ios-detection-of-screenshot) – Nicolas Miari Nov 22 '16 at 09:30
  • @NicolasMiari it doesn't seem to be duplicate, different scenarios –  Nov 22 '16 at 11:49
  • This has definitely been asked before. Prevent user from taking screenshot, like Snapchat. What is different? – Nicolas Miari Nov 22 '16 at 12:04

1 Answers1

0

You can try this: RyukieSwifty/ScreenShield

It's a UIView . Any subviews in it can be hide when take a screenshot.

pod 'RyukieSwifty/ScreenShield'
import UIKit
import RyukieSwifty

class TransactionAddViewController: UIViewController {
    // MARK: - Life
    override func loadView() {
        view = ScreenShieldView.create()
    }
    ...
}