This file contains hidden or 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
| //Setting Obejct Using NSUserDefaults | |
| NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
| [defaults setValue:@"successfull" forKey:@"loggedIn"]; | |
| [defaults synchronize]; //use this method only if you cannot wait for the automatic synchronization | |
| //Getting Object using NSUserDefaults | |
| NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; | |
| NSLog(@"loggedIn is %@",[defaults objectForKey:@"loggedIn"]); | |
This file contains hidden or 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)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController { | |
| return viewController != self.tabBarController.selectedViewController; | |
| } |
This file contains hidden or 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
| /*************************************************************************** | |
| UIView+Toast.h | |
| Toast | |
| Copyright (c) 2014 Charles Scalesse. | |
| 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 |
This file contains hidden or 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*) phoneNumber | |
| { | |
| //NSString *phoneRegex = @"[235689][0-9]{6}([0-9]{3})?"; | |
| NSString *phoneRegex = @"^((\\+)|(00))[0-9]{6,14}$"; | |
| NSPredicate *test = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex]; | |
| return [test evaluateWithObject:phoneNumber]; | |
| } | |
| - (BOOL) NSStringIsValidEmail:(NSString *)checkString | |
| { |
This file contains hidden or 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
| // During startup (-viewDidLoad or in storyboard) do: | |
| self.tableView.allowsMultipleSelectionDuringEditing = NO; | |
| // Override to support conditional editing of the table view. | |
| // This only needs to be implemented if you are going to be returning NO | |
| // for some items. By default, all items are editable. | |
| - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { | |
| // Return YES if you want the specified item to be editable. | |
| return YES; |
This file contains hidden or 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
| //Disabling ios cache and getting remote data | |
| [[NSURLCache sharedURLCache] removeAllCachedResponses]; |
This file contains hidden or 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/Foundation.h> | |
| @interface MyCalendar : NSObject | |
| + (void)requestAccess:(void (^)(BOOL granted, NSError *error))success; | |
| + (BOOL)addEventAt:(NSDate*)eventDate withTitle:(NSString*)title inLocation:(NSString*)location; | |
| @end |
This file contains hidden or 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
| //The following function saves UIImage in test.png file in the user Document folder: | |
| - (void)saveImage: (UIImage*)image | |
| { | |
| if (image != nil) | |
| { | |
| NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
| NSUserDomainMask, YES); | |
| NSString *documentsDirectory = [paths objectAtIndex:0]; | |
| NSString* path = [documentsDirectory stringByAppendingPathComponent: |
This file contains hidden or 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
| Collaborative List of Open-Source iOS Apps | |
| https://github.com/dkhamsing/open-source-ios-apps#official | |
| awesome swift | |
| https://github.com/matteocrippa/awesome-swift | |
| Awesome IOS | |
| https://github.com/vsouza/awesome-ios |
This file contains hidden or 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
| // | |
| // CustomTextField.h | |
| // LMKT | |
| // | |
| // Created by Adnan on 12/15/15. | |
| // | |
| // | |
| #import <UIKit/UIKit.h> |