Tuesday, December 22, 2015

Core Data Deletion Rules Simplified

Person
- shoes (to many to 'Shoe')
         deletion rule is set to cascade


Shoe
- person (to one to 'Person')
        deletion rule is set to nullify

When I delete a 'Person' record all of person.shoes will be deleted as well.

When I delete a 'Shoe' record, shoe.person will not be deleted, rather the person.shoes relationship that used to be there will now be broken and the shoe reference nulled out and it will not have a reference to that shoe.

Wednesday, February 18, 2015

How to get a raise

I made an app called Schotzy.  It helps people get backing to ask your boss for a raise.  You can also anonymously see exactly how much others get paid.

When you first open the app you'll see a profile.  Estimate how much that person makes and you'll see  how much they make.  Make sure you make a good estimate because your score will depend on it.  Sign up with the app to let others estimate how much you make so you can see what others think you should be getting paid.  Show this to your boss when you ask for a raise.

Check it out here: Schotzy



Saturday, September 20, 2014

NSFetchedResultsController in Swift


NSFetchedResultsController in Swift


    lazy var fetchedResultsController: NSFetchedResultsController = {
        let moc = CoreDataTools.sharedInstance.managedObjectContext!
        let entity = NSEntityDescription.entityForName("Certificate", inManagedObjectContext: moc)
        
        let fetchRequest = NSFetchRequest(entityName: NSStringFromClass(Certificate))
        fetchRequest.entity = entity
        fetchRequest.sortDescriptors = [NSSortDescriptor(key: "date", ascending: true)]
        
        var frc = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: moc, sectionNameKeyPath: nil, cacheName: nil)
        var error: NSError? = nil
        frc.performFetch(&error)
        if let e = error {
            println("Error was \(e)")
        }
        return frc

    }()

    func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
        var count = 0
        if let s = self.fetchedResultsController.sections as? [NSFetchedResultsSectionInfo] {
            count = s[section].numberOfObjects
        }
        return count

    }


    lazy var collectionView: UICollectionView = {
        var layoutView = UICollectionViewFlowLayout()
        layoutView.sectionInset = UIEdgeInsetsMake(0, 10, 0, 10)
        layoutView.scrollDirection = UICollectionViewScrollDirection.Horizontal
        layoutView.itemSize = CGSizeMake(100, 100)
        layoutView.minimumLineSpacing = 10
        layoutView.minimumInteritemSpacing = 5
        var colView = UICollectionView(frame: CGRectZero, collectionViewLayout: layoutView)
        colView.setTranslatesAutoresizingMaskIntoConstraints(false)
        colView.registerClass(UICollectionViewCell.self, forCellWithReuseIdentifier: "CertificationCellReuse")
        colView.delegate = self
        colView.dataSource = self
        colView.backgroundColor = ThemeFactory.sharedInstance.appSecondaryColor()
        colView.bounces = true
        colView.alwaysBounceHorizontal = true
        colView.scrollIndicatorInsets = UIEdgeInsetsMake(0,0,3,0)
        colView.indicatorStyle = UIScrollViewIndicatorStyle.Black
        return colView

    }()

Monday, September 15, 2014

ABAddressBookRef Filter through ABRecordRefs

Here's a way to filter some phone contacts:

        ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, &error);
        CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
        CFMutableArrayRef peopleMutable = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);
        if (people) {
            NSInteger numberOfPersonsInAB=CFArrayGetCount(people);
            for (int i =0; i< numberOfPersonsInAB; i++) {
                ABRecordRef record = CFArrayGetValueAtIndex(people, i);
                NSString *note = (__bridge NSString *)(ABRecordCopyValue(record, kABPersonNoteProperty));
                if ( note != nil &&  ([note rangeOfString:@"hi"].location != NSNotFound)) {
                    CFArrayAppendValue(peopleMutable, record);
                }
            }
            CFRelease(people);

        }

Friday, September 12, 2014

Check out Riffle Raffle

This is a simple Raffle app designed to allow you to make and save your own raffles.  This is on the iOS App Store, for iPhone and iPad.

Riffle Raffle



Saturday, September 6, 2014

Riffle Raffle Privacy Policy

https://www.facebook.com/riffleraffleapp?ref=br_tf  RiffleRaffle iOS app  Privacy Policy
This privacy policy has been compiled to better serve those who are concerned with how their 'Personally identifiable information' (PII) is being used online. PII, as used in US privacy law and information security, is information that can be used on its own or with other information to identify, contact, or locate a single person, or to identify an individual in context. Please read our privacy policy carefully to get a clear understanding of how we collect, use, protect or otherwise handle your Personally Identifiable Information in accordance with our website.

What personal information do we collect from the people that visit our blog, website or app?

When ordering or registering on our site, as appropriate, you may be asked to enter your Name, Facebook Groups and Members or other details to help you with your experience.

When do we collect information?

We collect information from you when you After a button tap. or enter information on our site.


How do we use your information?

We may use the information we collect from you when you register, make a purchase, sign up for our newsletter, respond to a survey or marketing communication, surf the website, or use certain other site features in the following ways:
       To personalize user's experience and to allow us to deliver the type of content and product offerings in which you are most interested.
       To improve our website in order to better serve you.

How do we protect visitor information?

We do not use vulnerability scanning and/or scanning to PCI standards.
We do not use an SSL certificate
       We do not need an SSL because:
We ask for only Facebook groups.

Do we use 'cookies'?

We do not use cookies for tracking purposes

You can choose to have your computer warn you each time a cookie is being sent, or you can choose to turn off all cookies. You do this through your browser (like Internet Explorer) settings. Each browser is a little different, so look at your browser's Help menu to learn the correct way to modify your cookies.

If you disable cookies off, some features will be disabled that make your site experience more efficient and some of our services will not function properly.

However, you can still place orders .


Third Party Disclosure

No, we do not sell, trade, or otherwise transfer to outside parties your personally identifiable information unless we provide you with advance notice. This does not include website hosting partners and other parties who assist us in operating our website, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others' rights, property, or safety.

However, non-personally identifiable visitor information may be provided to other parties for marketing, advertising, or other uses.

Third party links

We do not include or offer third party products or services on our website.

Google

Google's advertising requirements can be summed up by Google's Advertising Principles. They are put in place to provide a positive experience for users. https://support.google.com/adwordspolicy/answer/1316548?hl=en
We have not enabled Google AdSense on our site but we may do so in the future.

California Online Privacy Protection Act

CalOPPA is the first state law in the nation to require commercial websites and online services to post a privacy policy. The law's reach stretches well beyond California to require a person or company in the United States (and conceivably the world) that operates websites collecting personally identifiable information from California consumers to post a conspicuous privacy policy on its website stating exactly the information being collected and those individuals with whom it is being shared, and to comply with this policy. - See more at: http://consumercal.org/california-online-privacy-protection-act-caloppa/#sthash.0FdRbT51.dpuf

According to CalOPPA we agree to the following:
Users can visit our site anonymously
Once this privacy policy is created, we will add a link to it on our home page, or as a minimum on the first significant page after entering our website.
Our Privacy Policy link includes the word 'Privacy', and can be easily be found on the page specified above.

Users will be notified of any privacy policy changes:
       On our Privacy Policy Page
Users are able to change their personal information:
       By emailing us

How does our site handle do not track signals?
We honor do not track signals and do not track, plant cookies, or use advertising when a Do Not Track (DNT) browser mechanism is in place.

Does our site allow third party behavioral tracking?
It's also important to note that we do not allow third party behavioral tracking

COPPA (Children Online Privacy Protection Act)

When it comes to the collection of personal information from children under 13, the Children̢۪s Online Privacy Protection Act (COPPA) puts parents in control. The Federal Trade Commission, the nation̢۪s consumer protection agency, enforces the COPPA Rule, which spells out what operators of websites and online services must do to protect children̢۪s privacy and safety online.
We do not specifically market to children under 13.

Fair Information Practices

The Fair Information Practices Principles form the backbone of privacy law in the United States and the concepts they include have played a significant role in the development of data protection laws around the globe. Understanding the Fair Information Practice Principles and how they should be implemented is critical to comply with the various privacy laws that protect personal information.
In order to be in line with Fair Information Practices we will take the following responsive action, should a data breach occur:
We will notify the users via email
       Within 7 business days

We also agree to the individual redress principle, which requires that individuals have a right to pursue legally enforceable rights against data collectors and processors who fail to adhere to the law. This principle requires not only that individuals have enforceable rights against data users, but also that individuals have recourse to courts or a government agency to investigate and/or prosecute non-compliance by data processors.

Contacting Us

If there are any questions regarding this privacy policy you may contact us using the information below.
https://www.facebook.com/RiffleRaffleApp?ref=br_tf
Orem
United States
UT
84005
kkendall33@gmail.com
8019605212

Last Edited on 2014-09-06

Wednesday, September 3, 2014

Scroll Index localized NSHipster

This is freaking sweet:

- (NSString *)tableView:(UITableView *)tableView
titleForHeaderInSection:(NSInteger)section
{
    return [[[UILocalizedIndexedCollation currentCollation] sectionTitles] objectAtIndex:section];
}

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
    return [[UILocalizedIndexedCollation currentCollation] sectionIndexTitles];
}

- (NSInteger)tableView:(UITableView *)tableView
sectionForSectionIndexTitle:(NSString *)title
               atIndex:(NSInteger)index
{
    return [[UILocalizedIndexedCollation currentCollation] sectionForSectionIndexTitleAtIndex:index];
}

This is freaking sweet:

Localized scroll index that shows up on the right of a tableview.  No need to create all the different arrays of localized sections.

Here's some code to make this a little more complete:

    self.tableView.sectionIndexColor = [UIColor colorWithWhite:.5 alpha:1.0];
    self.tableView.sectionIndexTrackingBackgroundColor = [UIColor colorWithWhite:.4 alpha:.2];

Got this from NSHipster