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
4
votes
1 answer

Core Data iOS 8 Today Widget issue

I have a DataManager class which returns a shared instance: + (DataManager *)sharedInstance; { static DataManager *sharedInstance = nil; static dispatch_once_t pred; dispatch_once(&pred, ^{ sharedInstance = [[DataManager alloc]…
Stephen
  • 1,427
  • 1
  • 17
  • 42
4
votes
2 answers

Image previews in Notification Center

Is it possible to add an image to a push notification's payload? I've seen it being done in the Photos & Messages apps. I was hoping this wasn't some private Apple API.
user376845
4
votes
2 answers

Make an offscreen dragable view (like iOS 5 Notification center)

I want to make a view that is initially invisible on the left side of the screen. When the finger pan from the very left side of the screen, the left appears and follow the finger. I mean exactly like the Notification Center in iOS 5, but on the…
3
votes
2 answers

Remove push from notificationcenter after app has been opened

When I send out a PUSH notification to my app, it stays in the notification center in iOS 5. How can I remove the notification from the notification center from within the app?
brange
  • 270
  • 4
  • 16
3
votes
1 answer

Struggling with NotificationCenter/Combine in SwiftUI/AVPlayer

I'm trying to pause my AVPlayer when the item finishes playing. What is the best way to do this with SwiftUI? I don't know much about notifications, where to declare them, etc. Is there a way to use Combine for this? Sample code would be awesome!…
atdonsm
  • 265
  • 4
  • 11
3
votes
1 answer

AVSystemController_SystemVolumeDidChangeNotification triggers when device locked

Using iOS 12, I am observing AVSystemController_SystemVolumeDidChangeNotification to detect volume presses to capture images: let volumeView = MPVolumeView(frame: CGRect(x: 0, y: -40, width: 0, height: 0)) // override volume…
shim
  • 9,289
  • 12
  • 69
  • 108
3
votes
3 answers

Observing notifications from ViewController

When data is updated in database, I post a notification to NotificationCenter from client with new data. A ViewController will be observing this notification so UI can be updated accordingly. Will the app crash if view controller observes a new…
user6354073
3
votes
2 answers

Which View Controller is active when app comes to foreground?

Normally I can find out when a View Controller appears with override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) } This won't be called though if the user presses the home button or for some other reason the app goes…
Suragch
  • 484,302
  • 314
  • 1,365
  • 1,393
3
votes
2 answers

Swift 3: Unrecognised selector sent to instance (KeyboardWillShow)

I search a lot about it on stack overflow but according to their solution my program is same as mention but still not working. func subscribeToKeyboardNotifications() { NotificationCenter.default.addObserver(self,…
Majid
  • 41
  • 9
3
votes
2 answers

Segmentation fault: 11; (xcode 8, Swift 3) after using NotificationCenter

Getting Segmentation fault in Xcode 8 I have recently migrated my project to Swift 3. Xcode Version 8.0 (8A218a) I get this error whenever I use UIKeyboardWillShow notification : Command failed due to signal: Segmentation fault: 11` This is how I…
3
votes
1 answer

iOS 9 UIApplicationDidBecomeActiveNotification callback not called in my work

In iOS 9 the following code for detecting a notification does not fire the selector method. In previous versions (e.g. 8.4) it's running fine. Does anyone know why? [[NSNotificationCenter defaultCenter] addObserver:self…
worker
  • 69
  • 1
  • 3
3
votes
1 answer

NSNotification breaking in Swift when trying to pass back userInfo

I'm having issues trying to pass back userInfo via postNotification in Swift. What's strange is the code only breaks when I try to use userInfo -- if I post a notification with no data to a selector with no parameters, everything works. But when I…
Derrick Hunt
  • 371
  • 3
  • 13
3
votes
1 answer

How to find out style of NSUserNotification during run-time? Or force close an alert?

According to OS X Mountain Lion Release Notes: "The user has ultimate control over what notifications are displayed, and the style (banner, alert, etc). There is no mechanism to override the user preferences." Even though all I want to do is…
2
votes
3 answers

Why isn't the UITextField clear button working in an iOS 5 WeeApp?

I'm making a weeapp for notification center using iOSOpenDev. I have a UITextField on a UIView and have implemented the UITextFieldDelegate protocol. My problem is that the textFieldShouldClear method never gets called on clicking the clear button…
icecreamhead
  • 111
  • 1
  • 12
2
votes
1 answer

SystemVolumeDidChangeNotification stopped getting triggered on iOS 15

I asked and found a solution with SystemVolumeDidChangeNotification never get triggered on iOS 14. The event would be triggered and can be observed in iOS 14 with the workaround I found. override func viewDidAppear(_ animated: Bool) { …
XY L
  • 25,431
  • 14
  • 84
  • 143
1 2
3
16 17