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

Commit

Permalink
update: support on Swift 5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Apr 8, 2019
1 parent 4a2c934 commit 49fdd16
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "Alamofire/Alamofire" "4.5.1"
github "Alamofire/Alamofire" "4.8.2"
14 changes: 7 additions & 7 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,19 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0940;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Teambition;
TargetAttributes = {
4A6BC7871C76F8C500DACDA5 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
ProvisioningStyle = Manual;
};
};
};
buildConfigurationList = 4A6BC7831C76F8C500DACDA5 /* Build configuration list for PBXProject "Demo" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -214,6 +214,7 @@
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;
Expand Down Expand Up @@ -269,6 +270,7 @@
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;
Expand Down Expand Up @@ -330,8 +332,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.Demo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -351,8 +352,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.Demo;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion Demo/Info.plist
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>0.6.0</string>
<string>0.10.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
15 changes: 8 additions & 7 deletions FilePreviewController.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,22 @@
4A6BC76B1C76F89300DACDA5 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = Teambition;
TargetAttributes = {
4A6BC7731C76F89300DACDA5 = {
CreatedOnToolsVersion = 7.2.1;
LastSwiftMigration = 0900;
LastSwiftMigration = 1020;
};
};
};
buildConfigurationList = 4A6BC76E1C76F89300DACDA5 /* Build configuration list for PBXProject "FilePreviewController" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 4A6BC76A1C76F89300DACDA5;
productRefGroup = 4A6BC7751C76F89300DACDA5 /* Products */;
Expand Down Expand Up @@ -194,6 +195,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -253,6 +255,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
Expand Down Expand Up @@ -322,8 +325,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -347,8 +349,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.Teambition.FilePreviewController;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.2;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
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 = "0940"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions FilePreviewController/FPAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ let DismissDuration = 0.3
var AssociatedObjectHandle: UInt8 = 0

public extension UIViewController {
public func presentFilePreviewController(viewControllerToPresent controller: UIViewController, fromView: UIView?) {
func presentFilePreviewController(viewControllerToPresent controller: UIViewController, fromView: UIView?) {
let transitionDelegate = TransitionDelegate(fromView: fromView)
controller.transitioningDelegate = transitionDelegate
controller.fp_transitionDelegate = transitionDelegate
present(controller, animated: true, completion: nil)
}

public func dismissFilePreviewController() {
func dismissFilePreviewController() {
if let viewController = presentedViewController {
viewController.transitioningDelegate = viewController.fp_transitionDelegate
}
Expand Down
8 changes: 4 additions & 4 deletions FilePreviewController/FilePreviewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ public struct FilePreviewControllerConstants {
}

public extension String {
public func MD5() -> String {
func MD5() -> String {
return (self as NSString).md5() as String
}

public func stringByAppendingPathComponent(_ str: String) -> String {
func stringByAppendingPathComponent(_ str: String) -> String {
return (self as NSString).appendingPathComponent(str)
}

public func stringByAppendingPathExtension(_ str: String) -> String? {
func stringByAppendingPathExtension(_ str: String) -> String? {
return (self as NSString).appendingPathExtension(str)
}
}
Expand Down Expand Up @@ -503,7 +503,7 @@ extension FilePreviewController {
toolbar.translatesAutoresizingMaskIntoConstraints = false
view.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-0-[toolbar]-0-|", options: [], metrics: nil , views: ["toolbar":toolbar]))
toolbar.addConstraint(NSLayoutConstraint(item: toolbar, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: customToolbarHeight))
toolbarBottomConstraint = NSLayoutConstraint(item: view, attribute: .bottom, relatedBy: .equal, toItem: toolbar, attribute: .top, multiplier: 1.0, constant: toolbarBackgroundHeight)
toolbarBottomConstraint = NSLayoutConstraint(item: view!, attribute: .bottom, relatedBy: .equal, toItem: toolbar, attribute: .top, multiplier: 1.0, constant: toolbarBackgroundHeight)
view.addConstraint(toolbarBottomConstraint!)
}

Expand Down
2 changes: 1 addition & 1 deletion FilePreviewController/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.6.0</string>
<string>0.10.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 49fdd16

Please sign in to comment.