@@ -263,6 +263,94 @@ extension ExampleViewController: ExampleViewDelegate {
263
263
shadowBlurRadius: 15 )
264
264
}
265
265
}
266
+
267
+ internal func basicSimulanteousFloatingNotificationCellSelected( at index: Int ) {
268
+
269
+ func showBanners( _ banners: [ FloatingNotificationBanner ] ,
270
+ in notificationBannerQueue: NotificationBannerQueue ) {
271
+ banners. forEach { banner in
272
+ banner. show ( bannerPosition: selectedBannerPosition ( ) ,
273
+ queue: notificationBannerQueue,
274
+ cornerRadius: 8 ,
275
+ shadowColor: UIColor ( red: 0.431 , green: 0.459 , blue: 0.494 , alpha: 1 ) ,
276
+ shadowBlurRadius: 16 ,
277
+ shadowEdgeInsets: UIEdgeInsets ( top: 8 , left: 8 , bottom: 0 , right: 8 ) )
278
+ }
279
+ }
280
+
281
+ switch index {
282
+ case 0 :
283
+ let bannerQueue2AllowedSuccess = NotificationBannerQueue ( maxBannersOnScreenSimultaneously: 2 )
284
+
285
+ let banner1 = FloatingNotificationBanner ( title: " Success Notification 1 " ,
286
+ subtitle: " First Success Notification in current queue with 2 banners allowed simultaneously " ,
287
+ style: . success)
288
+ banner1. delegate = self
289
+
290
+ let banner2 = FloatingNotificationBanner ( title: " Success Notification 2 " ,
291
+ subtitle: " Second Success Notification in current queue with 2 banners allowed simultaneously " ,
292
+ style: . success)
293
+ banner2. delegate = self
294
+
295
+ let banner3 = FloatingNotificationBanner ( title: " Success Notification 3 " ,
296
+ subtitle: " Third Success Notification in current queue with 2 banners allowed simultaneously " ,
297
+ style: . success)
298
+ banner3. delegate = self
299
+
300
+ showBanners ( [ banner1, banner2, banner3] ,
301
+ in: bannerQueue2AllowedSuccess)
302
+
303
+ case 1 :
304
+ let bannerQueue3AllowedDanger = NotificationBannerQueue ( maxBannersOnScreenSimultaneously: 3 )
305
+
306
+ let banner1 = FloatingNotificationBanner ( title: " Danger Notification 1 " ,
307
+ subtitle: " First Danger Notification in current queue with 3 banners allowed simultaneously " ,
308
+ style: . danger)
309
+ banner1. delegate = self
310
+
311
+ let banner2 = FloatingNotificationBanner ( title: " Danger Notification 2 " ,
312
+ subtitle: " Second Danger Notification in current queue with 3 banners allowed simultaneously " ,
313
+ style: . danger)
314
+ banner2. delegate = self
315
+
316
+ showBanners ( [ banner1, banner2] ,
317
+ in: bannerQueue3AllowedDanger)
318
+
319
+ case 2 :
320
+ let bannerQueue5AllowedMixed = NotificationBannerQueue ( maxBannersOnScreenSimultaneously: 3 )
321
+
322
+ let banner1 = FloatingNotificationBanner ( title: " Success Notification - 1 " ,
323
+ subtitle: " First Notification from 5 in current queue with 3 banners allowed simultaneously " ,
324
+ style: . success)
325
+ banner1. delegate = self
326
+
327
+ let banner2 = FloatingNotificationBanner ( title: " Danger Notification - 2 " ,
328
+ subtitle: " Second Notification from 5 in current queue with 3 banners allowed simultaneously " ,
329
+ style: . danger)
330
+ banner2. delegate = self
331
+
332
+ let banner3 = FloatingNotificationBanner ( title: " Info Notification - 3 " ,
333
+ subtitle: " Third Notification from 5 in current queue with 3 banners allowed simultaneously " ,
334
+ style: . info)
335
+ banner3. delegate = self
336
+
337
+ let banner4 = FloatingNotificationBanner ( title: " Success Notification - 4 " ,
338
+ subtitle: " Fourth Notification from 5 in current queue with 3 banners allowed simultaneously " ,
339
+ style: . success)
340
+ banner4. delegate = self
341
+
342
+ let banner5 = FloatingNotificationBanner ( title: " Info Notification - 5 " ,
343
+ subtitle: " Fifth Notification from 5 in current queue with 3 banners allowed simultaneously " ,
344
+ style: . info)
345
+ banner5. delegate = self
346
+
347
+ showBanners ( [ banner1, banner2, banner3, banner4, banner5] ,
348
+ in: bannerQueue5AllowedMixed)
349
+
350
+ default :
351
+ break
352
+ }
353
+ }
266
354
267
355
internal func basicStatusBarNotificationCellSelected( at index: Int ) {
268
356
switch index {
@@ -334,6 +422,8 @@ extension ExampleViewController: ExampleViewDelegate {
334
422
case 4 :
335
423
return 4
336
424
case 5 :
425
+ return 3
426
+ case 6 :
337
427
return 6
338
428
default :
339
429
return 0
@@ -353,6 +443,8 @@ extension ExampleViewController: ExampleViewDelegate {
353
443
case 4 :
354
444
return " Floating Notification Banners "
355
445
case 5 :
446
+ return " Simultaneous Floating Notification Banners "
447
+ case 6 :
356
448
return " Status Bar Notifications "
357
449
default :
358
450
return " "
@@ -362,7 +454,7 @@ extension ExampleViewController: ExampleViewDelegate {
362
454
internal func blockColor( at indexPath: IndexPath ) -> UIColor {
363
455
364
456
if indexPath == IndexPath ( row: numberOfCells ( for: indexPath. section) - 2 , section: 0 )
365
- || indexPath == IndexPath ( row: numberOfCells ( for: indexPath. section) - 2 , section: 5 ) {
457
+ || indexPath == IndexPath ( row: numberOfCells ( for: indexPath. section) - 2 , section: 6 ) {
366
458
return CustomBannerColors ( ) . color ( for: . warning)
367
459
}
368
460
@@ -446,6 +538,17 @@ extension ExampleViewController: ExampleViewDelegate {
446
538
return ( " " , nil )
447
539
}
448
540
} else if indexPath. section == 5 {
541
+ switch indexPath. row {
542
+ case 0 :
543
+ return ( " 3 Success Notifications " , " Display it at once, with 2 in queue allowed simultaneosly " )
544
+ case 1 :
545
+ return ( " 2 Danger Notifications " , " Display it at once, with 3 in queue allowed simultaneosly " )
546
+ case 2 :
547
+ return ( " 5 Mixed Notifications " , " Display it at once, with 3 in queue allowed simultaneosly " )
548
+ default :
549
+ return ( " " , nil )
550
+ }
551
+ } else if indexPath. section == 6 {
449
552
switch indexPath. row {
450
553
case 0 :
451
554
return ( " Success Notification " , nil )
0 commit comments