if (in_array($content["ext"], array("zip"))) {
$zip = zip_open($file);
$files = array();
while ($zip_entry = zip_read($zip)) {
$zip_path = zip_entry_name($zip_entry);
$path = explode("/", $zip_path);
$path = array_filter($path);
$lastElement = end($path);
//reset pointer
$cur = &$files;
$count = count($path);
//set pointer to proper parent folder
for ($i = 0; $i < $count - 1; $i++) {
$cur = &$cur[$path[$i]];
}
//add file
$cur[] = $path[$i];
}
//delete pointer
unset($cur);
}
print_r($files);
Вам нужно отправить цель, как это
func tapRecognizerforLabel (named label: UILabel, action: Selector,target:Any) {
let tapGestureForLabel = UITapGestureRecognizer(target:target, action: action)
label.addGestureRecognizer(tapGestureForLabel)
label.isUserInteractionEnabled = true
}
Цель должна содержать реализацию метода внутри селектора, поскольку вы устанавливаете self
, который является Toolbox
, и он не следовательно, произойдет сбой, чтобы вызвать
Toolbox.tapRecognizerforLabel(named: nameLabel, action: #selector(self.methodAlpha),target:self)