Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run UI updates on main thread #96

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
43 changes: 31 additions & 12 deletions Dwifft.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@
attributes = {
LastSwiftMigration = 0700;
LastSwiftUpdateCheck = 0700;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = jflinter;
TargetAttributes = {
041EBB911B89679200E113B3 = {
@@ -374,6 +374,8 @@
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 0900;
};
38E5B5D21F7BDB5400F33285 = {
};
94783CAC1EFBA21900841579 = {
CreatedOnToolsVersion = 9.0;
LastSwiftMigration = 0910;
@@ -382,10 +384,11 @@
};
buildConfigurationList = 041EBB8C1B89679200E113B3 /* Build configuration list for PBXProject "Dwifft" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 041EBB881B89679200E113B3;
productRefGroup = 041EBB931B89679200E113B3 /* Products */;
@@ -528,6 +531,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;
@@ -536,14 +540,17 @@
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_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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -570,7 +577,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -586,6 +593,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;
@@ -594,14 +602,17 @@
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_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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -621,7 +632,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_VERSION = 3.0.1;
@@ -635,7 +646,9 @@
041EBBA91B89679200E113B3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -653,7 +666,9 @@
041EBBAA1B89679200E113B3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -672,6 +687,7 @@
041EBBAC1B89679200E113B3 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
@@ -691,6 +707,7 @@
041EBBAD1B89679200E113B3 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/iOS",
@@ -713,7 +730,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "Apple Development";
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
@@ -732,7 +749,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.Dwifft-macOS";
PRODUCT_NAME = Dwifft;
SDKROOT = macosx10.13;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -749,7 +766,7 @@
CLANG_ENABLE_MODULES = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_IDENTITY = "Apple Development";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -767,7 +784,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.Dwifft-macOS";
PRODUCT_NAME = Dwifft;
SDKROOT = macosx10.13;
SDKROOT = macosx;
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
@@ -777,6 +794,7 @@
38E5B5E01F7BDB5400F33285 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
@@ -789,7 +807,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.13;
SDKROOT = macosx;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
@@ -798,6 +816,7 @@
38E5B5E11F7BDB5400F33285 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Apple Development";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Carthage/Build/Mac",
@@ -806,7 +825,7 @@
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx10.13;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
@@ -843,7 +862,7 @@
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Debug;
};
@@ -876,7 +895,7 @@
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = 3;
TVOS_DEPLOYMENT_TARGET = 9.0;
TVOS_DEPLOYMENT_TARGET = 12.0;
};
name = Release;
};
17 changes: 1 addition & 16 deletions Dwifft.xcodeproj/xcshareddata/xcschemes/Dwifft-macOS.xcscheme
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 = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,7 +26,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
@@ -40,23 +39,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "382DEF411F487395007A8FD2"
BuildableName = "Dwifft.framework"
BlueprintName = "Dwifft-macOS"
ReferencedContainer = "container:Dwifft.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -72,8 +59,6 @@
ReferencedContainer = "container:Dwifft.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
8 changes: 1 addition & 7 deletions Dwifft.xcodeproj/xcshareddata/xcschemes/Dwifft-tvOS.xcscheme
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 = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -26,18 +26,14 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -53,8 +49,6 @@
ReferencedContainer = "container:Dwifft.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
17 changes: 1 addition & 16 deletions Dwifft.xcodeproj/xcshareddata/xcschemes/Dwifft.xcscheme
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 = "1200"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
@@ -55,23 +54,11 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "041EBB911B89679200E113B3"
BuildableName = "Dwifft.framework"
BlueprintName = "Dwifft"
ReferencedContainer = "container:Dwifft.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
@@ -87,8 +74,6 @@
ReferencedContainer = "container:Dwifft.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
4 changes: 1 addition & 3 deletions Dwifft/AbstractDiffCalculator.swift
Original file line number Diff line number Diff line change
@@ -74,9 +74,7 @@ public class AbstractDiffCalculator<Section: Equatable, Value: Equatable> {
let oldSectionedValues = sectionedValues
let newSectionedValues = newValue
let diff = Dwifft.diff(lhs: oldSectionedValues, rhs: newSectionedValues)
if (diff.count > 0) {
self.processChanges(newState: newSectionedValues, diff: diff)
}
self.processChanges(newState: newSectionedValues, diff: diff)
}
}

34 changes: 26 additions & 8 deletions Dwifft/Dwifft+AppKit.swift
Original file line number Diff line number Diff line change
@@ -50,17 +50,32 @@ public final class TableViewDiffCalculator<Value: Equatable>: AbstractDiffCalcul
}

override internal func processChanges(newState: SectionedValues<Int, Value>, diff: [SectionedDiffStep<Int, Value>]) {
guard let tableView = self.tableView else { return }
tableView.beginUpdates()
self._sectionedValues = newState
for result in diff {
switch result {
case let .delete(_, row, _): tableView.removeRows(at: [row], withAnimation: self.deletionAnimation)
case let .insert(_, row, _): tableView.insertRows(at: [row], withAnimation: self.insertionAnimation)
default: fatalError("NSTableViews do not have sections")
guard let tableView = self.tableView else { return }
var updateAction = {
tableView.beginUpdates()
for result in diff {
switch result {
case let .delete(_, row, _): tableView.removeRows(at: [row], withAnimation: self.deletionAnimation)
case let .insert(_, row, _): tableView.insertRows(at: [row], withAnimation: self.insertionAnimation)
default: fatalError("NSTableViews do not have sections")
}
}
tableView.endUpdates()
}
if diff.count == 0 {
//There might be rows that need to be reloaded but we don't want to display a .insert animation for them.
//Update the internal _sectionedValues so that when we access the rows property, we get the updated rows
updateAction = { tableView.reloadData() }
}
if Thread.current.isMainThread {
updateAction()
} else {
DispatchQueue.main.sync {
updateAction()
}
}
tableView.endUpdates()

}

}
@@ -69,6 +84,7 @@ public final class TableViewDiffCalculator<Value: Equatable>: AbstractDiffCalcul
/// use a `SingleSectionCollectionViewDiffCalculator`. Note that this approach is not highly recommended, and you should
/// do so only if it *really* doesn't make sense to just power your whole view with a `CollectionViewDiffCalculator`.
/// You'll be less likely to mess up the index math :P
@available(OSX 10.11, *)
public final class SingleSectionCollectionViewDiffCalculator<Value: Equatable> {

/// The collection view to be managed
@@ -109,6 +125,7 @@ public final class SingleSectionCollectionViewDiffCalculator<Value: Equatable> {
/// This class manages a `NSCollectionView`'s items and sections. It will make the necessary
/// calls to the collection view to ensure that its UI is kept in sync with the contents
/// of the `sectionedValues` property.
@available(OSX 10.11, *)
public final class CollectionViewDiffCalculator<Section: Equatable, Value: Equatable> : AbstractDiffCalculator<Section, Value> {

/// The collection view to be managed.
@@ -154,6 +171,7 @@ public final class CollectionViewDiffCalculator<Section: Equatable, Value: Equat
/// of `Int`s, define a `StringOrInt` enum that conforms to `Equatable`, and fill the `SectionedValues`
/// that you use to drive your DiffCalculator up with those. Alternatively, if you are lazy, and your
/// models all conform to `Hashable`, you can use a SimpleTableViewDiffCalculator instead.
@available(OSX 10.11, *)
typealias SimpleCollectionViewDiffCalculator = CollectionViewDiffCalculator<AnyHashable, AnyHashable>

#endif
6 changes: 3 additions & 3 deletions Dwifft/Dwifft+UIKit.swift
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ public final class TableViewDiffCalculator<Section: Equatable, Value: Equatable>

/// You can change insertion/deletion animations like this! Fade works well.
/// So does Top/Bottom. Left/Right/Middle are a little weird, but hey, do your thing.
public var insertionAnimation = UITableViewRowAnimation.automatic, deletionAnimation = UITableViewRowAnimation.automatic
public var insertionAnimation = UITableView.RowAnimation.automatic, deletionAnimation = UITableView.RowAnimation.automatic

override internal func processChanges(newState: SectionedValues<Section, Value>, diff: [SectionedDiffStep<Section, Value>]) {
guard let tableView = self.tableView else { return }
@@ -106,13 +106,13 @@ public final class SingleSectionTableViewDiffCalculator<Value: Equatable> {

/// You can change insertion/deletion animations like this! Fade works well.
/// So does Top/Bottom. Left/Right/Middle are a little weird, but hey, do your thing.
public var insertionAnimation = UITableViewRowAnimation.automatic {
public var insertionAnimation = UITableView.RowAnimation.automatic {
didSet {
self.internalDiffCalculator.insertionAnimation = self.insertionAnimation
}
}

public var deletionAnimation = UITableViewRowAnimation.automatic {
public var deletionAnimation = UITableView.RowAnimation.automatic {
didSet {
self.internalDiffCalculator.deletionAnimation = self.deletionAnimation
}
12 changes: 6 additions & 6 deletions Dwifft/Dwifft.swift
Original file line number Diff line number Diff line change
@@ -36,10 +36,10 @@ public enum DiffStep<Value> : CustomDebugStringConvertible {
/// The value to be inserted or deleted.
public var value: Value {
switch(self) {
case let .insert(j):
return j.1
case let .delete(j):
return j.1
case let .insert(_, k):
return k
case let .delete(_, k):
return k
}
}
}
@@ -309,13 +309,13 @@ public extension Array where Element: Equatable {

/// Deprecated in favor of `Dwifft.diff`.
@available(*, deprecated)
public func diff(_ other: [Element]) -> [DiffStep<Element>] {
func diff(_ other: [Element]) -> [DiffStep<Element>] {
return Dwifft.diff(self, other)
}

/// Deprecated in favor of `Dwifft.apply`.
@available(*, deprecated)
public func apply(_ diff: [DiffStep<Element>]) -> [Element] {
func apply(_ diff: [DiffStep<Element>]) -> [Element] {
return Dwifft.apply(diff: diff, toArray: self)
}

26 changes: 0 additions & 26 deletions Dwifft/Info.plist

This file was deleted.

2 changes: 1 addition & 1 deletion Dwifft/SectionedValues.swift
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ public extension SectionedValues where Section: Hashable {
/// should be sorted before the second. Used to sort the sections in the returned `SectionedValues`.
/// - sortValues: A function that compares two values, and returns true if the first
/// should be sorted before the second. Used to sort the values in each section of the returned `SectionedValues`.
public init(
init(
values: [Value],
valueToSection: ((Value) -> Section),
sortSections: ((Section, Section) -> Bool),
20 changes: 14 additions & 6 deletions DwifftExample/DwifftExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -296,7 +296,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0910;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = jflinter;
TargetAttributes = {
045501F21B898C3200F5614D = {
@@ -311,7 +311,7 @@
};
buildConfigurationList = 045501EE1B898C3200F5614D /* Build configuration list for PBXProject "DwifftExample" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
@@ -473,6 +473,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;
@@ -481,14 +482,17 @@
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_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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -514,7 +518,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
@@ -526,6 +530,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;
@@ -534,14 +539,17 @@
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_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_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
@@ -560,7 +568,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 8.4;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
@@ -577,7 +585,7 @@
IBSC_NOTICES = NO;
IBSC_WARNINGS = NO;
INFOPLIST_FILE = "DwifftExample-iOS/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -595,7 +603,7 @@
IBSC_NOTICES = NO;
IBSC_WARNINGS = NO;
INFOPLIST_FILE = "DwifftExample-iOS/Supporting Files/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.jflinter.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
43 changes: 34 additions & 9 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,14 +1,39 @@
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "Dwifft",
dependencies : [],
exclude: [
"Carthage",
"DwifftTests",
"DwifftExample",
"docs",
"Dwifft.xcworkspace",
"scripts",
]
// exclude: [
// "Carthage",
// "DwifftTests",
// "DwifftExample",
// "docs",
// "Dwifft.xcworkspace",
// "scripts",
// ],
products: [
// Products define the executables and libraries produced by a package, and make them visible to other packages.
.library(
name: "Dwifft",
targets: ["Dwifft"]
)
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "Dwifft",
dependencies: [],
path: "Dwifft"),
// .testTarget(
// name: "DwifftTests",
// dependencies: ["Dwifft"],
// path: "DwifftTests"),
]
)