Skip to content

Commit

Permalink
✨ Add iPhone 11 and iPhone 11 Pro support
Browse files Browse the repository at this point in the history
And upgrade to Swift 5
  • Loading branch information
sunnyyoung committed Sep 21, 2019
1 parent 119638e commit 5aaa4b9
Show file tree
Hide file tree
Showing 6 changed files with 556 additions and 98 deletions.
34 changes: 12 additions & 22 deletions AppleReserver.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
7DF7481B1F70F3D000949D8E /* Frameworks */,
7DF7481C1F70F3D000949D8E /* Resources */,
283B069508CC4032A00F1335 /* [CP] Embed Pods Frameworks */,
7CAFAA67B86B165CED9B0AF8 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand All @@ -176,7 +175,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1100;
ORGANIZATIONNAME = Sunnyyoung;
TargetAttributes = {
7DF7481D1F70F3D000949D8E = {
Expand All @@ -187,7 +186,7 @@
};
buildConfigurationList = 7DF748191F70F3D000949D8E /* Build configuration list for PBXProject "AppleReserver" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -223,7 +222,7 @@
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-AppleReserver/Pods-AppleReserver-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-AppleReserver/Pods-AppleReserver-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -232,22 +231,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AppleReserver/Pods-AppleReserver-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
7CAFAA67B86B165CED9B0AF8 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AppleReserver/Pods-AppleReserver-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-AppleReserver/Pods-AppleReserver-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
BEC73449C094493EE65914CD /* [CP] Check Pods Manifest.lock */ = {
Expand Down Expand Up @@ -314,13 +298,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -370,13 +356,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -409,14 +397,15 @@
baseConfigurationReference = 0A22BD26D8A0614EE0AB6B2F /* Pods-AppleReserver.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AppleReserver/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = net.sunnyyoung.AppleReserver;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -425,14 +414,15 @@
baseConfigurationReference = 49A7ABB83FFA27EE2FCEA332 /* Pods-AppleReserver.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "-";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = AppleReserver/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = net.sunnyyoung.AppleReserver;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
10 changes: 0 additions & 10 deletions AppleReserver.xcworkspace/contents.xcworkspacedata

This file was deleted.

4 changes: 2 additions & 2 deletions AppleReserver/Constant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
import Foundation

public struct AppleURL {
static let stores = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/iPhoneX/stores.json")!
static let availability = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/iPhoneX/availability.json")!
static let stores = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/A/stores.json")!
static let availability = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/A/availability.json")!
}
4 changes: 2 additions & 2 deletions AppleReserver/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class MainViewController: NSViewController {
guard let json = try JSONSerialization.jsonObject(with: fileData, options: .mutableContainers) as? [String: Any] else {
return
}
self.products = (json["products"] as? [[String: Any]])?.flatMap({ Product(json: $0) })
self.products = (json["products"] as? [[String: Any]])?.compactMap({ Product(json: $0) })
} catch {
NSAlert(error: error).runModal()
}
Expand Down Expand Up @@ -194,7 +194,7 @@ extension MainViewController: NSTableViewDataSource, NSTableViewDelegate {
let partNumber = self.availabilities?[tableView.selectedRow].partNumber else {
return
}
self.reserveURL = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/iPhoneX/availability?channel=1&returnURL=&store=\(storeNumber)&partNumber=\(partNumber)")
self.reserveURL = URL(string: "https://reserve-prime.apple.com/CN/zh_CN/reserve/A/availability?path=/cn/shop/buy-iphone/iphone-11-pro\(storeNumber)&partNumber=\(partNumber)")
}
}
}
Loading

0 comments on commit 5aaa4b9

Please sign in to comment.