This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { | |
return 50.0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// В viewDidLoad | |
tableView.tableFooterView = UIView(frame: CGRect.zero) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVKit | |
import AVFoundation | |
class ViewController: UIViewController { | |
// Создаем плеер и инициализируем фоновое видео и укажем путь к нему | |
var player: AVPlayer? | |
let videoURL: NSURL = Bundle.main.url(forResource: "Название видео", withExtension: "Формат")! as NSURL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 190 | |
yourLabelName.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2) | |
// 180 | |
yourLabelName.transform = CGAffineTransform(rotationAngle: CGFloat.pi) | |
// -90 | |
yourLabelName.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let storyBoard: UIStoryboard = UIStoryboard(name: "Main VC", bundle: nil) | |
let newViewController = storyBoard.instantiateViewController(withIdentifier: "Your Storyboard ID") as! newViewController | |
self.present(newViewController, animated: true, completion: nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// В viewDidLoad | |
self.tableView.separatorColor = UIColor.clear | |
// или | |
tableView.separatorStyle = .none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Создание контроллера | |
let aC = UIAlertController(title: "Название", message: "Описание", preferredStyle: .alert) | |
// Создание кнопки и действия для контроллера | |
let aA = UIAlertAction(title: "Закрыть", style: .default) { (action: UIAlertAction) in | |
print("Default") | |
} | |
// Добавление к контроллеру действия | |
aC.addAction(aA) | |
// Показать контроллер | |
present(aC, animated: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard let url = URL(string: "link") else { return } | |
UIApplication.shared.open(url) |
NewerOlder