Skip to content

Commit 57db8c9

Browse files
authored
Merge pull request #63 from ra1028/rc6
Add weak link SwiftUI framework
2 parents d697d02 + b554c1a commit 57db8c9

File tree

68 files changed

+597
-799
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+597
-799
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ jobs:
77
strategy:
88
fail-fast: false
99
matrix:
10-
xcode_version: ["10.2", "11.1"]
10+
xcode_version:
11+
- 11.1
12+
destination:
13+
- platform=iOS Simulator,name=iPhone 11 Pro,OS=13.1
14+
- platform=iOS Simulator,name=iPhone SE,OS=10.0
1115
env:
1216
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
1317
steps:
@@ -18,6 +22,6 @@ jobs:
1822
run: |
1923
swift --version
2024
xcodebuild -version
21-
- name: Test iOS on Xcode ${{ matrix.xcode_version }}
25+
- name: Test iOS on Xcode ${{ matrix.xcode_version }} simulator ${{ matrix.destination }}
2226
run: |
23-
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
27+
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

.swift-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0
1+
5.1

.swiftlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type_body_length:
2525
warning: 400
2626

2727
function_body_length:
28-
warning: 50
28+
warning: 60
2929

3030
cyclomatic_complexity:
3131
warning: 12

Carbon.podspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |spec|
22
spec.name = 'Carbon'
3-
spec.version = '1.0.0-rc.5'
3+
spec.version = '1.0.0-rc.6'
44
spec.author = { 'ra1028' => '[email protected]' }
55
spec.homepage = 'https://github.com/ra1028/Carbon'
66
spec.documentation_url = 'https://ra1028.github.io/Carbon'
@@ -9,8 +9,9 @@ Pod::Spec.new do |spec|
99
spec.source_files = 'Sources/**/*.swift'
1010
spec.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
1111
spec.requires_arc = true
12-
spec.swift_versions = ['5.0', '5.1']
12+
spec.swift_versions = ['5.1']
1313
spec.ios.deployment_target = '10.0'
1414
spec.dependency 'DifferenceKit/Core', "~> 1.1"
1515
spec.ios.frameworks = 'UIKit'
16+
spec.ios.weak_frameworks = 'SwiftUI'
1617
end

Carbon.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@
767767
"@executable_path/Frameworks",
768768
"@loader_path/Frameworks",
769769
);
770-
OTHER_LDFLAGS = "";
770+
OTHER_LDFLAGS = "$(inherited)";
771771
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Carbon;
772772
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
773773
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -798,7 +798,7 @@
798798
"@executable_path/Frameworks",
799799
"@loader_path/Frameworks",
800800
);
801-
OTHER_LDFLAGS = "";
801+
OTHER_LDFLAGS = "$(inherited)";
802802
PRODUCT_BUNDLE_IDENTIFIER = com.ryo.Carbon;
803803
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
804804
PROVISIONING_PROFILE_SPECIFIER = "";

Carbon.xcodeproj/xcshareddata/xcschemes/Carbon.xcscheme

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
30+
<MacroExpansion>
31+
<BuildableReference
32+
BuildableIdentifier = "primary"
33+
BlueprintIdentifier = "6B65947921E252E300291AAF"
34+
BuildableName = "Carbon.framework"
35+
BlueprintName = "Carbon"
36+
ReferencedContainer = "container:Carbon.xcodeproj">
37+
</BuildableReference>
38+
</MacroExpansion>
3039
<Testables>
3140
<TestableReference
3241
skipped = "NO">
@@ -39,17 +48,6 @@
3948
</BuildableReference>
4049
</TestableReference>
4150
</Testables>
42-
<MacroExpansion>
43-
<BuildableReference
44-
BuildableIdentifier = "primary"
45-
BlueprintIdentifier = "6B65947921E252E300291AAF"
46-
BuildableName = "Carbon.framework"
47-
BlueprintName = "Carbon"
48-
ReferencedContainer = "container:Carbon.xcodeproj">
49-
</BuildableReference>
50-
</MacroExpansion>
51-
<AdditionalOptions>
52-
</AdditionalOptions>
5351
</TestAction>
5452
<LaunchAction
5553
buildConfiguration = "Debug"
@@ -70,8 +68,6 @@
7068
ReferencedContainer = "container:Carbon.xcodeproj">
7169
</BuildableReference>
7270
</MacroExpansion>
73-
<AdditionalOptions>
74-
</AdditionalOptions>
7571
</LaunchAction>
7672
<ProfileAction
7773
buildConfiguration = "Release"

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ in UITableView and UICollectionView.</br>
1919
<a href="https://github.com/Carthage/Carthage"><img alt="Carthage" src="https://img.shields.io/badge/carthage-compatible-yellow.svg"/></a>
2020
</br>
2121
<a href="https://github.com/ra1028/Carbon/actions"><img alt="CI Status" src="https://github.com/ra1028/Carbon/workflows/GitHub%20Actions/badge.svg"/></a>
22-
<a href="https://developer.apple.com/swift"><img alt="Swift5" src="https://img.shields.io/badge/language-Swift5-orange.svg"/></a>
22+
<a href="https://developer.apple.com/swift"><img alt="Swift 5.1" src="https://img.shields.io/badge/language-Swift 5.1-orange.svg"/></a>
2323
<a href="https://developer.apple.com/"><img alt="Platform" src="https://img.shields.io/badge/platform-iOS-green.svg"/></a>
2424
<a href="https://github.com/ra1028/Carbon/blob/master/LICENSE"><img alt="Lincense" src="https://img.shields.io/badge/License-Apache%202.0-black.svg"/></a>
2525
</p>
@@ -271,7 +271,7 @@ renderer.render {
271271

272272
<H3 align="center">
273273
<a href="https://ra1028.github.io/Carbon">[See More Usage]</a>
274-
<a href="https://github.com/ra1028/Carbon/tree/declarative/Examples/Example-iOS">[See Example App]</a>
274+
<a href="https://github.com/ra1028/Carbon/tree/master/Examples/Example-iOS">[See Example App]</a>
275275
</H3>
276276

277277
---
@@ -522,7 +522,7 @@ Default is `true`.
522522

523523
### Without FunctionBuilder Syntax
524524

525-
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.
525+
Carbon can also build a UI with declarative syntax without function builder as following.
526526

527527
- **ViewNode**
528528

@@ -567,10 +567,8 @@ renderer.render(
567567

568568
## Requirements
569569

570-
- Swift 5.0+
571-
- Xcode 10.2+
572-
573-
Note: function builder syntax requires Swift5.1+ and Xcode 11.0+
570+
- Swift 5.1+
571+
- Xcode 11.0+
574572

575573
---
576574

@@ -589,7 +587,7 @@ github "ra1028/Carbon"
589587
```
590588

591589
### [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app)
592-
Select Xcode menu File > Swift Packages > Add Package Dependency and enter repository URL with GUI.
590+
Select Xcode menu `File > Swift Packages > Add Package Dependency...` and enter repository URL with GUI.
593591
```
594592
Repository: https://github.com/ra1028/Carbon
595593
```

Sources/ComponentWrapper/ComponentWrapping.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import UIKit
22

3-
#if swift(>=5.1)
4-
53
/// Represents a wrapper of component that forwards all actions to wrapped component.
64
/// You can easily conform arbitrary type to `Component` protocol by wrapping component instance.
75
@dynamicMemberLookup
@@ -21,20 +19,6 @@ public extension ComponentWrapping {
2119
}
2220
}
2321

24-
#else
25-
26-
/// Represents a wrapper of component that forwards all actions to wrapped component.
27-
/// You can easily conform arbitrary type to `Component` protocol by wrapping component instance.
28-
public protocol ComponentWrapping: Component {
29-
/// The type of wrapped component.
30-
associatedtype Wrapped: Component
31-
32-
/// The wrapped component instance.
33-
var wrapped: Wrapped { get }
34-
}
35-
36-
#endif
37-
3822
public extension ComponentWrapping {
3923
/// A string used to identify a element that is reusable. Default is the type name of `self`.
4024
@inlinable

Sources/FunctionBuilder/CellsBuilder.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#if swift(>=5.1)
2-
31
// swiftlint:disable line_length
42
// swiftlint:disable function_parameter_count
53

@@ -174,5 +172,3 @@ internal extension CellsBuilder {
174172
cellNodes = cellNodes0 + cellNodes1 + cellNodes2 + c9.buildCells()
175173
}
176174
}
177-
178-
#endif

Sources/FunctionBuilder/Group.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#if swift(>=5.1)
2-
31
/// An affordance for grouping component or section.
42
///
53
/// Example for simple grouping of cells.
@@ -82,5 +80,3 @@ extension Group: SectionsBuildable where Element == Section {
8280
elements
8381
}
8482
}
85-
86-
#endif

0 commit comments

Comments
 (0)