- (void) tapGesture: (id)sender
{
UITapGestureRecognizer *gesture = (UITapGestureRecognizer *) sender;
NSInteger userID = gesture.view.tag;
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Main"
bundle:nil];
OthersProfile *vc = (OthersProfile*)[storyboard instantiateViewControllerWithIdentifier:@"othersprofile"];
NSString *strUserID = [NSString stringWithFormat:@"%ld", (long)userID];
vc.userID = strUserID;
[self.viewController.navigationController pushViewController:vc
animated:YES];
}
It used to work with Xcode 8 / Swift 3 but seems like there is a problem with Xcode 9 and swift 4.
I am having property userID not found error.
In Swift file:
var userID : String = ""
override func viewDidLoad() {
print(userID) //no value here
}
Anyone with any idea?
@objc