UIPicker detect tap on currently selected row

First, conform the class to the UIGestureRecognizerDelegate protocol Then, in the view setup: UITapGestureRecognizer *tapToSelect = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tappedToSelectRow:)]; tapToSelect.delegate = self; [self.pickerView addGestureRecognizer:tapToSelect]; And elsewhere: #pragma mark – Actions – (IBAction)tappedToSelectRow:(UITapGestureRecognizer *)tapRecognizer { if (tapRecognizer.state == UIGestureRecognizerStateEnded) { CGFloat rowHeight = [self.pickerView rowSizeForComponent:0].height; CGRect selectedRowFrame = CGRectInset(self.pickerView.bounds, 0.0, (CGRectGetHeight(self.pickerView.frame) – rowHeight) / 2.0 ); … Read more

tap() vs subscribe() to set a class property

Edit: Ignore this answer! Here is a good answer: https://stackoverflow.com/a/50882183/5932590 See JMD’s comment below for more context! Good question. In the source code for the tap operator, this comment pretty much sums it up: This operator is useful for debugging your Observables for the correct values or performing other side effects. Note: this is different … Read more

Why doesn’t await on Task.WhenAll throw an AggregateException?

I know this is a question that’s already answered but the chosen answer doesn’t really solve the OP’s problem, so I thought I would post this. This solution gives you the aggregate exception (i.e. all the exceptions that were thrown by the various tasks) and doesn’t block (workflow is still asynchronous). async Task Main() { … Read more

Should I use tap or tun for openvpn?

if it’s ok to create vpn on layer 3 (one more hop between subnets) – go for tun. if you need to bridge two ethernet segments in two different locations – then use tap. in such setup you can have computers in the same ip subnet (eg 10.0.0.0/24) on both ends of vpn, and they’ll … Read more