Skip to content

Commit

Permalink
support Xcode 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Sep 25, 2018
1 parent 3bc1e9b commit da1b36c
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1
4.2
5 changes: 1 addition & 4 deletions Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
return true
}

Expand All @@ -37,5 +35,4 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationWillTerminate(_ application: UIApplication) {

}

}
12 changes: 6 additions & 6 deletions Example/EmptyDataDemoCollectionViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class EmptyDataDemoCollectionViewController: UICollectionViewController {
super.viewDidLoad()

navigationItem.title = "CollectionView"
collectionView?.backgroundColor = UIColor.white
collectionView?.backgroundColor = .white

collectionView?.emptyDataSetDataSource = self
collectionView?.emptyDataSetDelegate = self
Expand Down Expand Up @@ -87,7 +87,7 @@ extension EmptyDataDemoCollectionViewController: TBEmptyDataSetDataSource, TBEmp

func titleForEmptyDataSet(in scrollView: UIScrollView) -> NSAttributedString? {
let title = EmptyData.titles[indexPath.row]
var attributes: [NSAttributedStringKey: Any]?
var attributes: [NSAttributedString.Key: Any]?
if indexPath.row == 1 {
attributes = [.font: UIFont.systemFont(ofSize: 22),
.foregroundColor: UIColor.gray]
Expand All @@ -100,7 +100,7 @@ extension EmptyDataDemoCollectionViewController: TBEmptyDataSetDataSource, TBEmp

func descriptionForEmptyDataSet(in scrollView: UIScrollView) -> NSAttributedString? {
let description = EmptyData.descriptions[indexPath.row]
var attributes: [NSAttributedStringKey: Any]?
var attributes: [NSAttributedString.Key: Any]?
if indexPath.row == 1 {
attributes = [.font: UIFont.systemFont(ofSize: 17),
.foregroundColor: UIColor(red: 3 / 255, green: 169 / 255, blue: 244 / 255, alpha: 1)]
Expand Down Expand Up @@ -223,7 +223,7 @@ class ExampleCustomView: UIView {
fileprivate lazy var contentLabel: UILabel = {
let contentLabel = UILabel()
contentLabel.numberOfLines = 0
contentLabel.textColor = UIColor.white
contentLabel.textColor = .white
contentLabel.translatesAutoresizingMaskIntoConstraints = false
return contentLabel
}()
Expand All @@ -239,10 +239,10 @@ class ExampleCustomView: UIView {
}

fileprivate func commonInit() {
backgroundColor = UIColor.lightGray
backgroundColor = .lightGray
layer.cornerRadius = 6

let activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: .whiteLarge)
let activityIndicatorView = UIActivityIndicatorView(style: .whiteLarge)
activityIndicatorView.translatesAutoresizingMaskIntoConstraints = false
activityIndicatorView.startAnimating()
contentLabel.text = "Loading... Please wait a moment...\n\n(This is a custom empty data view, which is using pure AutoLayout)"
Expand Down
6 changes: 3 additions & 3 deletions Example/EmptyDataDemoTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ extension EmptyDataDemoTableViewController: TBEmptyDataSetDataSource, TBEmptyDat

func titleForEmptyDataSet(in scrollView: UIScrollView) -> NSAttributedString? {
let title = EmptyData.titles[indexPath.row]
var attributes: [NSAttributedStringKey: Any]?
var attributes: [NSAttributedString.Key: Any]?
if indexPath.row == 1 {
attributes = [.font: UIFont.systemFont(ofSize: 22),
.foregroundColor: UIColor.gray]
Expand All @@ -104,7 +104,7 @@ extension EmptyDataDemoTableViewController: TBEmptyDataSetDataSource, TBEmptyDat

func descriptionForEmptyDataSet(in scrollView: UIScrollView) -> NSAttributedString? {
let description = EmptyData.descriptions[indexPath.row]
var attributes: [NSAttributedStringKey: Any]?
var attributes: [NSAttributedString.Key: Any]?
if indexPath.row == 1 {
attributes = [.font: UIFont.systemFont(ofSize: 17),
.foregroundColor: UIColor(red: 3 / 255, green: 169 / 255, blue: 244 / 255, alpha: 1)]
Expand All @@ -128,7 +128,7 @@ extension EmptyDataDemoTableViewController: TBEmptyDataSetDataSource, TBEmptyDat

func customViewForEmptyDataSet(in scrollView: UIScrollView) -> UIView? {
if isLoading {
let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
let activityIndicator = UIActivityIndicatorView(style: .gray)
activityIndicator.startAnimating()
return activityIndicator
}
Expand Down
4 changes: 2 additions & 2 deletions Example/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.7</string>
<string>2.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>18</string>
<string>19</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion TBEmptyDataSet.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "TBEmptyDataSet"
s.version = "2.7"
s.version = "2.8"
s.summary = "An extension of UITableView/UICollectionView's super class, it will display a placeholder when the data is empty."

s.homepage = "https://github.com/teambition/TBEmptyDataSet"
Expand Down
4 changes: 2 additions & 2 deletions TBEmptyDataSet.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -309,7 +309,7 @@
PRODUCT_BUNDLE_IDENTIFIER = Teambition.TBEmptyDataSet;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
12 changes: 6 additions & 6 deletions TBEmptyDataSet/EmptyDataView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ internal class EmptyDataView: UIView {
internal lazy var contentView: UIView = {
let contentView = UIView()
contentView.translatesAutoresizingMaskIntoConstraints = false
contentView.backgroundColor = UIColor.clear
contentView.backgroundColor = .clear
contentView.alpha = 0
return contentView
}()

internal lazy var imageView: UIImageView = { [unowned self] in
let imageView = UIImageView()
imageView.translatesAutoresizingMaskIntoConstraints = false
imageView.backgroundColor = UIColor.clear
imageView.backgroundColor = .clear
imageView.contentMode = .scaleAspectFill
self.contentView.addSubview(imageView)
return imageView
Expand All @@ -38,8 +38,8 @@ internal class EmptyDataView: UIView {
internal lazy var titleLabel: UILabel = { [unowned self] in
let titleLabel = UILabel()
titleLabel.translatesAutoresizingMaskIntoConstraints = false
titleLabel.backgroundColor = UIColor.clear
titleLabel.font = UIFont.systemFont(ofSize: 27)
titleLabel.backgroundColor = .clear
titleLabel.font = .systemFont(ofSize: 27)
titleLabel.textColor = UIColor(white: 0.6, alpha: 1)
titleLabel.textAlignment = .center
titleLabel.lineBreakMode = .byWordWrapping
Expand All @@ -51,8 +51,8 @@ internal class EmptyDataView: UIView {
internal lazy var descriptionLabel: UILabel = { [unowned self] in
let descriptionLabel = UILabel()
descriptionLabel.translatesAutoresizingMaskIntoConstraints = false
descriptionLabel.backgroundColor = UIColor.clear
descriptionLabel.font = UIFont.systemFont(ofSize: 17)
descriptionLabel.backgroundColor = .clear
descriptionLabel.font = .systemFont(ofSize: 17)
descriptionLabel.textColor = UIColor(white: 0.6, alpha: 1)
descriptionLabel.textAlignment = .center
descriptionLabel.lineBreakMode = .byWordWrapping
Expand Down
2 changes: 1 addition & 1 deletion TBEmptyDataSet/Supporting Files/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>2.7</string>
<string>2.8</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions TBEmptyDataSetExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi";
shellScript = "if which swiftlint >/dev/null; then\n swiftlint\nelse\n echo \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down Expand Up @@ -309,7 +309,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = Teambition.TBEmptyDataSetExample;
PRODUCT_NAME = TBEmptyDataSetExample;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -322,7 +322,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = Teambition.TBEmptyDataSetExample;
PRODUCT_NAME = TBEmptyDataSetExample;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down

0 comments on commit da1b36c

Please sign in to comment.