This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am iltercengiz on github. | |
* I am iltercengiz (https://keybase.io/iltercengiz) on keybase. | |
* I have a public key whose fingerprint is 6408 B427 DFBB 67BC 40EA 89A8 131F 8EC7 BB43 223B | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (UIImage *)imageFromColor:(UIColor *)color { | |
UIImage *image = ({ | |
CGRect rect = CGRectMake(0.0, 0.0, 1.0, 1.0); | |
UIGraphicsBeginImageContext(rect.size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetFillColorWithColor(context, color.CGColor); | |
CGContextFillRect(context, rect); | |
UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); | |
image; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import UIKit | |
import Foundation | |
let timeInterval = NSDate().timeIntervalSince1970 | |
let date = NSDate(timeIntervalSince1970: timeInterval) | |
let dateFormatter = NSDateFormatter() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *string = [@"Fıstıkçı Şahap" stringByFoldingWithOptions:NSDiacriticInsensitiveSearch | |
locale:[NSLocale localeWithLocaleIdentifier:@"en"]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isValidPhoneNumber:(NSString *)phoneNumberString { | |
NSError *error = nil; | |
NBPhoneNumber *phoneNumber = [self.util parse:phoneNumberString defaultRegion:self.region error:&error]; | |
if (error) { | |
return NO; | |
} else { | |
return [self.util isValidNumber:phoneNumber]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
let date = NSDate(timeIntervalSince1970:1426003200) | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateStyle = .MediumStyle | |
dateFormatter.stringFromDate(date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
let date = NSDate(timeIntervalSince1970:1426003200) | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.dateStyle = .MediumStyle | |
dateFormatter.stringFromDate(date) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self.textField addTarget:self action:@selector(textFieldDidChangeText:) forControlEvents:UIControlEventEditingChanged]; | |
- (IBAction)textFieldDidChangeText:(UITextField *)textField { | |
NSLog(@"Updated text: %@", textField.text); | |
} |
OlderNewer