Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuhiro4949 committed May 3, 2019
1 parent 10157ee commit 3d6361a
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
2 changes: 1 addition & 1 deletion EditDistance.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ Pod::Spec.new do |s|

s.ios.deployment_target = '8.0'

s.source_files = "EditDistance/*"
s.source_files = "EditDistance/*.swift"
end
17 changes: 12 additions & 5 deletions EditDistance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Kazuhiro Hayashi";
TargetAttributes = {
6E0302791E6475D700E24C49 = {
Expand All @@ -312,6 +312,7 @@
6EBF3E321E58543F0025443A = {
CreatedOnToolsVersion = 8.2.1;
DevelopmentTeam = R33Y42SDDR;
LastSwiftMigration = 1020;
ProvisioningStyle = Automatic;
};
};
Expand Down Expand Up @@ -465,7 +466,7 @@
PRODUCT_NAME = EditDistance;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand All @@ -487,7 +488,7 @@
PRODUCT_NAME = EditDistance;
SDKROOT = appletvos;
SKIP_INSTALL = YES;
SWIFT_VERSION = 3.0;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
};
Expand Down Expand Up @@ -527,6 +528,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -536,13 +538,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -586,6 +590,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -595,13 +600,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -688,7 +695,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = kazuhiro.hayashi.EditDistanceTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -701,7 +708,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = kazuhiro.hayashi.EditDistanceTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
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 = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
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 = "0900"
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
Expand Down Expand Up @@ -56,7 +55,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
6 changes: 3 additions & 3 deletions EditDistance/DynamicProgramming.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public struct DynamicProgramming<T: Equatable>: EditDistanceAlgorithm {

public func calculate(from: [[T]], to: [[T]]) -> EditDistanceContainer<T> {
let flattendTo = to.enumerated().flatMap { (firstOffset, collection) in
return collection.enumerated().flatMap { (secondOffset, element) in
return collection.enumerated().compactMap { (secondOffset, element) in
return EditDistanceAlgorithmContainer(indexPath: IndexPath(row: secondOffset, section: firstOffset), element: element)
}
}

let flattendFrom = from.enumerated().flatMap { (firstOffset, collection) in
return collection.enumerated().flatMap { (secondOffset, element) in
return collection.enumerated().compactMap { (secondOffset, element) in
return EditDistanceAlgorithmContainer(indexPath: IndexPath(row: secondOffset, section: firstOffset), element: element)
}
}
Expand Down Expand Up @@ -73,7 +73,7 @@ public struct DynamicProgramming<T: Equatable>: EditDistanceAlgorithm {
}
}

let commonElements = editScripts.flatMap { $0.element }
let commonElements = editScripts.compactMap { $0.element }

do {
flattendFrom.forEach { (container) in
Expand Down
2 changes: 1 addition & 1 deletion EditDistance/EditDistance.swift
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public struct EditDistanceProxy<T: Equatable> {
public extension Array where Element: Equatable {

/// namespace for EditDistance. create EditDistanceProxy object with self.
public var diff: EditDistanceProxy<Element> {
var diff: EditDistanceProxy<Element> {
return EditDistanceProxy(self)
}
}
2 changes: 1 addition & 1 deletion EditDistance/EditScriptConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import UIKit
public protocol EditScriptConverter: class {}

public extension EditScriptConverter {
public var diff: EditScriptConverterProxy<Self> {
var diff: EditScriptConverterProxy<Self> {
return EditScriptConverterProxy(self)
}
}
Expand Down
4 changes: 2 additions & 2 deletions EditDistance/EditScriptConverterProxy+UICollectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public extension EditScriptConverterProxy where Converter: UICollectionView {
/// - container: EditDistanceContainer object generated by EditDistance
/// - completion: completion handler
@available(tvOS, unavailable)
public func performBatchUpdates<T>(with container: EditDistanceContainer<T>, completion: ((Bool) -> Void)?) {
func performBatchUpdates<T>(with container: EditDistanceContainer<T>, completion: ((Bool) -> Void)?) {
_performBatchUpdates(with: container, completion: completion)
}

Expand All @@ -47,7 +47,7 @@ public extension EditScriptConverterProxy where Converter: UICollectionView {
/// - Parameters:
/// - container: EditDistanceContainer object generated by EditDistance
/// - completion: completion handler
public func performBatchUpdatesStartingWithReload<T>(with container: EditDistanceContainer<T>, completion: ((Bool) -> Void)?) {
func performBatchUpdatesStartingWithReload<T>(with container: EditDistanceContainer<T>, completion: ((Bool) -> Void)?) {
let needsReloadData = _converter.visibleCells.isEmpty
if needsReloadData {
UIView.animate(withDuration: 0, animations: { [weak self] in
Expand Down
2 changes: 1 addition & 1 deletion EditDistance/EditScriptConverterProxy+UITableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public extension EditScriptConverterProxy where Converter: UITableView {
///
/// EditScript array in the object is converted to insertRows(at:,with:) and deleteRows(at:,with:) of UITableView
/// - Parameter container: EditDistanceContainer object generated by EditDistance
public func reload<T>(with container: EditDistanceContainer<T>) {
func reload<T>(with container: EditDistanceContainer<T>) {
_converter.beginUpdates()
container.editScripts.forEach({ (script) in
switch script {
Expand Down
14 changes: 10 additions & 4 deletions iOS Example/iOS Example.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0820;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1020;
ORGANIZATIONNAME = "Kazuhiro Hayashi";
TargetAttributes = {
6E03023A1E62A1A300E24C49 = {
Expand All @@ -233,7 +233,7 @@
};
buildConfigurationList = 6E0302361E62A1A300E24C49 /* Build configuration list for PBXProject "iOS Example" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Expand Down Expand Up @@ -346,6 +346,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -355,13 +356,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -402,6 +405,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand All @@ -411,13 +415,15 @@
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_DOCUMENTATION_COMMENTS = YES;
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;
Expand Down Expand Up @@ -456,7 +462,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "kazuhiro.hayashi.iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
Expand All @@ -469,7 +475,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "kazuhiro.hayashi.iOS-Example";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 5.0;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion iOS Example/iOS Example/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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 {
// Override point for customization after application launch.
return true
}
Expand Down

0 comments on commit 3d6361a

Please sign in to comment.