How to dismis Viewcontroller (popup) by pressing button inside my popup viewcontroller and also touch any where outside
Tag : ios , By : Ted Leung
Date : March 29 2020, 07:55 AM
will help you I changed the code of UIViewController+ENPopUp.m for have a visible button. In code existe a button with screen size for dismiss view. I changed this button and now he is visible. CGFloat buttonSize = 10;
UIButton * dismissButton = [[UIButton alloc] init];
dismissButton.backgroundColor = [UIColor redColor];
dismissButton.frame = CGRectMake((self.view.frame.size.width/2) - (buttonSize/2),(self.view.frame.size.height/2) + (self.view.frame.size.height/4) , buttonSize, buttonSize);
[overlayView addSubview:dismissButton];
[dismissButton addTarget:self action:@selector(dismissPopUpViewController)
forControlEvents:UIControlEventTouchUpInside];
|
Show new ViewController when a button in a collectionViewCell of a collectionView in a TableViewCell is clicked
Tag : swift , By : Novi Indrayani
Date : March 29 2020, 07:55 AM
I wish this helpful for you I try to show a ViewController when a button in a collectionViewCell is clicked. , In the first case, the problem is this line: bienController().performSegueWithIdentifier("extend", sender: sender.tag)
protocol PhotoCategoryCellDelegateProtocol {
func didTapExtendInPhotoCollectionViewCellWithIndex(index: Int, inPhotoCategoryCell: photoCategoryCell)
}
var delegate : PhotoCategoryCellDelegateProtocol?
self.delegate?.didTapExtendInPhotoCollectionViewCellWithIndex(sender.tag, inPhotoCategoryCell: self)
func didTapExtendInPhotoCollectionViewCellWithIndex(index: Int, inPhotoCategoryCell: photoCategoryCell) {
self.boo(index) // or use performSegue if you prefer
}
class bienController : UIViewController, UITableViewDelegate, UITableViewDataSource, PhotoCategoryCellDelegateProtocol { ...
...
} else if indexPath.row == 1 && self.imageNb >= 3 {
var cell = tableView.dequeueReusableCellWithIdentifier("photoCategoryCell") as! photoCategoryCell!
if cell == nil {
cell = photoCategoryCell(style: UITableViewCellStyle.Default, reuseIdentifier: "photoCategoryCell")
}
cell.imageList.removeAll(keepCapacity: false)
for i in 0...10 {
cell.imageList.append(UIImage(named: "maison")!)
}
// set the cell's delegate...
cell.delegate = self
cell.collectionView.delegate = cell
cell.collectionView.dataSource = cell
return cell
} else ...
|
Parsing data from a collectionview Cell to a new viewController using a button in the CollectionViewCell
Tag : swift , By : user186831
Date : March 29 2020, 07:55 AM
Hope this helps The problem is that you are assuming that the sender in prepare is an instance of the cell but your call to performSegue is passing self as the sender. But self in that case is the view controller, not the cell. The solution is to pass the cell instead of self. cell.addBtnAction = {
self.performSegue(withIdentifier: "mainSegue", sender: cell)
}
|
programmatically push to a new viewController after pressing uiAlert button
Tag : ios , By : PatrickSimonHenk
Date : March 29 2020, 07:55 AM
wish helps you I was wondering if it is possible to push to a newViewController after pressing a button in the UiAlertController , This is not right // self.present(navController, animated: true, completion: nil)
self.window?.rootViewController?. present(navController, animated: true, completion: nil)
|
Swift - how to open another viewcontroller with CollectionViewCell inside UITableViewCell
Date : March 29 2020, 07:55 AM
|