diff --git a/CHANGELOG.md b/CHANGELOG.md index 290d375..dd88d8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.1.5 +- Remove callback observer when deinit in iOS [#16](https://github.com/flutter-moum/flutter_screenshot_callback/issues/16). + ## 1.1.4 - Fix iOS Build Error [#31](https://github.com/flutter-moum/flutter_screenshot_callback/issues/31). diff --git a/example/pubspec.lock b/example/pubspec.lock index 6cac357..c5d0564 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -108,7 +108,7 @@ packages: path: ".." relative: true source: path - version: "1.1.4" + version: "1.1.5" sky_engine: dependency: transitive description: flutter diff --git a/ios/Classes/SwiftScreenshotCallbackPlugin.swift b/ios/Classes/SwiftScreenshotCallbackPlugin.swift index 34d21ae..137a0e7 100644 --- a/ios/Classes/SwiftScreenshotCallbackPlugin.swift +++ b/ios/Classes/SwiftScreenshotCallbackPlugin.swift @@ -45,10 +45,10 @@ public class SwiftScreenshotCallbackPlugin: NSObject, FlutterPlugin { } } - deinit { - if(SwiftScreenshotCallbackPlugin.observer != nil) { - NotificationCenter.default.removeObserver(SwiftScreenshotCallbackPlugin.observer!); - SwiftScreenshotCallbackPlugin.observer = nil; - } - } + deinit { + if(SwiftScreenshotCallbackPlugin.observer != nil) { + NotificationCenter.default.removeObserver(SwiftScreenshotCallbackPlugin.observer!); + SwiftScreenshotCallbackPlugin.observer = nil; + } + } } diff --git a/pubspec.yaml b/pubspec.yaml index 2996f8b..c37b05e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: screenshot_callback description: Flutter plugin that allows you to detect mobile screenshot and execute callback functions on iOS and Android. -version: 1.1.4 +version: 1.1.5 homepage: https://github.com/flutter-moum/flutter_screenshot_callback environment: