UITapGestureRecognizer *tp = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(randomTap:)];
[self.view addGestureRecognizer:tp];
- (void)randomTap:(id)sender {
[self.view endEditing:YES];
}
YourViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"YourViewControllerIdentifier"];
[self.navigationController pushViewController:vc animated:YES];
AccountEditVC *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"AccountEditVC"];
[vc editAccount:tmpAcc];
vc.delegate = self;
[self.navigationController pushViewController:vc animated:YES];
__block int i = 10;
void (^block) (int) = ^(int x){
NSLog(@"%d", i); // 11
};
i++;
block (i);
@IBAction func TextGenGo(sender: AnyObject) {
var i:int_least32_t;
var string = outcomeText.string;
for (i=1;i<=textCount.intValue;i++) {
string = string! + String(i) + " ";
}
outcomeText.string = string;
}
import Cocoa
class ViewController: NSViewController {
@IBOutlet var myTextView: NSTextView!
@IBAction func setText(sender: AnyObject) {
myTextView.string = "MyString";
}
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.view setBackgroundColor:[UIColor redColor]];
UIView *mySubview = [[UIView alloc] initWithFrame:CGRectMake(50,50,200,200)];
[mySubview setBackgroundColor:[UIColor blueColor]];
[self.view addSubview:mySubview];
...у нас есть аватарка пользователя, по нажатию на которую открывается экран с дополнительной инфой о пользователе...
...кнопка должна быть кнопкой, ссылка - текстом, а картинка - картинкой...