- July 11, 2025
- Mins Read
A way to quickly add a notification icon to a UIView (iOS6 and up). Support
Code:
RKNotificationHub* hub = [[RKNotificationHub alloc]initWithView:yourView]; // sets the count to 0
[hub increment]; // increments the count to 1, making the notification visible
pod ‘RKNotificationHub’
[hub increment];
-(void)increment;
-(void)incrementBy:(int)amount;
-(void)decrement;
-(void)decrementBy:(int)amount;
@property (nonatomic, assign) int count; //%%% set to a certain number
Combine Actions!
[hub increment];
[hub pop];
//%%% COLOR
[hub setCircleColor:[UIColor colorWithRed:0.98 green:0.66 blue:0.2 alpha:1]
labelColor:[UIColor whiteColor]];
//%%% CIRCLE FRAME
[hub setCircleAtFrame:CGRectMake(-10, -10, 30, 30)]; //frame relative to the view you set it to
//%%% MOVE FRAME
[hub moveCircleByX:-5 Y:5]; // moves the circle 5 pixels left and down from its current position
//%%% CIRCLE SIZE
[hub scaleCircleSizeBy:2]; // doubles the size of the circle, keeps the same center
//%%% BLANK BADGE
[hub hideCount];
/* shoutout to imkevinxu for this suggestion */
[increment]
[self.view addSubview: yourView]
?)[hideCount]
anywhere. Call [showCount]
to counter this[scaleCircleSizeBy:]
. 0.5 will give you half the size, 2 will give you double[moveCircleByX: Y:]
. This shifts the circle by the number of pixels given[setCircleAtFrame:]
and give it your own CGRectNSUInteger
(removed support for negative counts), made local constants static const
A SwiftUI View that emits confetti with user-defined shapes, images, and text.
A colour wheel made all in SwiftUI. There are 2 different colour wheels to choose from. The first main one ...
A color picker implementation with color wheel appearance written in plain SwiftUI. It is compatible with UIColor and NSColor.
This repository is no longer maintained. Here's why: with the release of iOS 16 SwiftUI now enables most of the ...