Skip to content

Instantly share code, notes, and snippets.

View nishitpatel's full-sized avatar
🏠
Working from home

Nishit nishitpatel

🏠
Working from home
  • Kotak Securities Pvt. Ltd.
  • Navi Mumbai
View GitHub Profile
@nishitpatel
nishitpatel / UIColor_HexString.h
Created July 26, 2017 13:12
Create UIColor Categories
#import <UIKit/UIKit.h>
@interface UIColor(HexString)
+ (UIColor *) colorWithHexString: (NSString *) hexString;
+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (NSUInteger) length;
@end
@nishitpatel
nishitpatel / Controller.m
Last active July 1, 2017 13:48
Auto Scroll whenever keyboard appears for TextField using UIScrollView
Step 1: Create UI Using UIScrollView (Pur all your elements inside UIScrollView)
Step 2: Implement UITextFieldDelege to UIViewController<UITextFieldDelegate>
Integrate Below code into controller.m file
-(void) viewDidLoad{
self.textField.deleget = self;
}
- (void) scrollViewAdaptToStartEditingTextField:(UITextField*)textField{
@nishitpatel
nishitpatel / ISSUE SOLVING XCODE
Last active July 26, 2017 04:52
IOS Xcode issues and Solutions
1: Non Moduler Framwork
Issue: Include of non-modular header inside framework module 'IBMMObileFirstPlatformFoundationHybrid.MFPMainViewController'
Solution: GO TO -> Target Build Setting -> Find "Allow Non-modular Includes In Framework Modules" -> Change to YES
Reference: https://stackoverflow.com/questions/27776497/include-of-non-modular-header-inside-framework-module
2: Cordova/CDVPlugin.h File not found
Solution: For xcode7 add "$(OBJROOT)/UninstalledProducts/$(PLATFORM_NAME)/include" to your Header Search Paths
(and you may need to set Enable Bitcode to No - was necessary for me, but may be related to different problem with xc7)
Reference: https://stackoverflow.com/questions/10714600/cdvplugin-h-file-not-found-in-cordova-as-component-cleaver
@nishitpatel
nishitpatel / Readme.text
Created April 10, 2017 13:37
Add GitIgnore to existing Repository.
Step 1: Mannually add git ignore file on git server with predefine templates for ex. if you are adding gitignore file in
iOS project than user Object-C template.
Step 2: After successfully adding git ignore update your local branch code with latest code.
Step 3: While Merging master code with local code may be you will see VIM editor to add commit message. So for VIM editor
Just press ESC -> : -> x it will close VIM editor. After than perform
Git add .
Git commit -m "COMMIT MESSAGE"
Git Push origin "BRANCH_NAME"
Step 4: After you run your project you will still see the untracked files. To remove those files perform following setps.
May be in your repository you will see any other file so below path is just for reference please don't take it seriousally
@nishitpatel
nishitpatel / AppDelegets.h
Created February 28, 2017 12:19
CoreData Setup
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@nishitpatel
nishitpatel / Terminal
Last active August 1, 2017 06:40
Mac Terminal Usefull commands
Show All Files in Mac system
step 1: Open Terminal
step 2: write below commands
$ defaults write com.apple.finder AppleShowAllFiles YES
$ killall Finder
1 - first command will visible all files including hidden files
2 - Close all finder window
3 - Window + ALt + right click on finder -> Relunch
@nishitpatel
nishitpatel / Links
Created February 6, 2017 09:39
Aswome Menu library for IOS
@nishitpatel
nishitpatel / AppDelegate
Created January 12, 2017 11:54
UITabBarController Customization 1. UITabBar Shift to Top of the Screen, 2.Add Custome Bottom Border, 3. Add Left to Right swipe effect
//Add Below code to App Delegate .m file
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[[UITabBar appearance] setShadowImage:[[UIImage alloc]init]];
[[UITabBarItem appearance] setTitleTextAttributes:@{
NSFontAttributeName:[UIFont fontWithName:@"Helvetica-Bold" size:14.0f],NSForegroundColorAttributeName : [Utility getUIColorFromHexString:INACTIVE_TAB_TEXT_COLOR]
} forState:UIControlStateNormal];
@nishitpatel
nishitpatel / MYSQL commands
Last active December 28, 2015 11:55
MySql Commands.
Command 1: Display all foriegn key constraint related to table
Query: select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from INFORMATION_SCHEMA.KEY_COLUMN_USAGE where REFERENCED_TABLE_NAME = 'outlets'
Command 2: Drop Foriegn Key Constraint related to table
Query: ALTER TABLE 'Table Name' DROP FOREIGN KEY 'Foriegn Key Name'
Link1: Sort array in java good explaintation.
http://www.webcodegeeks.com/javascript/javascript-sort-array-example/?utm_content=buffer3d3fb&utm_medium=social&utm_source=twitter.com&utm_campaign=buffer