Question: Iam trying to make a regular UILocalNotification with default sound 

this is my function 

```
func makeLocalNotificationForNow(str : String , id : String)
{
let notification = UILocalNotification()

notification.alertBody = str // text that will be displayed in the notification
notification.alertAction = "open" // text that is displayed after "slide to..." on the lock screen - defaults to "slide to view"
notification.fireDate = NSDate(timeIntervalSinceNow: 5) // todo item due date (when notification will be fired)
notification.soundName = UILocalNotificationDefaultSoundName // play default sound
UIApplication.sharedApplication().scheduleLocalNotification(notification)
}

```

in my didFinishLaunchingWithOptions function I put 

```
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge , .Sound], categories: nil)
            application.registerUserNotificationSettings(settings)
            application.registerForRemoteNotifications()

```

Note : I also use parse push notifications

when I make the notification , it appears but without an alert or sound (I need to swipe the from top to see the notification 
what's wrong ?!

Answer: 
I always love a question where the answer is Aggregate.

```
  var result = data.Aggregate(
    // base object to store
    new { A = 0, CM = 0, CO = 0, O = 0},
    // add in an element
    (a,d) => {
    switch(d.sum) 
      {
         case "A & E FEE": 
           a.A += d.Account;
           break;
         case "CM FEE": 
           a.CM += d.Account;
           break;
           //etc
      }
      return a;
  });

```

Note you can also - not know the possible values for d.sum in this way -- you would need to use and expando object. That would look something like this (NOT TESTED)

```
  var result = data.Aggregate(
    // base object to store
    new ExpandoObject()
    // add in an element
    (a,d.sum.Replace(" ","_") => {
      a[d.sum.Replace(" ","_")] += d.Account;
      return a;
  });

```

This won't work if your sum strings have values which are not valid in property identifiers.
This produced the results I was looking for

```
var accounts = new List<string>()
                       {
                           "A & E FEE",
                           "cm fee",
                           "contract value",
                           "overhead"
                       };

        var commission = PJPTDSUMs
            .Where(p => p.Project.StartsWith("b29317")
                        && accounts.Contains(p.Acct)
                        && !p.Pjt_entity.StartsWith("05"))
            .GroupBy(c => c.Project)
            .Select(g => new
                         {
                             AeFee = g.Where(p => p.Acct == "A & E FEE").Sum(s => s.Eac_amount),
                             CmFee = g.Where(p => p.Acct == "cm fee").Sum(s => s.Eac_amount),
                             ContractValue = g.Where(p => p.Acct == "contract value").Sum(s => s.Eac_amount),
                             Overhead = g.Where(p => p.Acct == "overhead").Sum(s => s.Eac_amount),
                         });

+--------+--------+---------------+----------+
| AeFee  | CmFee  | ContractValue | Overhead |
+--------+--------+---------------+----------+
| 182396 | 108569 |       2256044 |   197397 |
+--------+--------+---------------+----------+

```