From e8d0ca3d534848c42187eb63751e213827b46aa9 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 02:51:45 +0900 Subject: [PATCH 01/10] Add weak link SwiftUI framework --- .github/workflows/ci.yml | 11 ++++++++-- Carbon.podspec | 3 ++- Carbon.xcodeproj/project.pbxproj | 8 +++++-- .../xcshareddata/xcschemes/Carbon.xcscheme | 22 ++++++++----------- README.md | 2 +- .../ComponentSwiftUISupportTests.swift | 13 ++++++++++- XCConfigs/Carbon.xcconfig | 1 + 7 files changed, 40 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c471d35..bf71d6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,14 @@ jobs: strategy: fail-fast: false matrix: - xcode_version: ["10.2", "11.1"] + xcode_version: [10.2, 11.1] + include: + - xcode_version: 10.2 + simulator_name: iPhone SE + ios_version: 10.2 + - xcode_version: 11.1 + simulator_name: iPhone 11 Pro + ios_version: 13.1 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: @@ -20,4 +27,4 @@ jobs: xcodebuild -version - name: Test iOS on Xcode ${{ matrix.xcode_version }} run: | - set -o pipefail && xcodebuild build-for-testing test-without-building -workspace Carbon.xcworkspace -scheme Carbon -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8' ENABLE_TESTABILITY=YES | xcpretty -c + set -o pipefail && xcodebuild build-for-testing test-without-building -workspace Carbon.xcworkspace -scheme Carbon -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.simulator_name }},OS=${{ matrix.ios_version }}' ENABLE_TESTABILITY=YES | xcpretty -c diff --git a/Carbon.podspec b/Carbon.podspec index 2d6b186..8d0309c 100644 --- a/Carbon.podspec +++ b/Carbon.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'Carbon' - spec.version = '1.0.0-rc.5' + spec.version = '1.0.0-rc.6' spec.author = { 'ra1028' => 'r.fe51028.r@gmail.com' } spec.homepage = 'https://github.com/ra1028/Carbon' spec.documentation_url = 'https://ra1028.github.io/Carbon' @@ -13,4 +13,5 @@ Pod::Spec.new do |spec| spec.ios.deployment_target = '10.0' spec.dependency 'DifferenceKit/Core', "~> 1.1" spec.ios.frameworks = 'UIKit' + spec.ios.weak_frameworks = 'SwiftUI' end diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index 79bcdc8..7090d4c 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -69,6 +69,7 @@ 6BC83E51231ED21700350855 /* SectionsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E50231ED21700350855 /* SectionsBuilder.swift */; }; 6BC83E53231ED42C00350855 /* SectionsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E52231ED42C00350855 /* SectionsBuildable.swift */; }; 6BD04F3E235FA9B800E53082 /* ComponentSwiftUISupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BD04F3D235FA9B800E53082 /* ComponentSwiftUISupportTests.swift */; }; + 6BDAB63C23675D5100D0BFA2 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -148,6 +149,7 @@ 6BC83E50231ED21700350855 /* SectionsBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionsBuilder.swift; sourceTree = ""; }; 6BC83E52231ED42C00350855 /* SectionsBuildable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionsBuildable.swift; sourceTree = ""; }; 6BD04F3D235FA9B800E53082 /* ComponentSwiftUISupportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentSwiftUISupportTests.swift; sourceTree = ""; }; + 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -155,6 +157,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6BDAB63C23675D5100D0BFA2 /* SwiftUI.framework in Frameworks */, 6B6594C221E2599600291AAF /* DifferenceKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -323,6 +326,7 @@ 6B6594C021E2599600291AAF /* Frameworks */ = { isa = PBXGroup; children = ( + 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */, 6B6594C121E2599600291AAF /* DifferenceKit.framework */, ); name = Frameworks; @@ -767,7 +771,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Carbon; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -798,7 +802,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "$(inherited)"; PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Carbon; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/Carbon.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme b/Carbon.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme index 2384878..d47b6a6 100644 --- a/Carbon.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme +++ b/Carbon.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -39,17 +48,6 @@ - - - - - - - - [See More Usage] -[See Example App] +[See Example App] --- diff --git a/Tests/SwiftUISupport/ComponentSwiftUISupportTests.swift b/Tests/SwiftUISupport/ComponentSwiftUISupportTests.swift index aeba04d..fbbd697 100644 --- a/Tests/SwiftUISupport/ComponentSwiftUISupportTests.swift +++ b/Tests/SwiftUISupport/ComponentSwiftUISupportTests.swift @@ -4,9 +4,12 @@ import XCTest import SwiftUI @testable import Carbon -@available(iOS 13.0, *) final class ComponentSwiftUISupportTests: XCTestCase { func testDisplayLifecycle() { + guard #available(iOS 13.0, *) else { + return + } + struct TestComponent: Component, View { var willDisplay: () -> Void var didEndDisplay: () -> Void @@ -55,6 +58,10 @@ final class ComponentSwiftUISupportTests: XCTestCase { } func testReferenceSize() { + guard #available(iOS 13.0, *) else { + return + } + struct TestComponent: Component, View { static let testSize = CGSize(width: 123, height: 456) @@ -76,6 +83,10 @@ final class ComponentSwiftUISupportTests: XCTestCase { } func testIntrinsicContentSize() { + guard #available(iOS 13.0, *) else { + return + } + struct TestComponent: Component, View { static let testSize = CGSize(width: 123, height: 456) diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index 71ca2d4..f176eaa 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -16,3 +16,4 @@ DYLIB_CURRENT_VERSION = 1 DYLIB_INSTALL_NAME_BASE = @rpath LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/Frameworks @loader_path/../Frameworks DEFINES_MODULE = NO +OTHER_LDFLAGS = -weak_framework SwiftUI -weak_framework Combine From 6a2ebcc23ed0267ad7dc0cde20a51c4f6c41c1cc Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 03:34:00 +0900 Subject: [PATCH 02/10] Add weak link of SwiftUI to the test target --- Carbon.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index 7090d4c..b7ed032 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -63,6 +63,7 @@ 6B7ADEE121FBA6D1003803BE /* ComponentContainerElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */; }; 6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */; }; 6B7EEDA0224CE4E100060872 /* UIScrollViewExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */; }; + 6B8250CB23676BF700BCA20D /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 6BAEA43D228D4E920026F81E /* RuntimeAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */; }; 6BC83E4B231ED14700350855 /* CellsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4A231ED14600350855 /* CellsBuilder.swift */; }; 6BC83E4D231ED17300350855 /* CellsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4C231ED17300350855 /* CellsBuildable.swift */; }; @@ -166,6 +167,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6B8250CB23676BF700BCA20D /* SwiftUI.framework in Frameworks */, 6B7ADEB321F783E3003803BE /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; From b891821d0f58682678c34609d3992072c69f6100 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 03:55:11 +0900 Subject: [PATCH 03/10] Fix link binary with libraries --- Carbon.xcodeproj/project.pbxproj | 4 ---- XCConfigs/Carbon.xcconfig | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index b7ed032..eb5d5dc 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -63,14 +63,12 @@ 6B7ADEE121FBA6D1003803BE /* ComponentContainerElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */; }; 6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */; }; 6B7EEDA0224CE4E100060872 /* UIScrollViewExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */; }; - 6B8250CB23676BF700BCA20D /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 6BAEA43D228D4E920026F81E /* RuntimeAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */; }; 6BC83E4B231ED14700350855 /* CellsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4A231ED14600350855 /* CellsBuilder.swift */; }; 6BC83E4D231ED17300350855 /* CellsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4C231ED17300350855 /* CellsBuildable.swift */; }; 6BC83E51231ED21700350855 /* SectionsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E50231ED21700350855 /* SectionsBuilder.swift */; }; 6BC83E53231ED42C00350855 /* SectionsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E52231ED42C00350855 /* SectionsBuildable.swift */; }; 6BD04F3E235FA9B800E53082 /* ComponentSwiftUISupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BD04F3D235FA9B800E53082 /* ComponentSwiftUISupportTests.swift */; }; - 6BDAB63C23675D5100D0BFA2 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -158,7 +156,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6BDAB63C23675D5100D0BFA2 /* SwiftUI.framework in Frameworks */, 6B6594C221E2599600291AAF /* DifferenceKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -167,7 +164,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6B8250CB23676BF700BCA20D /* SwiftUI.framework in Frameworks */, 6B7ADEB321F783E3003803BE /* Carbon.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index f176eaa..23b4df2 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -16,4 +16,4 @@ DYLIB_CURRENT_VERSION = 1 DYLIB_INSTALL_NAME_BASE = @rpath LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/Frameworks @loader_path/../Frameworks DEFINES_MODULE = NO -OTHER_LDFLAGS = -weak_framework SwiftUI -weak_framework Combine +OTHER_LDFLAGS = -weak_framework SwiftUI From 2e88e0683d0967a32fc1dd69e09074b67b7350c1 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 04:12:03 +0900 Subject: [PATCH 04/10] Fix OTHER_LDFLAGS --- XCConfigs/Carbon.xcconfig | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index 23b4df2..59929ac 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -3,9 +3,13 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.0 SDKROOT = SUPPORTED_PLATFORMS = iphoneos iphonesimulator TARGETED_DEVICE_FAMILY = 1,2 + VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 +OTHER_LDFLAGS[sdk=iphoneos13.0] = -weak_framework SwiftUI +OTHER_LDFLAGS[sdk=iphonesimulator13.0] = -weak_framework SwiftUI + CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = CODE_SIGN_STYLE = Manual @@ -16,4 +20,3 @@ DYLIB_CURRENT_VERSION = 1 DYLIB_INSTALL_NAME_BASE = @rpath LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/../Frameworks @loader_path/Frameworks @loader_path/../Frameworks DEFINES_MODULE = NO -OTHER_LDFLAGS = -weak_framework SwiftUI From 3b4f2f0379af72d2aba3e6125463f452308c1fb0 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 05:17:46 +0900 Subject: [PATCH 05/10] Fix tests for iOS10 --- .swiftlint.yml | 2 +- Carbon.xcodeproj/project.pbxproj | 2 ++ .../UICollectionViewFlowLayoutAdapterTests.swift | 14 ++++++++++++-- Tests/Updater/UICollectionViewUpdaterTests.swift | 7 +++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 0fd9bd5..9a4354a 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -25,7 +25,7 @@ type_body_length: warning: 400 function_body_length: - warning: 50 + warning: 60 cyclomatic_complexity: warning: 12 diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index eb5d5dc..61eed71 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -63,6 +63,7 @@ 6B7ADEE121FBA6D1003803BE /* ComponentContainerElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */; }; 6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */; }; 6B7EEDA0224CE4E100060872 /* UIScrollViewExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */; }; + 6B8E5D7F2367777C000C7B35 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 6BAEA43D228D4E920026F81E /* RuntimeAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */; }; 6BC83E4B231ED14700350855 /* CellsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4A231ED14600350855 /* CellsBuilder.swift */; }; 6BC83E4D231ED17300350855 /* CellsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4C231ED17300350855 /* CellsBuildable.swift */; }; @@ -156,6 +157,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 6B8E5D7F2367777C000C7B35 /* SwiftUI.framework in Frameworks */, 6B6594C221E2599600291AAF /* DifferenceKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Tests/Adapters/UICollectionViewFlowLayoutAdapterTests.swift b/Tests/Adapters/UICollectionViewFlowLayoutAdapterTests.swift index f2d0078..1a91925 100644 --- a/Tests/Adapters/UICollectionViewFlowLayoutAdapterTests.swift +++ b/Tests/Adapters/UICollectionViewFlowLayoutAdapterTests.swift @@ -282,7 +282,10 @@ final class UICollectionViewFlowLayoutAdapterTests: XCTestCase { ) ] - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewLayout()) + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewFlowLayout()) + collectionView.dataSource = adapter + collectionView.delegate = adapter + collectionView.layoutIfNeeded() func check(expectedClass: (UICollectionViewCell & ComponentRenderable).Type) { let cell = adapter.collectionView( @@ -324,7 +327,14 @@ final class UICollectionViewFlowLayoutAdapterTests: XCTestCase { ) ] - let collectionView = UICollectionView(frame: .zero, collectionViewLayout: UICollectionViewLayout()) + let layout = UICollectionViewFlowLayout() + layout.headerReferenceSize = CGSize(width: 100, height: 100) + layout.footerReferenceSize = CGSize(width: 100, height: 100) + + let collectionView = UICollectionView( + frame: CGRect(x: 0, y: 0, width: 500, height: 500), + collectionViewLayout: layout + ) collectionView.dataSource = adapter collectionView.delegate = adapter collectionView.layoutIfNeeded() diff --git a/Tests/Updater/UICollectionViewUpdaterTests.swift b/Tests/Updater/UICollectionViewUpdaterTests.swift index 211b2ac..0e435d5 100644 --- a/Tests/Updater/UICollectionViewUpdaterTests.swift +++ b/Tests/Updater/UICollectionViewUpdaterTests.swift @@ -110,6 +110,9 @@ final class UICollectionViewUpdaterTests: XCTestCase { let updater = MockCollectionViewUpdater() let adapter = MockCollectionViewFlowLayoutAdapter() let collectionView = MockCollectionView().addingToWindow() + collectionView.dataSource = adapter + collectionView.delegate = adapter + collectionView.layoutIfNeeded() let visible = ( header: UICollectionComponentReusableView(frame: .zero), @@ -137,6 +140,10 @@ final class UICollectionViewUpdaterTests: XCTestCase { ) } + collectionView.frame.size = CGSize(width: 500, height: 500) + collectionView.flowLayout.itemSize = CGSize(width: 100, height: 100) + collectionView.flowLayout.headerReferenceSize = CGSize(width: 100, height: 100) + collectionView.flowLayout.footerReferenceSize = CGSize(width: 100, height: 100) collectionView.customIndexPathsForVisibleItems = [visible.indexPath] collectionView.customIndexPathsForVisibleSupplementaryElementsOfKind = { _ in [visible.indexPath] } collectionView.customCellForItemAt = { indexPath in From 36ba265776ef45a4d3af9cb3beabc0e9cb9d1772 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 05:19:55 +0900 Subject: [PATCH 06/10] Update docs --- Carbon.xcodeproj/project.pbxproj | 2 -- docs/Adapter.html | 2 +- docs/Builder.html | 2 +- docs/Changeset.html | 2 +- docs/Classes/Renderer.html | 2 +- docs/Classes/UICollectionComponentReusableView.html | 2 +- docs/Classes/UICollectionViewAdapter.html | 2 +- docs/Classes/UICollectionViewAdapter/CellRegistration.html | 2 +- docs/Classes/UICollectionViewAdapter/SelectionContext.html | 2 +- docs/Classes/UICollectionViewAdapter/ViewRegistration.html | 2 +- docs/Classes/UICollectionViewComponentCell.html | 2 +- docs/Classes/UICollectionViewFlowLayoutAdapter.html | 2 +- docs/Classes/UICollectionViewReloadDataUpdater.html | 2 +- docs/Classes/UICollectionViewUpdater.html | 2 +- docs/Classes/UITableViewAdapter.html | 2 +- docs/Classes/UITableViewAdapter/CellRegistration.html | 2 +- docs/Classes/UITableViewAdapter/SelectionContext.html | 2 +- docs/Classes/UITableViewAdapter/ViewRegistration.html | 2 +- docs/Classes/UITableViewComponentCell.html | 2 +- docs/Classes/UITableViewComponentHeaderFooterView.html | 2 +- docs/Classes/UITableViewReloadDataUpdater.html | 2 +- docs/Classes/UITableViewUpdater.html | 2 +- docs/ComponentWrapper.html | 2 +- docs/Element.html | 2 +- docs/Extensions/Optional.html | 2 +- docs/Interface.html | 2 +- docs/Node.html | 2 +- docs/Protocols/Adapter.html | 2 +- docs/Protocols/CellsBuildable.html | 2 +- docs/Protocols/Component.html | 2 +- docs/Protocols/ComponentRenderable.html | 2 +- docs/Protocols/ComponentWrapping.html | 2 +- docs/Protocols/IdentifiableComponent.html | 2 +- docs/Protocols/SectionsBuildable.html | 2 +- docs/Protocols/Updater.html | 2 +- docs/Renderer.html | 2 +- docs/Structs/AnyComponent.html | 2 +- docs/Structs/CellNode.html | 2 +- docs/Structs/CellsBuilder.html | 2 +- docs/Structs/Group.html | 2 +- docs/Structs/IdentifiedComponentWrapper.html | 2 +- docs/Structs/Section.html | 2 +- docs/Structs/SectionsBuilder.html | 2 +- docs/Structs/ViewNode.html | 2 +- docs/Updater.html | 2 +- docs/index.html | 4 ++-- 46 files changed, 46 insertions(+), 48 deletions(-) diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index 61eed71..eb5d5dc 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -63,7 +63,6 @@ 6B7ADEE121FBA6D1003803BE /* ComponentContainerElementTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7ADEE021FBA6D1003803BE /* ComponentContainerElementTests.swift */; }; 6B7EED9E224CA5DD00060872 /* UIScrollViewExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9D224CA5DD00060872 /* UIScrollViewExtensions.swift */; }; 6B7EEDA0224CE4E100060872 /* UIScrollViewExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B7EED9F224CE4E000060872 /* UIScrollViewExtensionsTests.swift */; }; - 6B8E5D7F2367777C000C7B35 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 6BAEA43D228D4E920026F81E /* RuntimeAssociation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BAEA43C228D4E920026F81E /* RuntimeAssociation.swift */; }; 6BC83E4B231ED14700350855 /* CellsBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4A231ED14600350855 /* CellsBuilder.swift */; }; 6BC83E4D231ED17300350855 /* CellsBuildable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC83E4C231ED17300350855 /* CellsBuildable.swift */; }; @@ -157,7 +156,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6B8E5D7F2367777C000C7B35 /* SwiftUI.framework in Frameworks */, 6B6594C221E2599600291AAF /* DifferenceKit.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/docs/Adapter.html b/docs/Adapter.html index 44cc0a0..0e2a9ed 100644 --- a/docs/Adapter.html +++ b/docs/Adapter.html @@ -368,7 +368,7 @@

Declaration

diff --git a/docs/Builder.html b/docs/Builder.html index 57ddf39..7520c3d 100644 --- a/docs/Builder.html +++ b/docs/Builder.html @@ -386,7 +386,7 @@

Declaration

diff --git a/docs/Changeset.html b/docs/Changeset.html index a56b00a..0442357 100644 --- a/docs/Changeset.html +++ b/docs/Changeset.html @@ -287,7 +287,7 @@

Declaration

diff --git a/docs/Classes/Renderer.html b/docs/Classes/Renderer.html index b4bd70e..98fb7d9 100644 --- a/docs/Classes/Renderer.html +++ b/docs/Classes/Renderer.html @@ -681,7 +681,7 @@

Parameters

diff --git a/docs/Classes/UICollectionComponentReusableView.html b/docs/Classes/UICollectionComponentReusableView.html index de5547e..a11909f 100644 --- a/docs/Classes/UICollectionComponentReusableView.html +++ b/docs/Classes/UICollectionComponentReusableView.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewAdapter.html b/docs/Classes/UICollectionViewAdapter.html index 734e79c..1deeda4 100644 --- a/docs/Classes/UICollectionViewAdapter.html +++ b/docs/Classes/UICollectionViewAdapter.html @@ -980,7 +980,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewAdapter/CellRegistration.html b/docs/Classes/UICollectionViewAdapter/CellRegistration.html index fb78360..541880e 100644 --- a/docs/Classes/UICollectionViewAdapter/CellRegistration.html +++ b/docs/Classes/UICollectionViewAdapter/CellRegistration.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewAdapter/SelectionContext.html b/docs/Classes/UICollectionViewAdapter/SelectionContext.html index 0533a18..37a2ddc 100644 --- a/docs/Classes/UICollectionViewAdapter/SelectionContext.html +++ b/docs/Classes/UICollectionViewAdapter/SelectionContext.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewAdapter/ViewRegistration.html b/docs/Classes/UICollectionViewAdapter/ViewRegistration.html index 50196fc..0af2b48 100644 --- a/docs/Classes/UICollectionViewAdapter/ViewRegistration.html +++ b/docs/Classes/UICollectionViewAdapter/ViewRegistration.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewComponentCell.html b/docs/Classes/UICollectionViewComponentCell.html index 6755b9b..901c6d2 100644 --- a/docs/Classes/UICollectionViewComponentCell.html +++ b/docs/Classes/UICollectionViewComponentCell.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewFlowLayoutAdapter.html b/docs/Classes/UICollectionViewFlowLayoutAdapter.html index 257dbd6..125c737 100644 --- a/docs/Classes/UICollectionViewFlowLayoutAdapter.html +++ b/docs/Classes/UICollectionViewFlowLayoutAdapter.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UICollectionViewReloadDataUpdater.html b/docs/Classes/UICollectionViewReloadDataUpdater.html index b0f5e75..039fd09 100644 --- a/docs/Classes/UICollectionViewReloadDataUpdater.html +++ b/docs/Classes/UICollectionViewReloadDataUpdater.html @@ -394,7 +394,7 @@

Parameters

diff --git a/docs/Classes/UICollectionViewUpdater.html b/docs/Classes/UICollectionViewUpdater.html index b334a87..fb5274d 100644 --- a/docs/Classes/UICollectionViewUpdater.html +++ b/docs/Classes/UICollectionViewUpdater.html @@ -689,7 +689,7 @@

Parameters

diff --git a/docs/Classes/UITableViewAdapter.html b/docs/Classes/UITableViewAdapter.html index 78f8e35..8f220ac 100644 --- a/docs/Classes/UITableViewAdapter.html +++ b/docs/Classes/UITableViewAdapter.html @@ -1149,7 +1149,7 @@

Declaration

diff --git a/docs/Classes/UITableViewAdapter/CellRegistration.html b/docs/Classes/UITableViewAdapter/CellRegistration.html index ca04f5e..3f0c9e9 100644 --- a/docs/Classes/UITableViewAdapter/CellRegistration.html +++ b/docs/Classes/UITableViewAdapter/CellRegistration.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UITableViewAdapter/SelectionContext.html b/docs/Classes/UITableViewAdapter/SelectionContext.html index 26dab7c..135e3eb 100644 --- a/docs/Classes/UITableViewAdapter/SelectionContext.html +++ b/docs/Classes/UITableViewAdapter/SelectionContext.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UITableViewAdapter/ViewRegistration.html b/docs/Classes/UITableViewAdapter/ViewRegistration.html index 03ed555..802d1aa 100644 --- a/docs/Classes/UITableViewAdapter/ViewRegistration.html +++ b/docs/Classes/UITableViewAdapter/ViewRegistration.html @@ -320,7 +320,7 @@

Declaration

diff --git a/docs/Classes/UITableViewComponentCell.html b/docs/Classes/UITableViewComponentCell.html index eaf9a9c..9475db3 100644 --- a/docs/Classes/UITableViewComponentCell.html +++ b/docs/Classes/UITableViewComponentCell.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Classes/UITableViewComponentHeaderFooterView.html b/docs/Classes/UITableViewComponentHeaderFooterView.html index 91cb438..a8d5d81 100644 --- a/docs/Classes/UITableViewComponentHeaderFooterView.html +++ b/docs/Classes/UITableViewComponentHeaderFooterView.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Classes/UITableViewReloadDataUpdater.html b/docs/Classes/UITableViewReloadDataUpdater.html index 52fba00..537e06a 100644 --- a/docs/Classes/UITableViewReloadDataUpdater.html +++ b/docs/Classes/UITableViewReloadDataUpdater.html @@ -394,7 +394,7 @@

Parameters

diff --git a/docs/Classes/UITableViewUpdater.html b/docs/Classes/UITableViewUpdater.html index df68b43..59cad2b 100644 --- a/docs/Classes/UITableViewUpdater.html +++ b/docs/Classes/UITableViewUpdater.html @@ -878,7 +878,7 @@

Parameters

diff --git a/docs/ComponentWrapper.html b/docs/ComponentWrapper.html index 87460e9..dd8400d 100644 --- a/docs/ComponentWrapper.html +++ b/docs/ComponentWrapper.html @@ -315,7 +315,7 @@

Declaration

diff --git a/docs/Element.html b/docs/Element.html index c844a0f..4a153de 100644 --- a/docs/Element.html +++ b/docs/Element.html @@ -466,7 +466,7 @@

Declaration

diff --git a/docs/Extensions/Optional.html b/docs/Extensions/Optional.html index ccfcdee..6da664c 100644 --- a/docs/Extensions/Optional.html +++ b/docs/Extensions/Optional.html @@ -299,7 +299,7 @@

Declaration

diff --git a/docs/Interface.html b/docs/Interface.html index 14048e8..ad8c129 100644 --- a/docs/Interface.html +++ b/docs/Interface.html @@ -388,7 +388,7 @@

Declaration

diff --git a/docs/Node.html b/docs/Node.html index c567332..e1f2dda 100644 --- a/docs/Node.html +++ b/docs/Node.html @@ -296,7 +296,7 @@

Declaration

diff --git a/docs/Protocols/Adapter.html b/docs/Protocols/Adapter.html index c307a9b..c8b89f4 100644 --- a/docs/Protocols/Adapter.html +++ b/docs/Protocols/Adapter.html @@ -406,7 +406,7 @@

Return Value

diff --git a/docs/Protocols/CellsBuildable.html b/docs/Protocols/CellsBuildable.html index 17cded0..2bf1efc 100644 --- a/docs/Protocols/CellsBuildable.html +++ b/docs/Protocols/CellsBuildable.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Protocols/Component.html b/docs/Protocols/Component.html index b7d6bcc..af2b0cf 100644 --- a/docs/Protocols/Component.html +++ b/docs/Protocols/Component.html @@ -855,7 +855,7 @@

Return Value

diff --git a/docs/Protocols/ComponentRenderable.html b/docs/Protocols/ComponentRenderable.html index 3f58176..e74d921 100644 --- a/docs/Protocols/ComponentRenderable.html +++ b/docs/Protocols/ComponentRenderable.html @@ -338,7 +338,7 @@

Declaration

diff --git a/docs/Protocols/ComponentWrapping.html b/docs/Protocols/ComponentWrapping.html index e375291..f4ec789 100644 --- a/docs/Protocols/ComponentWrapping.html +++ b/docs/Protocols/ComponentWrapping.html @@ -272,7 +272,7 @@

ComponentWrapping

diff --git a/docs/Protocols/IdentifiableComponent.html b/docs/Protocols/IdentifiableComponent.html index 8a90f03..752b5a9 100644 --- a/docs/Protocols/IdentifiableComponent.html +++ b/docs/Protocols/IdentifiableComponent.html @@ -351,7 +351,7 @@

Declaration

diff --git a/docs/Protocols/SectionsBuildable.html b/docs/Protocols/SectionsBuildable.html index 6aca552..196ed38 100644 --- a/docs/Protocols/SectionsBuildable.html +++ b/docs/Protocols/SectionsBuildable.html @@ -266,7 +266,7 @@

Declaration

diff --git a/docs/Protocols/Updater.html b/docs/Protocols/Updater.html index 1545d6c..1b435e5 100644 --- a/docs/Protocols/Updater.html +++ b/docs/Protocols/Updater.html @@ -421,7 +421,7 @@

Parameters

diff --git a/docs/Renderer.html b/docs/Renderer.html index a6c03ea..fb403a9 100644 --- a/docs/Renderer.html +++ b/docs/Renderer.html @@ -285,7 +285,7 @@

Declaration

diff --git a/docs/Structs/AnyComponent.html b/docs/Structs/AnyComponent.html index 89d58a0..0726ca6 100644 --- a/docs/Structs/AnyComponent.html +++ b/docs/Structs/AnyComponent.html @@ -754,7 +754,7 @@

Declaration

diff --git a/docs/Structs/CellNode.html b/docs/Structs/CellNode.html index 277e72a..aaab2bc 100644 --- a/docs/Structs/CellNode.html +++ b/docs/Structs/CellNode.html @@ -538,7 +538,7 @@

Declaration

diff --git a/docs/Structs/CellsBuilder.html b/docs/Structs/CellsBuilder.html index 773373d..ad9ad44 100644 --- a/docs/Structs/CellsBuilder.html +++ b/docs/Structs/CellsBuilder.html @@ -268,7 +268,7 @@

Declaration

diff --git a/docs/Structs/Group.html b/docs/Structs/Group.html index 826502b..6c124ec 100644 --- a/docs/Structs/Group.html +++ b/docs/Structs/Group.html @@ -460,7 +460,7 @@

Return Value

diff --git a/docs/Structs/IdentifiedComponentWrapper.html b/docs/Structs/IdentifiedComponentWrapper.html index 254d372..53bd2f7 100644 --- a/docs/Structs/IdentifiedComponentWrapper.html +++ b/docs/Structs/IdentifiedComponentWrapper.html @@ -352,7 +352,7 @@

Parameters

diff --git a/docs/Structs/Section.html b/docs/Structs/Section.html index 914b61d..e4719fc 100644 --- a/docs/Structs/Section.html +++ b/docs/Structs/Section.html @@ -1235,7 +1235,7 @@

Declaration

diff --git a/docs/Structs/SectionsBuilder.html b/docs/Structs/SectionsBuilder.html index 4bb9428..7e48413 100644 --- a/docs/Structs/SectionsBuilder.html +++ b/docs/Structs/SectionsBuilder.html @@ -267,7 +267,7 @@

Declaration

diff --git a/docs/Structs/ViewNode.html b/docs/Structs/ViewNode.html index a598e79..305a506 100644 --- a/docs/Structs/ViewNode.html +++ b/docs/Structs/ViewNode.html @@ -393,7 +393,7 @@

Declaration

diff --git a/docs/Updater.html b/docs/Updater.html index f1a3704..1e07bcd 100644 --- a/docs/Updater.html +++ b/docs/Updater.html @@ -388,7 +388,7 @@

Declaration

diff --git a/docs/index.html b/docs/index.html index 75f8ee2..e7e2f6f 100644 --- a/docs/index.html +++ b/docs/index.html @@ -483,7 +483,7 @@

Group

[See More Usage] -[See Example App] +[See Example App]


@@ -811,7 +811,7 @@

License

From bb4d28921bacd5aa4468df1ccaaed0acb89f24b3 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 05:36:16 +0900 Subject: [PATCH 07/10] Fix OTHER_LDFLAGS --- XCConfigs/Carbon.xcconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index 59929ac..50fa4a4 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -3,12 +3,9 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.0 SDKROOT = SUPPORTED_PLATFORMS = iphoneos iphonesimulator TARGETED_DEVICE_FAMILY = 1,2 - VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 - -OTHER_LDFLAGS[sdk=iphoneos13.0] = -weak_framework SwiftUI -OTHER_LDFLAGS[sdk=iphonesimulator13.0] = -weak_framework SwiftUI +OTHER_LDFLAGS = -weak_framework SwiftUI CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = From f2977d6a5328de0ca6f365863d5388d12aa97b62 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 15:01:59 +0900 Subject: [PATCH 08/10] Remove SwiftUI framework ref --- Carbon.xcodeproj/project.pbxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/Carbon.xcodeproj/project.pbxproj b/Carbon.xcodeproj/project.pbxproj index eb5d5dc..2c23b83 100644 --- a/Carbon.xcodeproj/project.pbxproj +++ b/Carbon.xcodeproj/project.pbxproj @@ -148,7 +148,6 @@ 6BC83E50231ED21700350855 /* SectionsBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionsBuilder.swift; sourceTree = ""; }; 6BC83E52231ED42C00350855 /* SectionsBuildable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionsBuildable.swift; sourceTree = ""; }; 6BD04F3D235FA9B800E53082 /* ComponentSwiftUISupportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ComponentSwiftUISupportTests.swift; sourceTree = ""; }; - 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/SwiftUI.framework; sourceTree = DEVELOPER_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -324,7 +323,6 @@ 6B6594C021E2599600291AAF /* Frameworks */ = { isa = PBXGroup; children = ( - 6BDAB63B23675D5100D0BFA2 /* SwiftUI.framework */, 6B6594C121E2599600291AAF /* DifferenceKit.framework */, ); name = Frameworks; From 87d52d020ede8b9b24b83455eec66d439afbb674 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 15:55:01 +0900 Subject: [PATCH 09/10] Fix OTHER_LDFLAGS --- XCConfigs/Carbon.xcconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index 50fa4a4..4cf7db0 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -5,7 +5,8 @@ SUPPORTED_PLATFORMS = iphoneos iphonesimulator TARGETED_DEVICE_FAMILY = 1,2 VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 -OTHER_LDFLAGS = -weak_framework SwiftUI +OTHER_LDFLAGS[sdk=iphoneos13.0] = -weak_framework SwiftUI +OTHER_LDFLAGS[sdk=iphonesimulator13.0] = -weak_framework SwiftUI CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = From b554c1a16a87d266312469418cdbbac170aa1070 Mon Sep 17 00:00:00 2001 From: Ryo Aoyama Date: Tue, 29 Oct 2019 17:44:08 +0900 Subject: [PATCH 10/10] Drop support for Swift5.0 and Xcode10 --- .github/workflows/ci.yml | 17 +- .swift-version | 2 +- Carbon.podspec | 2 +- README.md | 12 +- .../ComponentWrapper/ComponentWrapping.swift | 16 - Sources/FunctionBuilder/CellsBuilder.swift | 4 - Sources/FunctionBuilder/Group.swift | 4 - Sources/FunctionBuilder/SectionsBuilder.swift | 4 - Sources/Renderer.swift | 6 - Sources/Section.swift | 20 +- Tests/FunctionBuilder/CellsBuilderTests.swift | 4 - Tests/FunctionBuilder/GroupTests.swift | 4 - .../SectionsBuilderTests.swift | 4 - Tests/RendererTests.swift | 6 - Tests/SectionTests.swift | 6 - XCConfigs/Carbon.xcconfig | 3 +- docs/Adapter.html | 3 - docs/Builder.html | 3 - docs/Changeset.html | 3 - docs/Classes/Renderer.html | 7 - .../UICollectionComponentReusableView.html | 3 - docs/Classes/UICollectionViewAdapter.html | 3 - .../CellRegistration.html | 3 - .../SelectionContext.html | 3 - .../ViewRegistration.html | 3 - .../UICollectionViewComponentCell.html | 3 - .../UICollectionViewFlowLayoutAdapter.html | 3 - .../UICollectionViewReloadDataUpdater.html | 3 - docs/Classes/UICollectionViewUpdater.html | 3 - docs/Classes/UITableViewAdapter.html | 3 - .../UITableViewAdapter/CellRegistration.html | 3 - .../UITableViewAdapter/SelectionContext.html | 3 - .../UITableViewAdapter/ViewRegistration.html | 3 - docs/Classes/UITableViewComponentCell.html | 3 - .../UITableViewComponentHeaderFooterView.html | 3 - .../Classes/UITableViewReloadDataUpdater.html | 3 - docs/Classes/UITableViewUpdater.html | 3 - docs/ComponentWrapper.html | 24 - docs/Element.html | 3 - docs/Extensions/Optional.html | 3 - docs/Interface.html | 3 - docs/Node.html | 3 - docs/Protocols/Adapter.html | 3 - docs/Protocols/CellsBuildable.html | 3 - docs/Protocols/Component.html | 3 - docs/Protocols/ComponentRenderable.html | 3 - docs/Protocols/ComponentWrapping.html | 484 +++++++++++++++++- docs/Protocols/IdentifiableComponent.html | 3 - docs/Protocols/SectionsBuildable.html | 3 - docs/Protocols/Updater.html | 3 - docs/Renderer.html | 3 - docs/Structs/AnyComponent.html | 3 - docs/Structs/CellNode.html | 3 - docs/Structs/CellsBuilder.html | 3 - docs/Structs/Group.html | 3 - docs/Structs/IdentifiedComponentWrapper.html | 3 - docs/Structs/Section.html | 480 ----------------- docs/Structs/SectionsBuilder.html | 3 - docs/Structs/ViewNode.html | 3 - docs/Updater.html | 3 - docs/index.html | 15 +- docs/search.json | 2 +- 62 files changed, 505 insertions(+), 741 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf71d6c..6e658a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,14 +7,11 @@ jobs: strategy: fail-fast: false matrix: - xcode_version: [10.2, 11.1] - include: - - xcode_version: 10.2 - simulator_name: iPhone SE - ios_version: 10.2 - - xcode_version: 11.1 - simulator_name: iPhone 11 Pro - ios_version: 13.1 + xcode_version: + - 11.1 + destination: + - platform=iOS Simulator,name=iPhone 11 Pro,OS=13.1 + - platform=iOS Simulator,name=iPhone SE,OS=10.0 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app steps: @@ -25,6 +22,6 @@ jobs: run: | swift --version xcodebuild -version - - name: Test iOS on Xcode ${{ matrix.xcode_version }} + - name: Test iOS on Xcode ${{ matrix.xcode_version }} simulator ${{ matrix.destination }} run: | - set -o pipefail && xcodebuild build-for-testing test-without-building -workspace Carbon.xcworkspace -scheme Carbon -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=${{ matrix.simulator_name }},OS=${{ matrix.ios_version }}' ENABLE_TESTABILITY=YES | xcpretty -c + set -o pipefail && xcodebuild build-for-testing test-without-building -workspace Carbon.xcworkspace -scheme Carbon -configuration Release -sdk iphonesimulator -destination '${{ matrix.destination }}' ENABLE_TESTABILITY=YES | xcpretty -c diff --git a/.swift-version b/.swift-version index 819e07a..a75b92f 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -5.0 +5.1 diff --git a/Carbon.podspec b/Carbon.podspec index 8d0309c..4453f71 100644 --- a/Carbon.podspec +++ b/Carbon.podspec @@ -9,7 +9,7 @@ Pod::Spec.new do |spec| spec.source_files = 'Sources/**/*.swift' spec.license = { :type => 'Apache 2.0', :file => 'LICENSE' } spec.requires_arc = true - spec.swift_versions = ['5.0', '5.1'] + spec.swift_versions = ['5.1'] spec.ios.deployment_target = '10.0' spec.dependency 'DifferenceKit/Core', "~> 1.1" spec.ios.frameworks = 'UIKit' diff --git a/README.md b/README.md index fa0d786..53d908e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ in UITableView and UICollectionView.
Carthage
CI Status -Swift5 +Swift 5.1 Platform Lincense

@@ -522,7 +522,7 @@ Default is `true`. ### Without FunctionBuilder Syntax -If you are using Swift 5, you cannot use the function builder that you have queried so far, but Carbon can also build a UI with declarative syntax without function builder as following. +Carbon can also build a UI with declarative syntax without function builder as following. - **ViewNode** @@ -567,10 +567,8 @@ renderer.render( ## Requirements -- Swift 5.0+ -- Xcode 10.2+ - -Note: function builder syntax requires Swift5.1+ and Xcode 11.0+ +- Swift 5.1+ +- Xcode 11.0+ --- @@ -589,7 +587,7 @@ github "ra1028/Carbon" ``` ### [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app) -Select Xcode menu File > Swift Packages > Add Package Dependency and enter repository URL with GUI. +Select Xcode menu `File > Swift Packages > Add Package Dependency...` and enter repository URL with GUI. ``` Repository: https://github.com/ra1028/Carbon ``` diff --git a/Sources/ComponentWrapper/ComponentWrapping.swift b/Sources/ComponentWrapper/ComponentWrapping.swift index d655e42..b1c0b53 100644 --- a/Sources/ComponentWrapper/ComponentWrapping.swift +++ b/Sources/ComponentWrapper/ComponentWrapping.swift @@ -1,7 +1,5 @@ import UIKit -#if swift(>=5.1) - /// Represents a wrapper of component that forwards all actions to wrapped component. /// You can easily conform arbitrary type to `Component` protocol by wrapping component instance. @dynamicMemberLookup @@ -21,20 +19,6 @@ public extension ComponentWrapping { } } -#else - -/// Represents a wrapper of component that forwards all actions to wrapped component. -/// You can easily conform arbitrary type to `Component` protocol by wrapping component instance. -public protocol ComponentWrapping: Component { - /// The type of wrapped component. - associatedtype Wrapped: Component - - /// The wrapped component instance. - var wrapped: Wrapped { get } -} - -#endif - public extension ComponentWrapping { /// A string used to identify a element that is reusable. Default is the type name of `self`. @inlinable diff --git a/Sources/FunctionBuilder/CellsBuilder.swift b/Sources/FunctionBuilder/CellsBuilder.swift index 47b7692..2638d8b 100644 --- a/Sources/FunctionBuilder/CellsBuilder.swift +++ b/Sources/FunctionBuilder/CellsBuilder.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - // swiftlint:disable line_length // swiftlint:disable function_parameter_count @@ -174,5 +172,3 @@ internal extension CellsBuilder { cellNodes = cellNodes0 + cellNodes1 + cellNodes2 + c9.buildCells() } } - -#endif diff --git a/Sources/FunctionBuilder/Group.swift b/Sources/FunctionBuilder/Group.swift index ca7adda..d6edf60 100644 --- a/Sources/FunctionBuilder/Group.swift +++ b/Sources/FunctionBuilder/Group.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - /// An affordance for grouping component or section. /// /// Example for simple grouping of cells. @@ -82,5 +80,3 @@ extension Group: SectionsBuildable where Element == Section { elements } } - -#endif diff --git a/Sources/FunctionBuilder/SectionsBuilder.swift b/Sources/FunctionBuilder/SectionsBuilder.swift index 8711ecb..e74b37f 100644 --- a/Sources/FunctionBuilder/SectionsBuilder.swift +++ b/Sources/FunctionBuilder/SectionsBuilder.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - // swiftlint:disable line_length // swiftlint:disable function_parameter_count @@ -173,5 +171,3 @@ internal extension SectionsBuilder { sections = sections0 + sections1 + sections2 + s9.buildSections() } } - -#endif diff --git a/Sources/Renderer.swift b/Sources/Renderer.swift index ce14389..3d33b9c 100644 --- a/Sources/Renderer.swift +++ b/Sources/Renderer.swift @@ -93,11 +93,7 @@ open class Renderer { open func render(_ data: Section?...) { render(data.compactMap { $0 }) } -} - -#if swift(>=5.1) -extension Renderer { /// Render given variadic number of sections with function builder syntax, immediately. /// /// - Parameters: @@ -117,6 +113,4 @@ extension Renderer { } } -#endif - private struct UniqueIdentifier: Hashable {} diff --git a/Sources/Section.swift b/Sources/Section.swift index 6688474..03cba2f 100644 --- a/Sources/Section.swift +++ b/Sources/Section.swift @@ -91,18 +91,14 @@ public struct Section { footer: footer ) } -} - -#if swift(>=5.1) -public extension Section { /// Create a section wrapping given id and cells with function builder syntax. /// /// - Parameters: /// - id: An identifier to be wrapped. /// - cells: A closure that constructs cells. @inlinable - init(id: I, @CellsBuilder cells: () -> C) { + public init(id: I, @CellsBuilder cells: () -> C) { self.init( id: id, cells: cells().buildCells() @@ -117,7 +113,7 @@ public extension Section { /// - footer: A footer component. /// - cells: A closure that constructs cells. @inlinable - init(id: I, header: H?, footer: F?, @CellsBuilder cells: () -> C) { + public init(id: I, header: H?, footer: F?, @CellsBuilder cells: () -> C) { self.init( id: id, header: header.map(ViewNode.init), @@ -133,7 +129,7 @@ public extension Section { /// - header: A header component. /// - footer: A footer component. @inlinable - init(id: I, header: H?, footer: F?) { + public init(id: I, header: H?, footer: F?) { self.init( id: id, header: header.map(ViewNode.init), @@ -148,7 +144,7 @@ public extension Section { /// - header: A header component. /// - cells: A closure that constructs cells. @inlinable - init(id: I, header: H?, @CellsBuilder cells: () -> CellsBuildable) { + public init(id: I, header: H?, @CellsBuilder cells: () -> CellsBuildable) { self.init( id: id, header: header.map(ViewNode.init), @@ -163,7 +159,7 @@ public extension Section { /// - footer: A footer component. /// - cells: A closure that constructs cells. @inlinable - init(id: I, footer: F?, @CellsBuilder cells: () -> C) { + public init(id: I, footer: F?, @CellsBuilder cells: () -> C) { self.init( id: id, cells: cells().buildCells(), @@ -177,7 +173,7 @@ public extension Section { /// - id: An identifier to be wrapped. /// - header: A header component. @inlinable - init(id: I, header: H?) { + public init(id: I, header: H?) { self.init( id: id, header: header.map(ViewNode.init) @@ -190,7 +186,7 @@ public extension Section { /// - id: An identifier to be wrapped. /// - footer: A footer component. @inlinable - init(id: I, footer: F?) { + public init(id: I, footer: F?) { self.init( id: id, footer: footer.map(ViewNode.init) @@ -198,8 +194,6 @@ public extension Section { } } -#endif - extension Section: SectionsBuildable { /// Build an array of section. public func buildSections() -> [Section] { diff --git a/Tests/FunctionBuilder/CellsBuilderTests.swift b/Tests/FunctionBuilder/CellsBuilderTests.swift index 06d34db..39b7441 100644 --- a/Tests/FunctionBuilder/CellsBuilderTests.swift +++ b/Tests/FunctionBuilder/CellsBuilderTests.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - import XCTest @testable import Carbon @@ -257,5 +255,3 @@ final class CellsBuilderTests: XCTestCase { } } } - -#endif diff --git a/Tests/FunctionBuilder/GroupTests.swift b/Tests/FunctionBuilder/GroupTests.swift index 3b1a801..504b9cb 100644 --- a/Tests/FunctionBuilder/GroupTests.swift +++ b/Tests/FunctionBuilder/GroupTests.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - import XCTest @testable import Carbon @@ -93,5 +91,3 @@ final class GroupTests: XCTestCase { XCTAssertEqual(sections[2].id, 2) } } - -#endif diff --git a/Tests/FunctionBuilder/SectionsBuilderTests.swift b/Tests/FunctionBuilder/SectionsBuilderTests.swift index bb0bcfa..ded0dd7 100644 --- a/Tests/FunctionBuilder/SectionsBuilderTests.swift +++ b/Tests/FunctionBuilder/SectionsBuilderTests.swift @@ -1,5 +1,3 @@ -#if swift(>=5.1) - import XCTest @testable import Carbon @@ -257,5 +255,3 @@ final class SectionsBuilderTests: XCTestCase { } } } - -#endif diff --git a/Tests/RendererTests.swift b/Tests/RendererTests.swift index 607a918..9a852bb 100644 --- a/Tests/RendererTests.swift +++ b/Tests/RendererTests.swift @@ -155,11 +155,7 @@ final class RendererTests: XCTestCase { XCTAssertEqual(renderer.updater.targetCapturedOnUpdates, target) XCTAssertEqual(renderer.updater.adapterCapturedOnUpdates, adapter) } -} - -#if swift(>=5.1) -extension RendererTests { func testRenderWithSectionsBuilder() { let target = MockTarget() let adapter = MockAdapter() @@ -235,5 +231,3 @@ extension RendererTests { XCTAssertEqual(renderer.updater.adapterCapturedOnUpdates, adapter) } } - -#endif diff --git a/Tests/SectionTests.swift b/Tests/SectionTests.swift index 56a91a7..ecb32fc 100644 --- a/Tests/SectionTests.swift +++ b/Tests/SectionTests.swift @@ -144,11 +144,7 @@ final class SectionTests: XCTestCase { let section2 = Section(id: AnyHashable(TestID.b), cells: [dummyNode, nil]) XCTAssertEqual(section2.id, TestID.b) } -} - -#if swift(>=5.1) -extension SectionTests { func testInitWithCellsBuilder() { let condition = false let section = Section( @@ -181,5 +177,3 @@ extension SectionTests { XCTAssertEqual(section.cells[4].component(as: B.Component.self)?.value, 200) } } - -#endif diff --git a/XCConfigs/Carbon.xcconfig b/XCConfigs/Carbon.xcconfig index 4cf7db0..50fa4a4 100644 --- a/XCConfigs/Carbon.xcconfig +++ b/XCConfigs/Carbon.xcconfig @@ -5,8 +5,7 @@ SUPPORTED_PLATFORMS = iphoneos iphonesimulator TARGETED_DEVICE_FAMILY = 1,2 VALID_ARCHS[sdk=iphoneos*] = arm64 armv7 armv7s VALID_ARCHS[sdk=iphonesimulator*] = i386 x86_64 -OTHER_LDFLAGS[sdk=iphoneos13.0] = -weak_framework SwiftUI -OTHER_LDFLAGS[sdk=iphonesimulator13.0] = -weak_framework SwiftUI +OTHER_LDFLAGS = -weak_framework SwiftUI CODE_SIGNING_REQUIRED = NO CODE_SIGN_IDENTITY = diff --git a/docs/Adapter.html b/docs/Adapter.html index 0e2a9ed..6f5b852 100644 --- a/docs/Adapter.html +++ b/docs/Adapter.html @@ -79,9 +79,6 @@ - - - - - - -
-
  • diff --git a/docs/Classes/UICollectionComponentReusableView.html b/docs/Classes/UICollectionComponentReusableView.html index a11909f..c560413 100644 --- a/docs/Classes/UICollectionComponentReusableView.html +++ b/docs/Classes/UICollectionComponentReusableView.html @@ -79,9 +79,6 @@
  • -
- - - - - - - - - - - - - - - - -
-
  • -
    - - - - ComponentWrapping - -
    -
    -
    -
    -
    -
    -

    Represents a wrapper of component that forwards all actions to wrapped component. -You can easily conform arbitrary type to Component protocol by wrapping component instance.

    - - See more -
    -
    -
    -
  • diff --git a/docs/Element.html b/docs/Element.html index 4a153de..3a8307e 100644 --- a/docs/Element.html +++ b/docs/Element.html @@ -79,9 +79,6 @@ - - - - - - - - -
  • - + - wrapped + wrapped
    @@ -261,6 +273,464 @@

    ComponentWrapping

    The wrapped component instance.

    +
    +

    Declaration

    +
    +

    Swift

    +
    var wrapped: Wrapped { get }
    + +
    +
    + + +
  • + + +
    +
      +
    • +
      + + + + subscript(dynamicMember:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Accesses a member of wrapped component with key path.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +subscript<T>(dynamicMember keyPath: KeyPath<Wrapped, T>) -> T { get }
      + +
      +
      +
      +
      +
    • +
    +
    +
    +
      +
    • +
      + + + + reuseIdentifier + + + Extension method + +
      +
      +
      +
      +
      +
      +

      A string used to identify a element that is reusable. Default is the type name of self.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +var reuseIdentifier: String { get }
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + renderContent() + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Returns a new instance of Content.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func renderContent() -> Wrapped.Content
      + +
      +
      +
      +

      Return Value

      +

      A new Content instance.

      +
      +
      +
      +
    • +
    • +
      + + + + render(in:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Render properties into the content.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func render(in content: Wrapped.Content)
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + referenceSize(in:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Returns the referencing size of content to render on the list UI.

      +
      +

      Note

      +

      Only CGSize.height is used to determine the size of element + in UITableView.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func referenceSize(in bounds: CGRect) -> CGSize?
      + +
      +
      +
      +

      Return Value

      +

      The referencing size of content to render on the list UI. + If returns nil, the element of list UI falls back to its default size + like UITableView.rowHeight or UICollectionViewFlowLayout.itemSize.

      +
      +
      +
      +
    • +
    • +
      + + + + shouldContentUpdate(with:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Returns a Bool value indicating whether the content should be reloaded.

      +
      +

      Note

      +

      Unlike Equatable, this doesn’t compare whether the two values + exactly equal. It’s can be ignore property comparisons, if not expect + to reload content.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func shouldContentUpdate(with next: Self) -> Bool
      + +
      +
      +
      +

      Return Value

      +

      A Bool value indicating whether the content should be reloaded.

      +
      +
      +
      +
    • +
    • +
      + + + + shouldRender(next:in:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Returns a Bool value indicating whether component should be render again.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func shouldRender(next: Self, in content: Wrapped.Content) -> Bool
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + next + + +
      +

      The next value to be compared to the receiver.

      +
      +
      + + content + + +
      +

      An instance of content laid out on the element.

      +
      +
      +
      +
      +

      Return Value

      +

      A Bool value indicating whether the component should be render again.

      +
      +
      +
      +
    • +
    • +
      + + + + layout(content:in:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Layout the content on top of element of the list UI.

      +
      +

      Note

      +

      UIView and UIViewController are laid out with edge constraints by default.

      + +
      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func layout(content: Wrapped.Content, in container: UIView)
      + +
      +
      +
      +

      Parameters

      + + + + + + + + + + + +
      + + content + + +
      +

      An instance of content to be laid out on top of element.

      +
      +
      + + container + + +
      +

      A container view to layout content.

      +
      +
      +
      +
      +
      +
    • +
    • +
      + + + + intrinsicContentSize(for:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      The natural size for the passed content.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      func intrinsicContentSize(for content: Wrapped.Content) -> CGSize
      + +
      +
      +
      +

      Return Value

      +

      A CGSize value represents a natural size of the passed content.

      +
      +
      +
      +
    • +
    • +
      + + + + contentWillDisplay(_:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Invoked every time of before a component got into visible area.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func contentWillDisplay(_ content: Wrapped.Content)
      + +
      +
      +
      +
      +
    • +
    • +
      + + + + contentDidEndDisplay(_:) + + + Extension method + +
      +
      +
      +
      +
      +
      +

      Invoked every time of after a component went out from visible area.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      @inlinable
      +func contentDidEndDisplay(_ content: Wrapped.Content)
      + +
      +
    • diff --git a/docs/Protocols/IdentifiableComponent.html b/docs/Protocols/IdentifiableComponent.html index 752b5a9..3f530f9 100644 --- a/docs/Protocols/IdentifiableComponent.html +++ b/docs/Protocols/IdentifiableComponent.html @@ -79,9 +79,6 @@ -
    - - - - - - - - -
    -
    -
      -
    • -
      - - - - init(id:cells:) - -
      -
      -
      -
      -
      -
      -

      Create a section wrapping given id and cells with function builder syntax.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, C>(id: I, @CellsBuilder cells: () -> C) where I : Hashable, C : CellsBuildable
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - cells - - -
      -

      A closure that constructs cells.

      -
      -
      -
      -
      -
      -
    • -
    • - -
      -
      -
      -
      -
      -

      Create a section wrapping given id, header, footer and cells with function builder syntax.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, H, F, C>(id: I, header: H?, footer: F?, @CellsBuilder cells: () -> C) where I : Hashable, H : Component, F : Component, C : CellsBuildable
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - header - - -
      -

      A header component.

      -
      -
      - - footer - - -
      -

      A footer component.

      -
      -
      - - cells - - -
      -

      A closure that constructs cells.

      -
      -
      -
      -
      -
      -
    • -
    • - -
      -
      -
      -
      -
      -

      Create a section wrapping given id, header and footer.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, H, F>(id: I, header: H?, footer: F?) where I : Hashable, H : Component, F : Component
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - header - - -
      -

      A header component.

      -
      -
      - - footer - - -
      -

      A footer component.

      -
      -
      -
      -
      -
      -
    • -
    • - -
      -
      -
      -
      -
      -

      Create a section wrapping given id, header and cells with function builder syntax.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, H>(id: I, header: H?, @CellsBuilder cells: () -> CellsBuildable) where I : Hashable, H : Component
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - header - - -
      -

      A header component.

      -
      -
      - - cells - - -
      -

      A closure that constructs cells.

      -
      -
      -
      -
      -
      -
    • -
    • - -
      -
      -
      -
      -
      -

      Create a section wrapping given id, footer and cells with function builder syntax.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, F, C>(id: I, footer: F?, @CellsBuilder cells: () -> C) where I : Hashable, F : Component, C : CellsBuildable
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - footer - - -
      -

      A footer component.

      -
      -
      - - cells - - -
      -

      A closure that constructs cells.

      -
      -
      -
      -
      -
      -
    • -
    • -
      - - - - init(id:header:) - -
      -
      -
      -
      -
      -
      -

      Create a section wrapping given id and header.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, H>(id: I, header: H?) where I : Hashable, H : Component
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - header - - -
      -

      A header component.

      -
      -
      -
      -
      -
      -
    • -
    • -
      - - - - init(id:footer:) - -
      -
      -
      -
      -
      -
      -

      Create a section wrapping given id and footer.

      - -
      -
      -

      Declaration

      -
      -

      Swift

      -
      @inlinable
      -init<I, F>(id: I, footer: F?) where I : Hashable, F : Component
      - -
      -
      -
      -

      Parameters

      - - - - - - - - - - - -
      - - id - - -
      -

      An identifier to be wrapped.

      -
      -
      - - footer - - -
      -

      A footer component.

      -
      -
      -
      -
      -
      -
    • -
    -
    • diff --git a/docs/Structs/SectionsBuilder.html b/docs/Structs/SectionsBuilder.html index 7e48413..ba29e1c 100644 --- a/docs/Structs/SectionsBuilder.html +++ b/docs/Structs/SectionsBuilder.html @@ -79,9 +79,6 @@
    • -
    - - -