Trying to make share extension, have to recreate project
This commit is contained in:
@@ -15,6 +15,12 @@ class MessagesViewController: MSMessagesAppViewController {
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
setupChildViewController()
|
||||
|
||||
// Register for notifications when app becomes active
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(appDidBecomeActive),
|
||||
name: UIApplication.didBecomeActiveNotification,
|
||||
object: nil)
|
||||
}
|
||||
|
||||
private func setupChildViewController() {
|
||||
@@ -90,11 +96,22 @@ class MessagesViewController: MSMessagesAppViewController {
|
||||
// Called when the extension is about to move from the inactive to active state.
|
||||
// This will happen when the extension is about to present UI.
|
||||
|
||||
// Check for GIFs shared from the Share Extension
|
||||
GIFStorageService.shared.checkForSharedGIFs()
|
||||
|
||||
// Refresh GIFs list when becoming active
|
||||
gifCollectionVC?.viewWillAppear(true)
|
||||
}
|
||||
|
||||
override func didResignActive(with conversation: MSConversation) {}
|
||||
override func didResignActive(with conversation: MSConversation) {
|
||||
// No action needed when the extension becomes inactive
|
||||
}
|
||||
|
||||
@objc private func appDidBecomeActive() {
|
||||
// Check for GIFs shared through the Share Extension
|
||||
GIFStorageService.shared.checkForSharedGIFs()
|
||||
gifCollectionVC?.loadGIFs()
|
||||
}
|
||||
override func didReceive(_ message: MSMessage, conversation: MSConversation) {}
|
||||
override func didStartSending(_ message: MSMessage, conversation: MSConversation) {}
|
||||
override func didCancelSending(_ message: MSMessage, conversation: MSConversation) {}
|
||||
|
||||
Reference in New Issue
Block a user