Skip to content

Commit

Permalink
Migrated to Swift 4.2 (using autofix)
Browse files Browse the repository at this point in the history
- also Migrated Example Project to Swift 4.2 (using autofix)
- fixed XCode 10 build error
  • Loading branch information
Anarchoschnitzel committed Sep 19, 2018
1 parent 2453d0f commit 3da3286
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
6 changes: 3 additions & 3 deletions Example/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import UIKit
import SimpleImageViewer

class ViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
fileprivate let contentModes: [UIViewContentMode] = [.scaleToFill,
fileprivate let contentModes: [UIView.ContentMode] = [.scaleToFill,
.scaleAspectFit,
.scaleAspectFill,
.center,
Expand Down Expand Up @@ -49,7 +49,7 @@ class ViewController: UICollectionViewController, UICollectionViewDelegateFlowLa
}

override func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionElementKindSectionHeader, withReuseIdentifier: "HeaderView", for: indexPath) as! HeaderView
let headerView = collectionView.dequeueReusableSupplementaryView(ofKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: "HeaderView", for: indexPath) as! HeaderView
headerView.titleLabel.text = contentModes[indexPath.section].name
return headerView
}
Expand All @@ -60,7 +60,7 @@ class ViewController: UICollectionViewController, UICollectionViewDelegateFlowLa
}
}

private extension UIViewContentMode {
private extension UIView.ContentMode {
var name: String {
switch self {
case .scaleToFill:
Expand Down
2 changes: 1 addition & 1 deletion ImageViewer/AnimatableImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import UIKit
final class AnimatableImageView: UIView {
fileprivate let imageView = UIImageView()

override var contentMode: UIViewContentMode {
override var contentMode: UIView.ContentMode {
didSet { update() }
}

Expand Down
2 changes: 1 addition & 1 deletion ImageViewer/ImageViewerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extension ImageViewerController: UIGestureRecognizerDelegate {

private extension ImageViewerController {
func setupScrollView() {
scrollView.decelerationRate = UIScrollViewDecelerationRateFast
scrollView.decelerationRate = UIScrollView.DecelerationRate.fast
scrollView.alwaysBounceVertical = true
scrollView.alwaysBounceHorizontal = true
}
Expand Down
18 changes: 7 additions & 11 deletions SimpleImageViewer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
A02EE5B91EF16E54000EAB41 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A02EE5B81EF16E54000EAB41 /* Info.plist */; };
A02EE5CF1EF172C8000EAB41 /* Utilities.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02EE5CD1EF172C3000EAB41 /* Utilities.swift */; };
A02EE5D71EF1897D000EAB41 /* UtilitiesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A02EE5D61EF1897D000EAB41 /* UtilitiesTests.swift */; };
A02EE5D91EF1897D000EAB41 /* SimpleImageViewer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A0BF70A71EDC5B1400109F6E /* SimpleImageViewer.framework */; };
Expand Down Expand Up @@ -298,7 +297,7 @@
};
A0BF70A61EDC5B1400109F6E = {
CreatedOnToolsVersion = 8.3.2;
LastSwiftMigration = 0900;
LastSwiftMigration = 1000;
ProvisioningStyle = Manual;
};
};
Expand Down Expand Up @@ -335,7 +334,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A02EE5B91EF16E54000EAB41 /* Info.plist in Resources */,
A0BF70B91EDC759A00109F6E /* Main.storyboard in Resources */,
A07E76DE1ECC94A400B77D46 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -419,7 +417,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.afrogleap.SimpleImageViewerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -431,7 +429,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.afrogleap.SimpleImageViewerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down Expand Up @@ -557,7 +555,7 @@
PROVISIONING_PROFILE = "d5b8f7cb-0120-427a-9ff1-14d28ee0046f";
PROVISIONING_PROFILE_SPECIFIER = "aFrogleap Wildcard Development";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -574,7 +572,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand All @@ -596,8 +594,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand All @@ -621,8 +618,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
Expand Down

0 comments on commit 3da3286

Please sign in to comment.