Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import UIKit
- class ViewController: UIViewController {
- override func viewDidLoad() {
- super.viewDidLoad()
- let urlpath = Bundle.main.path(forResource: "Info", ofType: "plist")
- let url = NSURL.fileURL(withPath: urlpath!)
- let test = FileSysytemUrl(url as NSURL)
- if (test == nil) {
- print("is empty")
- } else {
- print("its ok")
- }
- }
- override func didReceiveMemoryWarning() {
- super.didReceiveMemoryWarning()
- }
- }
- struct FileSysytemUrl {
- let url: NSURL
- init?(_ url: NSURL){
- if !url.isFileURL {
- return nil
- }
- self.url = url
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement