Skip to content

Commit

Permalink
add FilePathConvertible
Browse files Browse the repository at this point in the history
  • Loading branch information
sgr-ksmt committed Jul 23, 2016
1 parent bda1206 commit d346f7e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PDFGenerator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
4D900B911C817444004034C2 /* SampleTableViewController.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4D900B901C817444004034C2 /* SampleTableViewController.storyboard */; };
4D900B931C8174B8004034C2 /* SampleTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D900B921C8174B8004034C2 /* SampleTableViewController.swift */; };
4D900B951C817582004034C2 /* SampleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4D900B941C817582004034C2 /* SampleTableViewCell.swift */; };
4DA8AC331D4350DE00F04F9D /* FilePathConvertible.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DA8AC321D4350DE00F04F9D /* FilePathConvertible.swift */; };
4DC0A7AE1C6C583000E843C8 /* test_image1.png in Resources */ = {isa = PBXBuildFile; fileRef = 4DC0A7AD1C6C583000E843C8 /* test_image1.png */; };
4DD477E01D193ECB00D83D50 /* PDFGenerateError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD477DF1D193ECB00D83D50 /* PDFGenerateError.swift */; };
4DD477E21D19449700D83D50 /* DPIType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4DD477E11D19449700D83D50 /* DPIType.swift */; };
Expand Down Expand Up @@ -78,6 +79,7 @@
4D900B901C817444004034C2 /* SampleTableViewController.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = SampleTableViewController.storyboard; sourceTree = "<group>"; };
4D900B921C8174B8004034C2 /* SampleTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleTableViewController.swift; sourceTree = "<group>"; };
4D900B941C817582004034C2 /* SampleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SampleTableViewCell.swift; sourceTree = "<group>"; };
4DA8AC321D4350DE00F04F9D /* FilePathConvertible.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilePathConvertible.swift; sourceTree = "<group>"; };
4DC0A7AD1C6C583000E843C8 /* test_image1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = test_image1.png; sourceTree = "<group>"; };
4DD477DF1D193ECB00D83D50 /* PDFGenerateError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFGenerateError.swift; sourceTree = "<group>"; };
4DD477E11D19449700D83D50 /* DPIType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DPIType.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -143,6 +145,7 @@
4D2EB59A1C6A47CD007A87E7 /* PDFPageRenderable.swift */,
4D2EB59C1C6ADF1E007A87E7 /* AutoreleasepoolTry.swift */,
4D8A9A6B1D2FB65600007E4B /* PDFPassword.swift */,
4DA8AC321D4350DE00F04F9D /* FilePathConvertible.swift */,
);
path = PDFGenerator;
sourceTree = "<group>";
Expand Down Expand Up @@ -372,6 +375,7 @@
4D2EB59B1C6A47CD007A87E7 /* PDFPageRenderable.swift in Sources */,
4D85127A1D191BA4009EE05C /* PDFPage.swift in Sources */,
4D8A9A6C1D2FB65600007E4B /* PDFPassword.swift in Sources */,
4DA8AC331D4350DE00F04F9D /* FilePathConvertible.swift in Sources */,
4DD477E21D19449700D83D50 /* DPIType.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
25 changes: 25 additions & 0 deletions PDFGenerator/FilePathConvertible.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// FilePathConvertible.swift
// PDFGenerator
//
// Created by Suguru Kishimoto on 7/23/16.
//
//

import Foundation

public protocol FilePathConveritble {
var URL: NSURL { get }
}

extension String: FilePathConveritble {
public var URL: NSURL {
return NSURL(fileURLWithPath: self)
}
}

extension NSURL: FilePathConveritble {
public var URL: NSURL {
return self
}
}

0 comments on commit d346f7e

Please sign in to comment.