Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #216 from vimeo/release/3.0.0
Browse files Browse the repository at this point in the history
Release 3.0.0 - Adds Swift 4.2 support
  • Loading branch information
Rogerio de Paula Assis authored May 2, 2019
2 parents 9580535 + 2c0afe6 commit 362ad58
Show file tree
Hide file tree
Showing 63 changed files with 660 additions and 561 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
BUNDLE_PATH: vendor/bundle
FL_OUTPUT_DIR: output
macos:
xcode: "10.1.0"
xcode: "10.2.0"
working_directory: ~/VimeoUpload
shell: /bin/bash --login -o pipefail

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ class BaseCameraRollViewController: UIViewController, UICollectionViewDataSource

private func presentAssetErrorAlert(at indexPath: IndexPath, error: NSError)
{
let alert = UIAlertController(title: "Asset Error", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
let alert = UIAlertController(title: "Asset Error", message: error.localizedDescription, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { [weak self] (action) -> Void in
self?.collectionView.reloadItems(at: [indexPath]) // Let the user manually reselect the cell since reload is async
}))

Expand All @@ -175,8 +175,8 @@ class BaseCameraRollViewController: UIViewController, UICollectionViewDataSource

private func presentErrorAlert(at indexPath: IndexPath, error: NSError)
{
let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
let alert = UIAlertController(title: "Error", message: error.localizedDescription, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { [weak self] (action) -> Void in

guard let strongSelf = self else
{
Expand All @@ -186,7 +186,7 @@ class BaseCameraRollViewController: UIViewController, UICollectionViewDataSource
strongSelf.collectionView.indexPathsForSelectedItems?.forEach({ strongSelf.collectionView.deselectItem(at: $0, animated: true) })
}))

alert.addAction(UIAlertAction(title: "Try Again", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
alert.addAction(UIAlertAction(title: "Try Again", style: .default, handler: { [weak self] (action) -> Void in

guard let strongSelf = self else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,24 +269,24 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Alfie Hanssen";
TargetAttributes = {
AFFA400A1C9CE8E000C7B6F3 = {
CreatedOnToolsVersion = 7.2;
DevelopmentTeam = 35R365FS4Q;
LastSwiftMigration = 0820;
LastSwiftMigration = 1010;
};
AFFA401E1C9CE8E000C7B6F3 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0820;
LastSwiftMigration = 1010;
TestTargetID = AFFA400A1C9CE8E000C7B6F3;
};
};
};
buildConfigurationList = AFFA40061C9CE8E000C7B6F3 /* Build configuration list for PBXProject "VimeoUpload-iOS-OldUpload" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -436,18 +436,27 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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_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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand Down Expand Up @@ -475,26 +484,35 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
AFFA40321C9CE8E000C7B6F3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
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_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;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
Expand All @@ -515,7 +533,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 4.2;
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -533,7 +551,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.alfiehanssen.VimeoUpload-iOS-OldUpload";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/VimeoUpload-iOS-OldUpload/Bridge.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
};
name = Debug;
};
Expand All @@ -550,7 +568,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.alfiehanssen.VimeoUpload-iOS-OldUpload";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "${SRCROOT}/VimeoUpload-iOS-OldUpload/Bridge.h";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
};
name = Release;
};
Expand All @@ -563,7 +581,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.alfiehanssen.VimeoUpload-iOS-OldUploadTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VimeoUpload-iOS-OldUpload.app/VimeoUpload-iOS-OldUpload";
};
name = Debug;
Expand All @@ -577,7 +595,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.alfiehanssen.VimeoUpload-iOS-OldUploadTests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/VimeoUpload-iOS-OldUpload.app/VimeoUpload-iOS-OldUpload";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
{
var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool
{
AFNetworkReachabilityManager.shared().startMonitoring()
OldVimeoUploader.sharedInstance?.applicationDidFinishLaunching() // Ensure init is called on launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>3.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand All @@ -27,14 +27,14 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>So you can upload videos.</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>So you can upload videos.</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class UploadsViewController: UIViewController, UITableViewDataSource, UITableVie
NotificationCenter.default.removeObserver(self, name: Notification.Name(rawValue: DescriptorManagerNotification.DescriptorDidCancel.rawValue), object: nil)
}

func descriptorAdded(_ notification: Notification)
@objc func descriptorAdded(_ notification: Notification)
{
// TODO: should we move this dispatch to within the descriptor manager itself?
DispatchQueue.main.async { () -> Void in
Expand All @@ -119,7 +119,7 @@ class UploadsViewController: UIViewController, UITableViewDataSource, UITableVie
}
}

func descriptorDidCancel(_ notification: Notification)
@objc func descriptorDidCancel(_ notification: Notification)
{
// TODO: should we move this dispatch to within the descriptor manager itself?
DispatchQueue.main.async { () -> Void in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class VideoSettingsViewController: UIViewController, UITextFieldDelegate

self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(VideoSettingsViewController.didTapCancel(_:)))

self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Upload", style: UIBarButtonItemStyle.done, target: self, action: #selector(VideoSettingsViewController.didTapUpload(_:)))
self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Upload", style: .done, target: self, action: #selector(VideoSettingsViewController.didTapUpload(_:)))
}

private func setupAndStartOperation()
Expand Down Expand Up @@ -164,14 +164,14 @@ class VideoSettingsViewController: UIViewController, UITextFieldDelegate

// MARK: Actions

func didTapCancel(_ sender: UIBarButtonItem)
@objc func didTapCancel(_ sender: UIBarButtonItem)
{
self.operation?.cancel()

self.navigationController?.dismiss(animated: true, completion: nil)
}

func didTapUpload(_ sender: UIBarButtonItem)
@objc func didTapUpload(_ sender: UIBarButtonItem)
{
let title = self.titleTextField.text
let description = self.descriptionTextView.text
Expand Down Expand Up @@ -206,12 +206,12 @@ class VideoSettingsViewController: UIViewController, UITextFieldDelegate

private func presentOperationErrorAlert(with error: NSError)
{
let alert = UIAlertController(title: "Operation Error", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
let alert = UIAlertController(title: "Operation Error", message: error.localizedDescription, preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { [weak self] (action) -> Void in
self?.navigationController?.dismiss(animated: true, completion: nil)
}))

alert.addAction(UIAlertAction(title: "Try Again", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
alert.addAction(UIAlertAction(title: "Try Again", style: .default, handler: { [weak self] (action) -> Void in
self?.setupAndStartOperation()
}))

Expand All @@ -220,12 +220,12 @@ class VideoSettingsViewController: UIViewController, UITextFieldDelegate

private func presentDescriptorErrorAlert(with error: NSError)
{
let alert = UIAlertController(title: "Descriptor Error", message: error.localizedDescription, preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
let alert = UIAlertController(title: "Descriptor Error", message: error.localizedDescription, preferredStyle: UIAlertController.Style.alert)
alert.addAction(UIAlertAction(title: "Cancel", style: .default, handler: { [weak self] (action) -> Void in
self?.navigationController?.dismiss(animated: true, completion: nil)
}))

alert.addAction(UIAlertAction(title: "Try Again", style: UIAlertActionStyle.default, handler: { [weak self] (action) -> Void in
alert.addAction(UIAlertAction(title: "Try Again", style: .default, handler: { [weak self] (action) -> Void in
// We start from the beginning (with the operation instead of the descriptor),
// Because the exported file was deleted when the upload descriptor failed,
// We delete it because leaving it up to the API consumer to delete seems a little risky
Expand Down
Loading

0 comments on commit 362ad58

Please sign in to comment.