Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var photos:NSArray = []
- var imageArr:NSArray=[]
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do any additional setup after loading the view, typically from a nib.
- photos=["Waves", "Storm", "Crackling Fire", "Dry Leaves", "Water"]
- imageArr=[UIImage(named: "1")!,UIImage(named:"2")!,UIImage(named:"3")!,UIImage(named:"4")!,UIImage(named:"5")!]
- //for new thumbnails and names
- func addBlurEffect(toView view:UIView?) {
- // Add blur view
- guard let view = view else { return }
- //This will let visualEffectView to work perfectly
- if let navBar = view as? UINavigationBar{
- navBar.setBackgroundImage(UIImage(), for: .default)
- navBar.shadowImage = UIImage()
- }
- var bounds = view.bounds
- bounds.offsetBy(dx: 0.0, dy: -20.0)
- bounds.size.height = bounds.height + 20.0
- let blurEffect = UIBlurEffect(style: .dark)
- let visualEffectView = UIVisualEffectView(effect: blurEffect)
- visualEffectView.isUserInteractionEnabled = false
- visualEffectView.frame = bounds
- visualEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
- view.insertSubview(visualEffectView, at: 0)
- }
- addBlurEffect(toView: self.navigationController?.navigationBar)
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return photos.count
- }
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: "SongTableViewCell") as! SongTableViewCell
- cell.coverImageView.image=imageArr[indexPath.row]
- cell.songTitleLabel.text!=photos[indexPath.row]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement