Questions tagged [notificationcenter]

Notification Center is an interface designed by Apple that allows users to easily view notifications from all applications in one view. Notification Center is available in iOS 5 and up.

Notification Center is an interface designed by Apple that allows users to easily view notifications from all applications in one view. Notification Center is activated by dragging down from the devices status bar (top of screen), and removed similarly by dragging up from the bottom of the screen.

Options for Notification Center include:

  • Weather widget (powered by Yahoo)
  • Stocks widget (powered by Yahoo)
  • Sort by time
  • Sort manually (allows users to manually arrange the order in which notifications will appear from top to bottom)
  • Ability to enable/disable notifications for individual applications

Notification Center is available in iOS 5 and up.

242 questions
0
votes
3 answers

iOS NotificationCenter unexpected retained closure

In the documentation, it says: The block is copied by the notification center and (the copy) held until the observer registration is removed. And it provides a one-time observer example code like so: let center =…
funct7
  • 3,407
  • 2
  • 27
  • 33
0
votes
0 answers

willEnterForeground notification but isBeingPresented = false

I'm trying to work out the best way to update a view when the app comes into the foreground. Originally I had assumed that viewWillAppear would do the trick, but it appears I was incorrect. I understand from other posts the correct way to do this is…
Ben
  • 4,707
  • 5
  • 34
  • 55
0
votes
0 answers

AppleScript to access system Now Playing, without iTunes

I'd like to have a script that does something every time the current playback changes, i.e. something different is displayed in the Now Playing widget in Notification Centre. All the solutions I found involved telling iTunes to give AppleScript the…
FDMS
  • 113
  • 1
  • 5
0
votes
2 answers

UIButton becomes Inanimate after the user presses Home Button

I have a UIButton called findButton that has a pulsing or breathing animation. When testing the app in the simulator and device, everything works perfectly until I click the Home Button while the animation is occurring. If I do press the Home Button…
user9470831
0
votes
1 answer

Get Keyboard Toolbar Height

i have the same question as this : iPhone Keyboard with accessory view height problems but the answer has no new solution and does not solve anything!
Mehrdad
  • 1,050
  • 1
  • 16
  • 27
0
votes
0 answers

Observer class not receiving notifications

I have a class that handles the notification. I can add the observer to NotificationCenter but the handles method never executes. If I move the same method into the class that adds the observer it works fine. I've tried putting it in the class and…
Dharmesh Patel
  • 131
  • 1
  • 5
0
votes
6 answers

Unrecognized selectors sent to instance, Notification center getting the Keyboard size

If I try to tap into my textfields I get an error, related to these few lines of code that try to get the size of the keyboard on a mobile ios device. The Notification Center lines of code are inside the overriding ViewDidAppear. …
Niccolò Diana
  • 119
  • 2
  • 13
0
votes
3 answers

Notification Center - Cannot convert value of type 'Selector' to expected argument type 'String'

Im learning notification centers right now and am getting this error while trying to register an observer: Cannot convert value of type 'Selector' to expected argument type 'String' My observer code: NotificationCenter.addObserver(self, forKeyPath:…
0
votes
2 answers

Using NotificationCenter to trigger a UIAlertController on a different view

I have two ViewControllers (ViewController is the first; SecondViewController is the second) embedded in a Navigation Controller. On ViewController, there is a NotificationCenter observer in viewDidLoad. On SecondViewController, I have a button that…
Joe
  • 3,772
  • 3
  • 33
  • 64
0
votes
1 answer

Is there a way to have a OnReceiveLocalNotification (TNotificationCenter) working even after the app close?

My app has some tasks that need to run in background. I use the task scheduler to run the app when a task is needed and the app close it self when the task is finished. So far, so good. The tasks could take some time to finish so I send…
0
votes
1 answer

Add Observer for end of short, high resolution video

I am trying to play a 4k Video in the AVPlayer with Swift 3 for iOS12 and it works totally fine, but i want this video to play inside a loop. I found articles that stated, that you should use this method to register for the end of the video…
Sebastian Weiß
  • 349
  • 4
  • 14
0
votes
0 answers

Need to get an output when a notification is displayed

I'm doing an applescript cocoa app and I'd like to run a function as a notification with the name "Finished Downloading" is displayed. The function changes a value displayed in the main window of the cocoa app and the notification is created with a…
0
votes
1 answer

NotificationCenter observer clearing after presenting modal

My app is playing a video and I want to trigger an action when the video ends. The screen (A) is embedded in a navigation controller, and if I trigger a push (to B) and then come back (to A), the action (in A) still takes place based on the…
wizplum
  • 427
  • 5
  • 17
0
votes
3 answers

Notification Center Observer Selector Method does not get called

I am adding an observer on A view controller and view controller B is presenting on A. While dismissing Controller B , I have posted the notification but It does not called the selector method added in A. Also notification get registered first and…
Mahak Mittal
  • 121
  • 1
  • 10
0
votes
0 answers

Does NotificationCenter have an event for didUnlockDevice?

Is it possible to register for notifications pertaining to Device unlocks? Ideally, I'm trying to count the number of biometric (FaceID / TouchID) unlocks performed by a User. More generally, does Apple have a list of events to which an app can…
Dan
  • 4,197
  • 6
  • 34
  • 52