Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: darlinghq/darling-foundation
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ffedc7bda02b9bddfdb5e7b1baf78e68e2b57b3c
Choose a base ref
...
head repository: darlinghq/darling-foundation
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c952468e11a5e3c41b1213d4f64649f0b09e8dd0
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Jan 13, 2024

  1. Verified

    This commit was signed with the committer’s verified signature.
    akorchyn Artur Yurii Korchynskyi
    Copy the full SHA
    afc6f99 View commit details

Commits on Jan 14, 2024

  1. Merge pull request #14 from sirnacnud/nsusernotification

    Add stubs for NSUserNotificationCenter
    CuriousTommy authored Jan 14, 2024
    Copy the full SHA
    c952468 View commit details
Showing with 32 additions and 2 deletions.
  1. +11 −2 include/Foundation/NSUserNotification.h
  2. +21 −0 src/NSUserNotification.m
13 changes: 11 additions & 2 deletions include/Foundation/NSUserNotification.h
Original file line number Diff line number Diff line change
@@ -25,10 +25,19 @@
@interface NSUserNotificationAction : NSObject <NSCopying>
@end

@interface NSUserNotificationCenter : NSObject
@protocol NSUserNotificationCenterDelegate <NSObject>
@end

@protocol NSUserNotificationCenterDelegate <NSObject>
@interface NSUserNotificationCenter : NSObject {
id<NSUserNotificationCenterDelegate> _delegate;
}

@property(class, readonly, strong) NSUserNotificationCenter *defaultUserNotificationCenter;
@property(assign) id<NSUserNotificationCenterDelegate> delegate;

- (void)deliverNotification:(NSUserNotification *)notification;
- (void)removeDeliveredNotification:(NSUserNotification *)notification;

@end

FOUNDATION_EXPORT NSString * const NSUserNotificationDefaultSoundName;
21 changes: 21 additions & 0 deletions src/NSUserNotification.m
Original file line number Diff line number Diff line change
@@ -40,6 +40,27 @@ - (id)copyWithZone:(NSZone *)zone
@end

@implementation NSUserNotificationCenter

static NSUserNotificationCenter *_defaultUserNotificationCenter = nil;

@synthesize delegate = _delegate;

+ (NSUserNotificationCenter *)defaultUserNotificationCenter {
if (_defaultUserNotificationCenter == nil) {
_defaultUserNotificationCenter = [[NSUserNotificationCenter alloc] init];
}

return _defaultUserNotificationCenter;
}

- (void)deliverNotification:(NSUserNotification *)notification {
NSLog(@"[NSUserNotificationCenter deliverNotification:]");
}

- (void)removeDeliveredNotification:(NSUserNotification *)notification {
NSLog(@"[NSUserNotificationCenter removeDeliveredNotification:]");
}

@end

NSString * const NSUserNotificationDefaultSoundName = @"DefaultSoundName";