Skip to content

Instantly share code, notes, and snippets.

View ritesh-fueled's full-sized avatar

ritesh-fueled

View GitHub Profile
{
"height" : 540,
"imageURL" : "http:\/\/dkv86q98b2n3t.cloudfront.net\/139080101\/120747351478\/dfe8a47c-0b17-4e2b-b82e-42190aad87ef_640x480.jpg",
"width" : 720,
"thumbnailImageURL" : "http:\/\/dkv86q98b2n3t.cloudfront.net\/139080101\/120747351478\/dfe8a47c-0b17-4e2b-b82e-42190aad87ef_200x150.jpg"
}
{
"height" : 540,
"imageURL" : "http:\/\/dkv86q98b2n3t.cloudfront.net\/139080101\/120747351478\/001341d0-da67-43b1-8ad1-4be35f917138_640x480.jpg",
"width" : 720,
@ritesh-fueled
ritesh-fueled / iOSFontCompression
Created May 26, 2014 07:45
Adjust text font size to adjust into single line
[self.label setNumberOfLines:1];
[self.label setMinimumScaleFactor:0.5]; // 0.5 is the lower threshold limit, you can change it to any value
[self.label setAdjustsFontSizeToFitWidth:YES];
@ritesh-fueled
ritesh-fueled / iOSDynamicFontSizeChange
Last active August 29, 2015 13:56
Label or Text Dynamic Type
-(void) doDynamicTypeThings{
self.someHeadline.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline];
self.someBodyTextLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(preferredContentSizeChanged:)
name:UIContentSizeCategoryDidChangeNotification
@ritesh-fueled
ritesh-fueled / iOSAttributedString
Last active August 29, 2015 13:56
Attributed String
NSMutableAttributedString *attributedString =
[[NSMutableAttributedString alloc]initWithString:@"someText"];
NSDictionary *defaultProperties = @{ NSFontAttributeName : [UIFont defaultFont],
NSForegroundColorAttributeName : [UIColor defaultColor]};
NSDictionary *uniqueProperty = @{ NSFontAttributeName : [UIFont uniqueFont],
NSForegroundColorAttributeName : [UIColor uniqueColor]};
[attributedString addAttributes:defaultProperties
range:NSMakeRange(defaultStartLocationInIntegers,
@ritesh-fueled
ritesh-fueled / installDependenciesToCompileObjectiveCInUbuntu
Last active December 27, 2017 13:36
~ You can use this script to install all the libraries <dependencies> required to compile and run objective-C code in ubuntu + it provides ''compileAndRunObjC" into your terminal which you can use it to compile and run any objective-C code. ~
#!/bin/bash
echo -e "\n\n----------------------starting to install gcc compiler for objective C----------------------";
echo -e "\n----------------------running: <sudo apt-get install gnustep gnustep-devel>----------------------"
sudo apt-get install gnustep gnustep-devel
echo -e "\n----------------------gnustep installed----------------------"
echo -e "\n----------------------running: <sudo apt-get install gobjc>----------------------"
sudo apt-get install gobjc
echo -e "\n----------------------gobjc installed----------------------"
sudo apt-get install tree
echo -e "\n------------------------Making Project structure-------------"