forked from DanTheMan827/ios-app-signer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
StringByAppendingPathComponent.swift
60 lines (43 loc) · 1.3 KB
/
StringByAppendingPathComponent.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// StringByAppendingPathComponent.swift
// AppSigner
//
// Created by Daniel Radtke on 11/3/15.
// Copyright © 2015 Daniel Radtke. All rights reserved.
//
import Foundation
extension String {
var lastPathComponent: String {
get {
return (self as NSString).lastPathComponent
}
}
var pathExtension: String {
get {
return (self as NSString).pathExtension
}
}
var stringByDeletingLastPathComponent: String {
get {
return (self as NSString).stringByDeletingLastPathComponent
}
}
var stringByDeletingPathExtension: String {
get {
return (self as NSString).stringByDeletingPathExtension
}
}
var pathComponents: [String] {
get {
return (self as NSString).pathComponents
}
}
func stringByAppendingPathComponent(path: String) -> String {
let nsSt = self as NSString
return nsSt.stringByAppendingPathComponent(path)
}
func stringByAppendingPathExtension(ext: String) -> String? {
let nsSt = self as NSString
return nsSt.stringByAppendingPathExtension(ext)
}
}