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

Commit

Permalink
update: support Xcode 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
hongxinhope committed Sep 26, 2018
1 parent 4c24b86 commit c983f92
Show file tree
Hide file tree
Showing 17 changed files with 41 additions and 54 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github "teambition/RefreshView" "1.3.3"
github "teambition/RefreshView" "1.4.0"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# STTableBoard
task board for Teambition
Task board for Teambition.

## License
Creative Commons
8 changes: 4 additions & 4 deletions STTableBoard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = "";
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
Expand Down Expand Up @@ -421,7 +421,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = "";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -452,7 +452,7 @@
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -478,7 +478,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
6 changes: 3 additions & 3 deletions STTableBoard/Classes/STIndexPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import Foundation

open class STIndexPath {
open let section: Int
open let row: Int
open let board: Int
public let section: Int
public let row: Int
public let board: Int

public init(forRow row: Int, section: Int = 0, inBoard board: Int) {
self.section = section
Expand Down
8 changes: 2 additions & 6 deletions STTableBoard/Extensions/STTableBoard+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -637,26 +637,22 @@ extension STTableBoard {
// MARK: - Position helper method
extension STTableBoard {
func boardAtPointInBoardArea(_ pointInContainerView: CGPoint) -> STBoardView? {
var returnedBoard: STBoardView? = nil

var returnedBoard: STBoardView?
boards.forEach { (board) -> Void in
if pointInContainerView.x > board.minX && pointInContainerView.x < board.maxX {
returnedBoard = board
}
}

return returnedBoard
}

func boardAtPoint(_ pointInContainerView: CGPoint) -> STBoardView? {
var returnedBoard: STBoardView? = nil

var returnedBoard: STBoardView?
boards.forEach { (board) -> Void in
if board.frame.contains(pointInContainerView) {
returnedBoard = board
}
}

return returnedBoard
}

Expand Down
18 changes: 9 additions & 9 deletions STTableBoard/Extensions/STTableBoard+Public.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public extension STTableBoard {
}

public extension STTableBoard {
public func insertRows(at indexPaths: [STIndexPath], with animation: UITableViewRowAnimation) {
public func insertRows(at indexPaths: [STIndexPath], with animation: UITableView.RowAnimation) {
var indexPathsDic = [String: [STIndexPath]]()
indexPaths.forEach { (indexPath) -> Void in
if var indexPathsInBoard = indexPathsDic[String(indexPath.board)] {
Expand All @@ -156,7 +156,7 @@ public extension STTableBoard {
}
}

public func insertSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableViewRowAnimation) {
public func insertSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableView.RowAnimation) {
let board = boards[boardIndex]
guard let tableView = board.tableView else {
return
Expand All @@ -175,7 +175,7 @@ public extension STTableBoard {
}
}

public func deleteRows(at indexPaths: [STIndexPath], with animation: UITableViewRowAnimation) {
public func deleteRows(at indexPaths: [STIndexPath], with animation: UITableView.RowAnimation) {
var indexPathsDic = [String: [STIndexPath]]()
indexPaths.forEach { (indexPath) -> Void in
if var indexPathsInBoard = indexPathsDic[String(indexPath.board)] {
Expand All @@ -202,7 +202,7 @@ public extension STTableBoard {
}
}

public func deleteSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableViewRowAnimation) {
public func deleteSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableView.RowAnimation) {
let board = boards[boardIndex]
guard let tableView = board.tableView else {
return
Expand All @@ -213,7 +213,7 @@ public extension STTableBoard {
autoAdjustTableBoardHeight(board, animated: true)
}

public func moveRowWithinBoard(at indexPath: STIndexPath, to newIndexPath: STIndexPath, reloadAfterMoving: Bool = false, with animation: UITableViewRowAnimation = .none) {
public func moveRowWithinBoard(at indexPath: STIndexPath, to newIndexPath: STIndexPath, reloadAfterMoving: Bool = false, with animation: UITableView.RowAnimation = .none) {
guard indexPath.board == newIndexPath.board else {
return
}
Expand All @@ -233,7 +233,7 @@ public extension STTableBoard {
self.autoAdjustTableBoardHeight(board, animated: true)
}

public func insertRow(at indexPath: STIndexPath, withRowAnimation animation: UITableViewRowAnimation, atScrollPosition scrollPosition: UITableViewScrollPosition) {
public func insertRow(at indexPath: STIndexPath, withRowAnimation animation: UITableView.RowAnimation, atScrollPosition scrollPosition: UITableView.ScrollPosition) {
let board = boards[indexPath.board]
guard let tableView = board.tableView else {
return
Expand All @@ -253,7 +253,7 @@ public extension STTableBoard {
}
}

public func reloadRows(at indexPaths: [STIndexPath], with animation: UITableViewRowAnimation) {
public func reloadRows(at indexPaths: [STIndexPath], with animation: UITableView.RowAnimation) {
var indexPathsDic = [String: [STIndexPath]]()
indexPaths.forEach { (indexPath) -> Void in
if var indexPathsInBoard = indexPathsDic[String(indexPath.board)] {
Expand All @@ -280,7 +280,7 @@ public extension STTableBoard {
}
}

public func reloadSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableViewRowAnimation) {
public func reloadSections(_ sections: IndexSet, atBoard boardIndex: Int, with animation: UITableView.RowAnimation) {
let board = boards[boardIndex]
guard let tableView = board.tableView else {
return
Expand All @@ -299,7 +299,7 @@ public extension STTableBoard {
return tableView.cellForRow(at: indexPath.toIndexPath()) as? STBoardCell
}

public func scrollToRow(at indexPath: STIndexPath, at scrollPosition: UITableViewScrollPosition, animated: Bool) {
public func scrollToRow(at indexPath: STIndexPath, at scrollPosition: UITableView.ScrollPosition, animated: Bool) {
let board = boards[indexPath.board]
guard let tableView = board.tableView else {
return
Expand Down
2 changes: 1 addition & 1 deletion STTableBoard/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.5.1</string>
<string>0.6.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion STTableBoard/Vender/STPageControl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class STPageControl: UIPageControl {
}

fileprivate func imageViewForSubView(_ view: UIView) -> UIImageView? {
var dot: UIImageView? = nil
var dot: UIImageView?
for subview in view.subviews {
if let imageView = subview as? UIImageView {
dot = imageView
Expand Down
6 changes: 3 additions & 3 deletions STTableBoard/ViewControllers/STTableBoard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,15 @@ open class STTableBoard: UIViewController {
}

public func addNotification() {
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: .UIKeyboardWillShow, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: .UIKeyboardWillHide, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
}

// MARK: - response method
extension STTableBoard {
@objc func keyboardWillShow(_ notification: Notification) {
if let userInfo = notification.userInfo, let keyboardFrameValue = userInfo[UIKeyboardFrameEndUserInfoKey] as? NSValue {
if let userInfo = notification.userInfo, let keyboardFrameValue = userInfo[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue {
let keyboardFrame = keyboardFrameValue.cgRectValue
let keyboardHeight = keyboardFrame.height
let screenHeight = UIScreen.main.bounds.height
Expand Down
2 changes: 1 addition & 1 deletion STTableBoard/Views/STBoardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ open class STBoardCell: UITableViewCell {
self.selectionStyle = .none
}

override public init(style: UITableViewCellStyle, reuseIdentifier: String?) {
public override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
self.selectionStyle = .none
}
Expand Down
2 changes: 1 addition & 1 deletion STTableBoard/Views/STBoardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class STBoardView: UIView {
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|[dropMaskView]|", options: [], metrics: nil, views: ["dropMaskView": dropMaskView]))
addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|[dropMaskView]|", options: [], metrics: nil, views: ["dropMaskView": dropMaskView]))

bringSubview(toFront: dropMaskView)
bringSubviewToFront(dropMaskView)
deactivateDropMask()

// refresh footer
Expand Down
2 changes: 1 addition & 1 deletion STTableBoard/Views/STShadowTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
class STShadowTableView: UITableView {
var index: Int!

override init(frame: CGRect, style: UITableViewStyle) {
override init(frame: CGRect, style: UITableView.Style) {
super.init(frame: frame, style: style)
self.separatorStyle = .none
}
Expand Down
10 changes: 5 additions & 5 deletions STTableBoardDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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 @@ -326,7 +326,7 @@
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = "";
};
name = Debug;
};
Expand Down Expand Up @@ -374,7 +374,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = "";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -400,7 +400,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
Expand All @@ -426,7 +426,7 @@
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
Expand Down
17 changes: 4 additions & 13 deletions STTableBoardDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,25 @@ 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
}

func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.

}

func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.

}

func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.

}

func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

}
2 changes: 1 addition & 1 deletion STTableBoardDemo/BoardCardCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BoardCardCell: STBoardCell {
}
}

override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupProperty()
}
Expand Down
2 changes: 1 addition & 1 deletion STTableBoardDemo/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.5.1</string>
<string>0.6.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
4 changes: 2 additions & 2 deletions STTableBoardDemo/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ extension ViewController {
tableBoard.dataSource = self
tableBoard.showAddBoardButton = true
// tableBoard.preferredBoardWidth = 280
self.addChildViewController(tableBoard)
self.addChild(tableBoard)
view.addSubview(tableBoard.view)
tableBoard.didMove(toParentViewController: self)
tableBoard.didMove(toParent: self)
}

fileprivate func setupContianerView() {
Expand Down

0 comments on commit c983f92

Please sign in to comment.