NSLog(@"type a text:\n");
NSFileHandle *input = [NSFileHandle fileHandleWithStandardInput];
NSData *inputData = [input availableData];
NSString *str = [[NSString alloc] initWithData:inputData encoding:NSUTF8StringEncoding];
NSLog(@"Text: %@", str); collectionView:didSelectItemAtIndexPath://Сначала регистрируешь гестуре, потом определяешь функцию, которую он вызывает и в этой функции пишешь следующее
//Это точка нажатия относительно коллекции
CGPoint gestureLocationInCollectionView = [gesture locationInView:self.collectionView];
// А тут находим индекс пас, но при его использовании проверяй всегда есть ли он на самом деле.
NSIndexPath *indexPathForLocation = [self.collectionView indexPathForItemAtPoint:gestureLocationInCollectionView];
if (indexPathForLocation) {
//Code here
} UIButton *button = [[UIButton alloc] init];
[button addTarget:self action:@selector(pushButton:) forControlEvents:UIControlEventTouchUpInside];- (void)pushButton:(id)sender{
//code
}- (IBAction)refresh:(id)sender{
//Code
}NSString *iTunesLink = @"itms-apps://itunes.apple.com/blablabla";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:iTunesLink]]; extension String {
var localized: String {
return NSLocalizedString(self, tableName: nil, bundle: NSBundle.mainBundle(), value: "", comment: "")
}
}let string = cocoapodsFramework.func().name
myLabel.text = string.localized