flutter-moum/flutter_screenshot_callback

Swift Compiler Errors

Closed this issue · 2 comments

ERROR HERE:
flutter/.pub-cache/hosted/pub.dartlang.org/screenshot_callback-1.1.5/ios/Classes/SwiftScreenshotCallbackPlugin.swift:27:42: Type 'NSNotification.Name' has no member 'UIApplication'

AND:
.pub-cache/hosted/pub.dartlang.org/screenshot_callback-1.1.5/ios/Classes/SwiftScreenshotCallbackPlugin.swift:27:40: error:
'UIApplicationUserDidTakeScreenshot' has been renamed to 'UIApplication.userDidTakeScreenshotNotification'
forName: NSNotification.Name.UIApplicationUserDidTakeScreenshot,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
UIApplication.userDidTakeScreenshotNotification
UIKit.NSNotification.Name:43:23: note: 'UIApplicationUserDidTakeScreenshot' was obsoleted in Swift 4.2
public static let UIApplicationUserDidTakeScreenshot: NSNotification.Name

I was using XCode 12.1 and I got this error, so I update to XCode 12.4 and works fine in iOS.

You can also use this package from my repo where I did more fixes:

screenshot_callback:
    git:
      url: git://github.com/ousvat/flutter_screenshot_callback.git