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
// | |
// SelfSizedTableView.swift | |
// AdjustableTableView | |
// | |
// Created by Dushyant Bansal on 25/02/18. | |
// Copyright © 2018 db42.in. All rights reserved. | |
// | |
import UIKit |
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
func renameFile(oldName:String , newName : String){ | |
do { | |
let originPath = (self.getDirectoryPath() as NSString).appendingPathComponent(oldName) | |
let destinationPath = (self.getDirectoryPath() as NSString).appendingPathComponent(newName) | |
try FileManager.default.moveItem(at: URL(fileURLWithPath: originPath), to: URL(fileURLWithPath: destinationPath)) | |
} catch { |
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
Open terminal and in your project go to the folder where fabric framework exist.if you are using pods then fabric will be inside pod folder. | |
Run below commands in terminal once you have reached the folder path to fabric | |
sudo chmod 777 run | |
sudo chmod 777 uploadDSYM | |
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
//Generic to swap values of two variables regardless of their data type | |
func genericSwap<T>(inout a:T,inout b: T) | |
{ | |
let temp = a | |
a = b | |
b = temp | |
} |
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
//Trigger observer to perform UI update like refresh listing in App | |
dispatch_async(dispatch_get_main_queue(), ^(void) { | |
[[NSNotificationCenter defaultCenter] postNotificationName:@"productListUpdatedWithProductsList" object:nil]; | |
}); | |
//Adding observer in listner Class in ViewDidLoad() | |
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadFriendRequestSent) name:@"productListUpdatedWithProductsList" object:nil]; |
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> |
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
//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
#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
//Disabling ios cache and getting remote data | |
[[NSURLCache sharedURLCache] removeAllCachedResponses]; |
NewerOlder