Answer by Sargis for Type does not conform to protocol 'Decodable' or...
Removecase party = "party" lineor open// let party: Referenz -> Party? line
View ArticleAnswer by Sargis for How to left align UICollectionViewCells when scrolling...
This code works for me for scrollDirection = .horizontal import UIKitclass LeftAlignedHorizontalCollectionViewFlowLayout: UICollectionViewFlowLayout { required override init() {super.init(); common()}...
View ArticleAnswer by Sargis for How to know Image file Size when using SDWebImages?
Try this:imageView.sd_setImage(with: URL(string: imgUrl), completed: { (image, error, cache, url) in let imageSize = image?.size print("imageSize", imageSize) var imgData: NSData = NSData(data:...
View ArticleAnswer by Sargis for dynamic cell height for custom uitableviewcell not working
Try this:tableView.rowHeight = UITableViewAutomaticDimension;tableView.estimatedRowHeight = 44;
View ArticleAnswer by Sargis for You don't have write permissions for the...
Try this:sudo gem install cocoapods --user-installWorked for me
View ArticleAnswer by Sargis for How to remove all navigationbar back button title
for swift 4,5let BarButtonItemAppearance = UIBarButtonItem.appearance()BarButtonItemAppearance.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.clear], for: .normal)
View ArticleAnswer by Sargis for Objective-C - UIAlertView doesn't delegate
Use this code. (UIAlertView is deprecated since iOS 9.0.)UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Idioma" message:@"" preferredStyle:UIAlertControllerStyleAlert]; [alert...
View ArticleAnswer by Sargis for Single view application has a black background which...
Use this code.- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. self.window =...
View ArticleAnswer by Sargis for How we can get distance between two places's coordinate...
You need to use these coordinates to get the CLLocations for the respective coordinates using the following line of codeCLLocation *location1 = [[CLLocation alloc] initWithLatitude:lat1...
View ArticleAnswer by Sargis for how to detect that app is opening from safari redirect?
Need use "Implementing a Custom URL Scheme"see here:http://www.idev101.com/code/Objective-C/custom_url_schemes.html
View ArticleAnswer by Sargis for How to detect number length in UITextField?
Use this.- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{// _textLenghtLimit = your text max lenght if (_textLenghtLimit...
View ArticleAnswer by Sargis for How can I get the current day of the current year in...
Use this. //Assuming your calendar is initiated like thisNSCalendar *_calendar = [NSCalendar currentCalendar];NSInteger yearlyDay;//Fetch the weekOfYear numberNSInteger weekOfYear = [_calendar...
View ArticleAnswer by Sargis for My tableViewCells not created?
Use this.- (void)viewDidLoad {[super viewDidLoad];self.displayDataTableView.delegate = self;self.displayDataTableView.dataSource = self;self.dateArray = [[NSMutableArray alloc]init];self.amountArray =...
View ArticleAnswer by Sargis for Getting crash while adding attributes to...
Use this:NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"I have read, understand and agree to the following terms and conditions and web usage policy."...
View ArticleAnswer by Sargis for Current Week Start and End Date
//Begining of Week Date- (NSDate*) beginingOfWeekOfDate{ NSCalendar *tmpCalendar = [NSCalendar currentCalendar]; NSDateComponents *components = [tmpCalendar...
View ArticleAnswer by Sargis for Converting MPMediaItem to NSData
Try this:-(void)mediaItemToData : (MPMediaItem * ) curItem{ NSURL *url = [curItem valueForProperty: MPMediaItemPropertyAssetURL]; AVURLAsset *songAsset = [AVURLAsset URLAssetWithURL: url options:nil];...
View ArticleAnswer by Sargis for How to import sqlite file into app's document directory...
// Returns the persistent store coordinator for the application.// If the coordinator doesn't already exist, it is created and the application's store added to it.- (NSPersistentStoreCoordinator...
View ArticleAnswer by Sargis for iOS Date format 28 Mar 2016 / 16:54pm
See Instruction or introduction with every lineNSString *str = @"your date here..."; /// here this is your date with format yyyyy-MM-dd'T'HH:mm:ss.SSSZNSDateFormatter *dateFormatter = [[NSDateFormatter...
View ArticleAnswer by Sargis for I get this error when I user dictionary `set value for key`
Use NSMutableDictionary:NSMutableDictionary *dict = [NSMutableDictionary new];...
View ArticleAnswer by Sargis for why use storyboard push a viewcontroller shows black screen
You need to use the instantiateViewControllerWithIdentifier: method of your UIStoryboard instance and then you can push the controller.
View Article