Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Swift 3 Update #617

Merged
merged 49 commits into from
Nov 3, 2016
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
1bb1559
[Swift 3] Initial pod update.
ashfurrow Oct 4, 2016
006d4de
[Swift 3] Initial Xcode migration, modulo edits.
ashfurrow Oct 4, 2016
5402da8
Merge branch 'swift-3' into swift-3-update
ashfurrow Oct 4, 2016
b040c5d
[Swift 3] Fixed the easy bugs.
ashfurrow Oct 4, 2016
2ffc694
[Swift 3] More fixes.
ashfurrow Oct 4, 2016
ebc3928
[Swift 3] Updates Podfile to CocoaPods 1.0.
ashfurrow Oct 4, 2016
ac9504c
[Swift 3] Fixes more errors.
ashfurrow Oct 7, 2016
7a11191
[Swift 3] Cleans up remaining compiler errors.
ashfurrow Oct 7, 2016
a673dc9
[Swift 3] Cleans up unit test compiler errors.
ashfurrow Oct 7, 2016
71bbb27
[Swift 3] Fixes some initial runtime errors.
ashfurrow Oct 7, 2016
8538c74
[Swift 3] Replaces ISO8601DateFormatter.
ashfurrow Oct 7, 2016
d26b7b2
[Swift 3] Updates IUO handling.
ashfurrow Oct 7, 2016
be34c2c
[Swift 3] Updates snapshots with new colours.
ashfurrow Oct 7, 2016
4936af4
pod install'd.
ashfurrow Oct 25, 2016
155dae8
Deprecation warnings.
ashfurrow Oct 25, 2016
080afbb
Remainder of deprecation warnings.
ashfurrow Oct 25, 2016
95514dc
RxSwift Updates.
ashfurrow Oct 25, 2016
06e3b4a
Fixed non-snapshot-test failures.
ashfurrow Oct 25, 2016
180b455
Replaces snapshots for updated test successes.
ashfurrow Oct 25, 2016
8784cee
Fixes tests failing due to attributed text problems.
ashfurrow Oct 25, 2016
05fe0c2
Fixes listings snapshot tests.
ashfurrow Oct 25, 2016
2077909
Fixes Loading VC tests.
ashfurrow Oct 25, 2016
f676c3e
Fixes remaining snapshot tests.
ashfurrow Oct 25, 2016
a4af8b3
Fixed confirmYourBidViewController layout.
ashfurrow Oct 25, 2016
ecf8a41
Fixes the rest of the fulfillment UI layout.
ashfurrow Oct 25, 2016
d865963
Fixes tests for fulfillment layout.
ashfurrow Oct 25, 2016
dbbb959
Updates to recommended Xcode settings.
ashfurrow Oct 25, 2016
f643fbe
Removed unused Podfile syntax.
ashfurrow Oct 25, 2016
4c6045a
Changelog update.
ashfurrow Oct 25, 2016
2be3b7b
Updates CocoaPods.
ashfurrow Oct 25, 2016
a8fb5c3
Merge branch 'master' into swift-3-update
ashfurrow Oct 25, 2016
30fa2c1
Fixes help menu.
ashfurrow Oct 25, 2016
46a93dd
Attempts to fix CI, adds debugging info to CI.
ashfurrow Oct 25, 2016
2c18a81
Fixes conditions of sale.
ashfurrow Oct 25, 2016
f250c39
Set Travis to Xcode 8.
ashfurrow Oct 25, 2016
c67248b
Pod install'd.
ashfurrow Oct 31, 2016
0fb22fa
Updates CocoaPods.
ashfurrow Oct 31, 2016
1d0898c
[CI] Adds repo update.
ashfurrow Nov 1, 2016
db98ec8
Silences repo update.
ashfurrow Nov 1, 2016
6924fe4
[CI] Updates build command.
ashfurrow Nov 1, 2016
0b76359
[Fulfillment] Re-aligned bid text field.
ashfurrow Nov 1, 2016
c93a6d6
Fixes alignment issue.
ashfurrow Nov 1, 2016
ec2bdd4
Fixes problem displaying no-internet-connection view too long.
ashfurrow Nov 1, 2016
3482d4c
Fixes tests.
ashfurrow Nov 1, 2016
1abad6b
Fixed problem in Admin card testing view.
ashfurrow Nov 2, 2016
d3e2d88
Fixes tests, hopefully.
ashfurrow Nov 2, 2016
563dec8
Merge branch 'swift-3-update' of https://github.com/artsy/eidolon int…
ashfurrow Nov 2, 2016
38b4dc8
Updates snapshot tests reference images.
ashfurrow Nov 2, 2016
41eb50e
Reverts CFTReaderType fix.
ashfurrow Nov 2, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions CHANGELOG.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
- Updates app to iOS 10. [ash]
- Updates project to Xcode 8 / Swift 3. [ash]
- Enables compiler optimizations. [ash]

upcoming:

releases:
Expand Down Expand Up @@ -356,15 +360,3 @@ releases:
- Bid fulfillment shows in a popover [orta]
- Bid Fulfillment flow is prototypical via the bottom buttons [orta]
- Analytics / Hockey setup [orta]












59 changes: 32 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GEM
specs:
RubyInline (3.12.4)
ZenTest (~> 4.3)
ZenTest (4.11.0)
ZenTest (4.11.1)
activesupport (4.2.7.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
Expand All @@ -18,38 +18,42 @@ GEM
cert (1.4.2)
fastlane_core (>= 0.50.3, < 1.0.0)
spaceship (>= 0.32.0, < 1.0.0)
claide (0.9.1)
cocoapods (0.39.0)
activesupport (>= 4.0.2)
claide (~> 0.9.1)
cocoapods-core (= 0.39.0)
cocoapods-downloader (~> 0.9.3)
cocoapods-plugins (~> 0.4.2)
cocoapods-search (~> 0.1.0)
cocoapods-stats (~> 0.6.2)
cocoapods-trunk (~> 0.6.4)
cocoapods-try (~> 0.5.1)
claide (1.0.1)
cocoapods (1.1.1)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.1, < 2.0)
cocoapods-core (= 1.1.1)
cocoapods-deintegrate (>= 1.0.1, < 2.0)
cocoapods-downloader (>= 1.1.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.1.1, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
molinillo (~> 0.4.0)
fourflusher (~> 2.0.1)
gh_inspector (~> 1.0)
molinillo (~> 0.5.1)
nap (~> 1.0)
xcodeproj (~> 0.28.2)
cocoapods-core (0.39.0)
activesupport (>= 4.0.2)
xcodeproj (>= 1.3.3, < 2.0)
cocoapods-core (1.1.1)
activesupport (>= 4.0.2, < 5)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
cocoapods-downloader (0.9.3)
cocoapods-keys (1.6.0)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.2)
cocoapods-keys (1.7.0)
dotenv
osx_keychain
cocoapods-plugins (0.4.2)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (0.1.0)
cocoapods-stats (0.6.2)
cocoapods-trunk (0.6.4)
cocoapods-search (1.0.0)
cocoapods-stats (1.0.0)
cocoapods-trunk (1.1.1)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (0.5.1)
cocoapods-try (1.1.0)
colored (1.2)
commander (4.4.0)
highline (~> 1.7.2)
Expand Down Expand Up @@ -121,6 +125,7 @@ GEM
plist (~> 3.1)
rubyzip (~> 1.1.6)
terminal-table (~> 1.4.5)
fourflusher (2.0.1)
frameit (2.7.0)
deliver (> 0.3)
fastimage (~> 1.6.3)
Expand Down Expand Up @@ -188,8 +193,8 @@ GEM
mime-types-data (3.2016.0521)
mini_magick (4.5.1)
mini_portile2 (2.0.0)
minitest (5.9.0)
molinillo (0.4.2)
minitest (5.9.1)
molinillo (0.5.2)
multi_json (1.12.1)
multi_xml (0.5.5)
multipart-post (2.0.0)
Expand Down Expand Up @@ -275,9 +280,9 @@ GEM
xcode-install (2.0.4)
claide (>= 0.9.1, < 1.1.0)
spaceship (>= 0.25.1, < 1.0.0)
xcodeproj (0.28.2)
xcodeproj (1.3.3)
activesupport (>= 3)
claide (~> 0.9.1)
claide (>= 1.0.1, < 2.0)
colored (~> 1.2)
xcpretty (0.2.2)
rouge (~> 1.8)
Expand Down
135 changes: 77 additions & 58 deletions Kiosk.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion Kiosk.xcodeproj/xcshareddata/xcschemes/Kiosk.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
LastUpgradeVersion = "0800"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -85,6 +85,13 @@
ReferencedContainer = "container:Kiosk.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disable"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
Expand Down
18 changes: 8 additions & 10 deletions Kiosk/Admin/AdminCardTestingViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class AdminCardTestingViewController: UIViewController {
cardHandler.cardStatus
.subscribe { (event) in
switch event {
case .Next(let message):
case .next(let message):
self.log("\(message)")
case .Error(let error):
case .error(let error):
self.log("\n====Error====\n\(error)\nThe card reader may have become disconnected.\n\n")
if self.cardHandler.card != nil {
self.log("==\n\(self.cardHandler.card!)\n\n")
}
case .Completed:
case .completed:
guard let card = self.cardHandler.card else {
// Restarts the card reader
self.cardHandler.startSearching()
Expand All @@ -48,19 +48,17 @@ class AdminCardTestingViewController: UIViewController {
cardHandler.startSearching()
}

override func viewWillDisappear(animated: Bool) {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
cardHandler.end()
}

func log(string: String) {
func log(_ string: String) {
self.logTextView.text = "\(self.logTextView.text)\n\(string)"

}

@IBAction func backTapped(sender: AnyObject) {
navigationController?.popViewControllerAnimated(true)
@IBAction func backTapped(_ sender: AnyObject) {
_ = navigationController?.popViewController(animated: true)
}


}
}
14 changes: 7 additions & 7 deletions Kiosk/Admin/AdminLogViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ class AdminLogViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
textView.text = try? NSString(contentsOfURL: logPath(), encoding: NSASCIIStringEncoding) as String
textView.text = try? NSString(contentsOf: logPath(), encoding: String.Encoding.ascii.rawValue) as String
}

@IBOutlet weak var textView: UITextView!
@IBAction func backButtonTapped(sender: AnyObject) {
self.navigationController?.popViewControllerAnimated(true)
@IBAction func backButtonTapped(_ sender: AnyObject) {
_ = self.navigationController?.popViewController(animated: true)
}

func logPath() -> NSURL {
let docs = NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask).last!
return docs.URLByAppendingPathComponent("logger.txt")
func logPath() -> URL {
let docs = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).last!
return docs.appendingPathComponent("logger.txt")
}

@IBAction func scrollTapped(sender: AnyObject) {
@IBAction func scrollTapped(_ sender: AnyObject) {
textView.scrollRangeToVisible(NSMakeRange(textView.text.characters.count - 1, 1))
}
}
44 changes: 22 additions & 22 deletions Kiosk/Admin/AdminPanelViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ class AdminPanelViewController: UIViewController {
@IBOutlet weak var auctionIDLabel: UILabel!


@IBAction func backTapped(sender: AnyObject) {
self.presentingViewController?.dismissViewControllerAnimated(true, completion: nil)
@IBAction func backTapped(_ sender: AnyObject) {
self.presentingViewController?.dismiss(animated: true, completion: nil)
appDelegate().setHelpButtonHidden(false)
}

@IBAction func closeAppTapped(sender: AnyObject) {
@IBAction func closeAppTapped(_ sender: AnyObject) {
exit(1)
}

override func viewDidAppear(animated: Bool) {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

appDelegate().setHelpButtonHidden(true)
}

override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue == .LoadAdminWebViewController {
let webVC = segue.destinationViewController as! AuctionWebViewController
let webVC = segue.destination as! AuctionWebViewController
let auctionID = AppSetup.sharedState.auctionID
let base = AppSetup.sharedState.useStaging ? "staging.artsy.net" : "artsy.net"

webVC.URL = NSURL(string: "https://\(base)/feature/\(auctionID)")!
webVC.url = URL(string: "https://\(base)/feature/\(auctionID)")!

// TODO: Hide help button
}
Expand All @@ -40,27 +40,27 @@ class AdminPanelViewController: UIViewController {
if APIKeys.sharedKeys.stubResponses {
auctionIDLabel.text = "STUBBING API RESPONSES\nNOT CONTACTING ARTSY API"
} else {
let version = (NSBundle.mainBundle().objectForInfoDictionaryKey("CFBundleShortVersionString") as? String) ?? "Unknown"
let version = (Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String) ?? "Unknown"
auctionIDLabel.text = "\(state.auctionID), Kiosk version: \(version)"
}

let environment = state.useStaging ? "PRODUCTION" : "STAGING"
environmentChangeButton.setTitle("USE \(environment)", forState: .Normal)
environmentChangeButton.setTitle("USE \(environment)", for: .normal)

let buttonsTitle = state.showDebugButtons ? "HIDE" : "SHOW"
showAdminButtonsButton.setTitle(buttonsTitle, forState: .Normal)
showAdminButtonsButton.setTitle(buttonsTitle, for: .normal)

let readStatus = state.disableCardReader ? "ENABLE" : "DISABLE"
toggleCardReaderButton.setTitle(readStatus, forState: .Normal)
toggleCardReaderButton.setTitle(readStatus, for: .normal)
}

@IBOutlet weak var environmentChangeButton: UIButton!
@IBAction func switchStagingProductionTapped(sender: AnyObject) {
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject(!AppSetup.sharedState.useStaging, forKey: "KioskUseStaging")
@IBAction func switchStagingProductionTapped(_ sender: AnyObject) {
let defaults = UserDefaults.standard
defaults.set(!AppSetup.sharedState.useStaging, forKey: "KioskUseStaging")

defaults.removeObjectForKey(XAppToken.DefaultsKeys.TokenKey.rawValue)
defaults.removeObjectForKey(XAppToken.DefaultsKeys.TokenExpiry.rawValue)
defaults.removeObject(forKey: XAppToken.DefaultsKeys.TokenKey.rawValue)
defaults.removeObject(forKey: XAppToken.DefaultsKeys.TokenExpiry.rawValue)

defaults.synchronize()
delayToMainThread(1){
Expand All @@ -70,9 +70,9 @@ class AdminPanelViewController: UIViewController {
}

@IBOutlet weak var showAdminButtonsButton: UIButton!
@IBAction func toggleAdminButtons(sender: UIButton) {
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject(!AppSetup.sharedState.showDebugButtons, forKey: "KioskShowDebugButtons")
@IBAction func toggleAdminButtons(_ sender: UIButton) {
let defaults = UserDefaults.standard
defaults.set(!AppSetup.sharedState.showDebugButtons, forKey: "KioskShowDebugButtons")
defaults.synchronize()
delayToMainThread(1){
exit(1)
Expand All @@ -82,9 +82,9 @@ class AdminPanelViewController: UIViewController {

@IBOutlet weak var cardReaderLabel: ARSerifLabel!
@IBOutlet weak var toggleCardReaderButton: SecondaryActionButton!
@IBAction func toggleCardReaderTapped(sender: AnyObject) {
let defaults = NSUserDefaults.standardUserDefaults()
defaults.setObject(!AppSetup.sharedState.disableCardReader, forKey: "KioskDisableCardReader")
@IBAction func toggleCardReaderTapped(_ sender: AnyObject) {
let defaults = UserDefaults.standard
defaults.set(!AppSetup.sharedState.disableCardReader, forKey: "KioskDisableCardReader")
defaults.synchronize()
delayToMainThread(1){
exit(1)
Expand Down
8 changes: 4 additions & 4 deletions Kiosk/Admin/AuctionWebViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ class AuctionWebViewController: WebViewController {
override func viewDidLoad() {
super.viewDidLoad()

let flexibleSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.FlexibleSpace, target: nil, action: nil)
let flexibleSpace = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.flexibleSpace, target: nil, action: nil)

let exitImage = UIImage(named: "toolbar_close")
let backwardBarItem = UIBarButtonItem(image: exitImage, style: .Plain, target: self, action: #selector(exit));
let backwardBarItem = UIBarButtonItem(image: exitImage, style: .plain, target: self, action: #selector(exit));
let allItems = self.toolbarItems! + [flexibleSpace, backwardBarItem]
toolbarItems = allItems
}

func exit() {
let passwordVC = PasswordAlertViewController.alertView { [weak self] in
self?.navigationController?.popViewControllerAnimated(true)
_ = self?.navigationController?.popViewController(animated: true)
return
}
self.presentViewController(passwordVC, animated: true) {}
self.present(passwordVC, animated: true) {}
}
}
Loading