Update to latest Swift / Xcode versions and use PDF vector assets
Felix Kaechele (4): Replace .gitignore with github's one for Swift projects Update Cartfile Update to Swift 2.1 Use PDF assets where applicable
.gitignore | 65 ++++++++- Cartfile | 4 +- Cartfile.resolved | 4 +- FreeOTP.xcodeproj/project.pbxproj | 16 --- .../AppIcon.appiconset/Contents.json | 17 ++- FreeOTP/Assets.xcassets/Contents.json | 6 + .../Assets.xcassets/FreeOTP.imageset/Contents.json | 12 ++ .../Assets.xcassets/FreeOTP.imageset/FreeOTP.pdf | Bin 0 -> 1552 bytes .../Assets.xcassets/Lock.imageset/Contents.json | 12 ++ FreeOTP/Assets.xcassets/Lock.imageset/lock.pdf | Bin 0 -> 1158 bytes .../Assets.xcassets/QRCode.imageset/Contents.json | 12 ++ FreeOTP/Assets.xcassets/QRCode.imageset/qrcode.pdf | Bin 0 -> 3343 bytes FreeOTP/Base.lproj/Main.storyboard | 159 ++++++--------------- FreeOTP/ImageDownloader.swift | 4 +- FreeOTP/ImageViewController.swift | 2 +- FreeOTP/KeychainStore.swift | 6 +- FreeOTP/Launch.storyboard | 7 +- FreeOTP/OTP.swift | 2 +- FreeOTP/Token.swift | 2 +- FreeOTP/default.png | Bin 27060 -> 0 bytes FreeOTP/lock.png | Bin 1020 -> 0 bytes FreeOTP/qrcode.png | Bin 350 -> 0 bytes FreeOTP/token.png | Bin 27060 -> 0 bytes 23 files changed, 177 insertions(+), 153 deletions(-) create mode 100644 FreeOTP/Assets.xcassets/Contents.json create mode 100644 FreeOTP/Assets.xcassets/FreeOTP.imageset/Contents.json create mode 100644 FreeOTP/Assets.xcassets/FreeOTP.imageset/FreeOTP.pdf create mode 100644 FreeOTP/Assets.xcassets/Lock.imageset/Contents.json create mode 100644 FreeOTP/Assets.xcassets/Lock.imageset/lock.pdf create mode 100644 FreeOTP/Assets.xcassets/QRCode.imageset/Contents.json create mode 100644 FreeOTP/Assets.xcassets/QRCode.imageset/qrcode.pdf delete mode 100644 FreeOTP/default.png delete mode 100644 FreeOTP/lock.png delete mode 100644 FreeOTP/qrcode.png delete mode 100644 FreeOTP/token.png
Source: https://github.com/github/gitignore/blob/master/Swift.gitignore
Signed-off-by: Felix Kaechele felix@kaechele.ca --- .gitignore | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore index ce38713..56adc32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,63 @@ -*.xcuserstate -xcuserdata +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData/ + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata/ + +## Other +*.moved-aside +*.xccheckout +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-p... +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +Carthage/Checkouts +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots + +.DS_Store
Base32 was moved Update definition for moa
Signed-off-by: Felix Kaechele felix@kaechele.ca --- Cartfile | 4 ++-- Cartfile.resolved | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/Cartfile b/Cartfile index 8e02a24..1161d7f 100644 --- a/Cartfile +++ b/Cartfile @@ -1,2 +1,2 @@ -github "yageek/Base32" -github "evgenyneu/moa" ~> 2.0 +github "norio-nomura/Base32" +github "evgenyneu/moa" ~> 2.1 diff --git a/Cartfile.resolved b/Cartfile.resolved index d71ed97..5026d99 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,2 +1,2 @@ -github "yageek/Base32" "v0.3.1" -github "evgenyneu/moa" "2.0.4" +github "norio-nomura/Base32" "v0.4.1" +github "evgenyneu/moa" "2.1.7"
Signed-off-by: Felix Kaechele felix@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
freeotp-devel@lists.fedorahosted.org