Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController {
  4.  
  5. override func viewDidLoad() {
  6. super.viewDidLoad()
  7. let urlpath = Bundle.main.path(forResource: "Info", ofType: "plist")
  8. let url = NSURL.fileURL(withPath: urlpath!)
  9. let test = FileSysytemUrl(url as NSURL)
  10. if (test == nil) {
  11. print("is empty")
  12. } else {
  13. print("its ok")
  14. }
  15. }
  16.  
  17. override func didReceiveMemoryWarning() {
  18. super.didReceiveMemoryWarning()
  19. }
  20. }
  21.  
  22. struct FileSysytemUrl {
  23. let url: NSURL
  24. init?(_ url: NSURL){
  25. if !url.isFileURL {
  26. return nil
  27. }
  28. self.url = url
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement