Skip to content

Commit

Permalink
Merge branch 'release/4.0.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0c committed Nov 9, 2020
2 parents a8deebb + f26367a commit a07ad8c
Show file tree
Hide file tree
Showing 20 changed files with 299 additions and 211 deletions.
1 change: 1 addition & 0 deletions .swift-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.2
2 changes: 2 additions & 0 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use_frameworks!
platform :ios, '11.0'

target 'TableViewContent_Example' do
pod 'TableViewContent', :path => '../'

pod 'SwiftFormat/CLI'
target 'TableViewContent_Tests' do
inherit! :search_paths

Expand Down
15 changes: 11 additions & 4 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
PODS:
- TableViewContent (0.1.0)
- SwiftFormat/CLI (0.47.2)
- TableViewContent (3.0.2)

DEPENDENCIES:
- SwiftFormat/CLI
- TableViewContent (from `../`)

SPEC REPOS:
trunk:
- SwiftFormat

EXTERNAL SOURCES:
TableViewContent:
:path: "../"

SPEC CHECKSUMS:
TableViewContent: a8cebe70f2f1c0912a4f2421fa7abbeeeb6518dc
SwiftFormat: 0315a7115b15fd4ea2d043d5f5c22e3c98f84078
TableViewContent: c14053186a1579cb9dbfe1173383e1ae75caf48b

PODFILE CHECKSUM: da72eb19b5edaa7a2ab24eb95800c6a0c2ad7e7b
PODFILE CHECKSUM: 35a8be3893318873897612545b5fea602dc5ba4d

COCOAPODS: 1.5.3
COCOAPODS: 1.10.0
46 changes: 31 additions & 15 deletions Example/TableViewContent.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
D8EA5AF2585C745D1C9229CB /* Pods_TableViewContent_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 21A113A00DC1B24113548C9C /* Pods_TableViewContent_Example.framework */; };
E902795D2553DB2A0076246D /* CustomHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E902795C2553DB2A0076246D /* CustomHeaderView.swift */; };
E90279612553DB300076246D /* CustomHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E90279602553DB300076246D /* CustomHeaderView.xib */; };
E94A52C3216BBD440074BF82 /* CustomTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E94A52C1216BBD440074BF82 /* CustomTableViewCell.swift */; };
E94A52C3216BBD440074BF82 /* CustomRow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E94A52C1216BBD440074BF82 /* CustomRow.swift */; };
E94A52C4216BBD440074BF82 /* CustomTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E94A52C2216BBD440074BF82 /* CustomTableViewCell.xib */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -51,7 +51,7 @@
B7A73DFCCD09D36F0E59C11F /* Pods-TableViewContent_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TableViewContent_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-TableViewContent_Tests/Pods-TableViewContent_Tests.release.xcconfig"; sourceTree = "<group>"; };
E902795C2553DB2A0076246D /* CustomHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomHeaderView.swift; sourceTree = "<group>"; };
E90279602553DB300076246D /* CustomHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomHeaderView.xib; sourceTree = "<group>"; };
E94A52C1216BBD440074BF82 /* CustomTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTableViewCell.swift; sourceTree = "<group>"; };
E94A52C1216BBD440074BF82 /* CustomRow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRow.swift; sourceTree = "<group>"; };
E94A52C2216BBD440074BF82 /* CustomTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomTableViewCell.xib; sourceTree = "<group>"; };
F1D0D8B5537BDF9787B774A8 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
FC47E3A09CA4830F57C9306C /* TableViewContent.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = TableViewContent.podspec; path = ../TableViewContent.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
Expand Down Expand Up @@ -114,7 +114,7 @@
children = (
607FACD51AFB9204008FA782 /* AppDelegate.swift */,
607FACD71AFB9204008FA782 /* ViewController.swift */,
E94A52C1216BBD440074BF82 /* CustomTableViewCell.swift */,
E94A52C1216BBD440074BF82 /* CustomRow.swift */,
E94A52C2216BBD440074BF82 /* CustomTableViewCell.xib */,
607FACD91AFB9204008FA782 /* Main.storyboard */,
607FACDC1AFB9204008FA782 /* Images.xcassets */,
Expand Down Expand Up @@ -183,6 +183,7 @@
607FACCD1AFB9204008FA782 /* Frameworks */,
607FACCE1AFB9204008FA782 /* Resources */,
9C06A920C5F587FB93B5B6C6 /* [CP] Embed Pods Frameworks */,
E9EF52E325592A2F00F1DDEF /* ShellScript */,
);
buildRules = (
);
Expand Down Expand Up @@ -219,7 +220,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 1020;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = CocoaPods;
TargetAttributes = {
607FACCF1AFB9204008FA782 = {
Expand Down Expand Up @@ -302,21 +303,17 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-TableViewContent_Example/Pods-TableViewContent_Example-frameworks.sh",
"${PODS_ROOT}/Target Support Files/Pods-TableViewContent_Example/Pods-TableViewContent_Example-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/TableViewContent/TableViewContent.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TableViewContent.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TableViewContent_Example/Pods-TableViewContent_Example-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-TableViewContent_Example/Pods-TableViewContent_Example-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E26A140DDBB44EE75579A561 /* [CP] Check Pods Manifest.lock */ = {
Expand All @@ -341,6 +338,23 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
E9EF52E325592A2F00F1DDEF /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n\"${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat\" \"$SRCROOT\"\n";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
Expand All @@ -349,7 +363,7 @@
buildActionMask = 2147483647;
files = (
E902795D2553DB2A0076246D /* CustomHeaderView.swift in Sources */,
E94A52C3216BBD440074BF82 /* CustomTableViewCell.swift in Sources */,
E94A52C3216BBD440074BF82 /* CustomRow.swift in Sources */,
607FACD81AFB9204008FA782 /* ViewController.swift in Sources */,
607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */,
);
Expand Down Expand Up @@ -416,6 +430,7 @@
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;
Expand All @@ -441,7 +456,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -472,6 +487,7 @@
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;
Expand All @@ -490,7 +506,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -504,7 +520,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TableViewContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
Expand All @@ -519,7 +535,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = TableViewContent/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MODULE_NAME = ExampleApp;
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
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 = "1020"
LastUpgradeVersion = "1210"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -41,6 +41,15 @@
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "TableViewContent_Example.app"
BlueprintName = "TableViewContent_Example"
ReferencedContainer = "container:TableViewContent.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -53,17 +62,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "607FACCF1AFB9204008FA782"
BuildableName = "TableViewContent_Example.app"
BlueprintName = "TableViewContent_Example"
ReferencedContainer = "container:TableViewContent.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -85,8 +83,6 @@
ReferencedContainer = "container:TableViewContent.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand Down
19 changes: 7 additions & 12 deletions Example/TableViewContent/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,37 +10,32 @@ import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


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

func applicationWillResignActive(_ application: UIApplication) {
func applicationWillResignActive(_: 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) {
func applicationDidEnterBackground(_: 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) {
func applicationWillEnterForeground(_: 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) {
func applicationDidBecomeActive(_: 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) {
func applicationWillTerminate(_: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


}

2 changes: 1 addition & 1 deletion Example/TableViewContent/CustomHeaderView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
import TableViewContent

class CustomHeaderView: UIView, TableViewContent.SectionConfigurable {
@IBOutlet weak var headerTitle: UILabel!
@IBOutlet var headerTitle: UILabel!

func configure(_ data: Any) {
guard let data = data as? String else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,36 @@
// Copyright © 2018 CocoaPods. All rights reserved.
//

import UIKit
import TableViewContent
import UIKit

class CustomTableViewCell: UITableViewCell {
@IBOutlet weak var button: UIButton!
@IBOutlet var button: UIButton!
}

class CustomCell: CellRepresentation {
class CustomRow: RowRepresentation {
public typealias Action = () -> Void

private var buttonPressedAction: Action = {}

init() {
super.init(nib: UINib(nibName: "CustomTableViewCell", bundle: nil), cellType: CustomTableViewCell.self, reuseIdentifier: "CustomTableViewCell", data: nil)
self.configure(CustomTableViewCell.self) { [unowned self] (cell, _, _) in
configure(CustomTableViewCell.self) { [unowned self] cell, _, _ in
cell.button.addTarget(self, action: #selector(self.buttonPressed), for: .touchUpInside)
}
}

convenience init(_ action: @escaping Action) {
self.init()
buttonPressedAction = action
}

@discardableResult
func didButtonPress(_ action: @escaping Action) -> Self {
buttonPressedAction = action
return self
}

@objc private func buttonPressed() {
buttonPressedAction()
}
Expand Down
Loading

0 comments on commit a07ad8c

Please sign in to comment.