forked from yankodimitrov/SwiftPasscodeLock
-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathFunctions.swift
More file actions
26 lines (19 loc) · 778 Bytes
/
Functions.swift
File metadata and controls
26 lines (19 loc) · 778 Bytes
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
//
// Functions.swift
// PasscodeLock
//
// Created by Yanko Dimitrov on 8/28/15.
// Copyright © 2015 Yanko Dimitrov. All rights reserved.
//
import Foundation
func localizedStringFor(key: String, comment: String) -> String {
let name = "PasscodeLock"
let defaultString = NSLocalizedString(key, tableName: name, bundle: NSBundle(forClass: PasscodeLock.self), comment: comment)
return NSLocalizedString(key, value: defaultString, tableName: name, bundle: NSBundle.mainBundle(), comment: comment)
}
func bundleForResource(name: String, ofType type: String) -> NSBundle {
if(NSBundle.mainBundle().pathForResource(name, ofType: type) != nil) {
return NSBundle.mainBundle()
}
return NSBundle(forClass: PasscodeLock.self)
}