Signed-off-by: Felix Kaechele <felix(a)kaechele.ca>
---
FreeOTP/ImageDownloader.swift | 2 +-
FreeOTP/ImageViewController.swift | 2 +-
FreeOTP/KeychainStore.swift | 6 +++---
FreeOTP/OTP.swift | 2 +-
FreeOTP/Token.swift | 2 +-
5 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/FreeOTP/ImageDownloader.swift b/FreeOTP/ImageDownloader.swift
index c8c4481..5a06f9f 100644
--- a/FreeOTP/ImageDownloader.swift
+++ b/FreeOTP/ImageDownloader.swift
@@ -103,7 +103,7 @@ class ImageDownloader : NSObject {
if uri == nil { return completion(DEFAULT) }
if uri!.hasPrefix("phasset:") {
- let id = uri!.substringFromIndex(advance(uri!.startIndex,
"phasset:".characters.count))
+ let id =
uri!.substringFromIndex(uri!.startIndex.advancedBy("phasset:".characters.count))
let rslt = PHAsset.fetchAssetsWithLocalIdentifiers([id], options: nil)
if rslt.count > 0 {
return fromPHAsset(rslt[0] as! PHAsset, completion: completion)
diff --git a/FreeOTP/ImageViewController.swift b/FreeOTP/ImageViewController.swift
index 04d5043..347c14c 100644
--- a/FreeOTP/ImageViewController.swift
+++ b/FreeOTP/ImageViewController.swift
@@ -29,7 +29,7 @@ class ImageViewController : UICollectionViewController,
UICollectionViewDelegate
var token: Token!
required init(coder aDecoder: NSCoder) {
- super.init(coder: aDecoder)
+ super.init(coder: aDecoder)!
}
override func didRotateFromInterfaceOrientation(fromInterfaceOrientation:
UIInterfaceOrientation) {
diff --git a/FreeOTP/KeychainStore.swift b/FreeOTP/KeychainStore.swift
index 9fc2573..61836d2 100644
--- a/FreeOTP/KeychainStore.swift
+++ b/FreeOTP/KeychainStore.swift
@@ -57,7 +57,7 @@ public class KeychainStore<T: KeychainStorable> {
nil
)
- add[kSecAttrAccessControl as String] = sac.takeUnretainedValue()
+ add[kSecAttrAccessControl as String] = sac
} else {
add[kSecAttrAccessible as String] =
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly
}
@@ -99,11 +99,11 @@ public class KeychainStore<T: KeychainStorable> {
var dict = query(account)
dict[kSecReturnData as String] = true
- var output: Unmanaged<AnyObject>?
+ var output: AnyObject?
let status = SecItemCopyMatching(dict, &output)
if status == errSecSuccess {
if let o = output {
- let data = o.takeUnretainedValue() as! NSData
+ let data = o as! NSData
return NSKeyedUnarchiver.unarchiveObjectWithData(data) as? T
}
}
diff --git a/FreeOTP/OTP.swift b/FreeOTP/OTP.swift
index 475b2a9..55d3ae3 100644
--- a/FreeOTP/OTP.swift
+++ b/FreeOTP/OTP.swift
@@ -93,7 +93,7 @@ public final class OTP : NSObject, KeychainStorable {
@objc required public init?(coder aDecoder: NSCoder) {
account = aDecoder.decodeObjectForKey("account") as! String
- secret = aDecoder.decodeObjectOfClass(NSData.self, forKey: "secret")
as! NSData
+ secret = aDecoder.decodeObjectOfClass(NSData.self, forKey: "secret")!
as NSData
algo = aDecoder.decodeIntegerForKey("algo")
size = aDecoder.decodeIntegerForKey("size")
digits = aDecoder.decodeIntegerForKey("digits")
diff --git a/FreeOTP/Token.swift b/FreeOTP/Token.swift
index ebc42d9..0d96ca0 100644
--- a/FreeOTP/Token.swift
+++ b/FreeOTP/Token.swift
@@ -130,7 +130,7 @@ public final class Token : NSObject, KeychainStorable {
// Normalize path
var path = urlc.path == nil ? "" : urlc.path!
while path.hasPrefix("/") {
- path = path.substringFromIndex(advance(path.startIndex, 1))
+ path = path.substringFromIndex(path.startIndex.advancedBy(1))
}
if path == "" {
return nil
--
2.7.1