Skip to content

Instantly share code, notes, and snippets.

View nobre84's full-sized avatar

Rafael Nobre nobre84

  • Kinzoo
  • Brazil
View GitHub Profile
@albertbori
albertbori / HideableUIView.swift
Last active August 9, 2018 10:14
iOS Swift Extension for easily hiding/showing UIViews constrained using Auto Layout
//
// HideableUIView.swift
// Albert Bori
//
// Created by Albert Bori on 5/19/15.
// Copyright (c) 2015 Albert Bori under the MIT license.
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
//
@scheinem
scheinem / tableViewEditActions.m
Last active September 26, 2019 05:23
iOS 8 beta 2: ''tableView:editActionsForRowAtIndexPath:"
- (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// show UIActionSheet
}];
moreAction.backgroundColor = [UIColor greenColor];
UITableViewRowAction *flagAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Flag" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
// flag the row
}];
@enigmaticape
enigmaticape / SKRequest+Blocks.h
Last active August 29, 2015 14:01
Adding block based interface to Store Kit SKRequest
#import <StoreKit/StoreKit.h>
typedef void(^SKRequestCompletion)(SKRequest * request, NSError * error);
@interface SKRequest (Blocks) <SKRequestDelegate>
- (void) startWithCompletion:(SKRequestCompletion) completion;
@end
@artemstepanenko
artemstepanenko / NSOperationQueue+Completion.h
Created November 23, 2013 21:57
This NSOperationQueue's category solves very simple task. Now you can add completion callback to NSOperationQueue instance.
//
// NSOperationQueue+Completion.h
// QueueTest
//
// Created by Artem Stepanenko on 23.11.13.
// Copyright (c) 2013 Artem Stepanenko. All rights reserved.
//
typedef void (^NSOperationQueueCompletion) (void);
@fjcaetano
fjcaetano / patterns
Last active February 10, 2020 20:19
Some patterns to use with NSStringMask
These are a few patterns commonly used.
1 - Digits only: (\\d+)
2 - Names without special characters: ([A-Za-z\\s]+)
3 - Email: (([\\w\\.\\-]*?@)([\\w\\.\\-]+)(\\.[a-z]{2,4}) # Incompatible with versions previous to 1.1.2 of NSStringMask
4 - Dates: (\\d{2})/(\\d{2})/(\\d{4})
5 - SSN: (\\d{3})-(\\d{2})-(\\d{3})
6 - Telephone: (\\d{3})-(\\d{3})-(\\d{4})
Brasil: