Skip to content

Commit 58962f0

Browse files
Sina-KHLevinIvansceneeWillBishop0x1306a94
authored
Update to v3.2.1 (#2)
* Replace fatal errors in transitionDuration delegate methods (scenee#642) This PR modifies the transitionDuration(using:) method in FloatingPanelController to return 0.0 instead of calling fatalError when the FloatingPanelController instance is not found. This change is crucial for several reasons: 1. Avoiding Crashes in Production: Using fatalError in production can lead to unexpected crashes, which are detrimental to user experience. It's safer to return a default value like 0.0 and handle the scenario gracefully. 2. Improved Stability: By returning 0.0, the application can continue running, allowing for better stability and user satisfaction. This approach also aligns with the principle of fail-safety, where the system continues operating under error conditions. 3. Real-World Case: In our large-scale project, we encountered a crash at this specific point due to the fatalError. Given the size and complexity of our application, it has been challenging to pinpoint the exact cause. Switching to a return value of 0.0 would significantly help us mitigate the issue and maintain app stability while we investigate further. 4. Maintainability: Returning a default value makes the codebase more maintainable and easier to debug, as it avoids abrupt termination and allows for logging or other error handling mechanisms. * Version 2.8.5 * Fix doc comments' errors (scenee#644) * Fix doc comment errors in ObjC APIs * Improve doc comments in LayoutAnchoring.swift * Version 2.8.6 * Disallow interrupting the panel interaction while bouncing over the most expanded state (scenee#652) I decided to disallow interrupting panel interactions while bouncing over the most expanded state in order to fix the 2nd issue in scenee#633, scenee#633 (comment). * Reset `initialScrollOffset` after the attracting animation ends (scenee#659) * Stop pinning the scroll offset in moving programmatically * Add 'optional' string interpolation * Add comments * Add CoreTests.test_initial_scroll_offset_reset() * ci: remove macos-12 jobs for the deprecation * ci: name circleci jobs * ci: use Xcode 16.2 (scenee#653) * Added '--verbose' in cocoapods job * Fixed 'error: No simulator runtime version'. Some of the example apps cannot be built on github actions. > /Users/runner/work/FloatingPanel/FloatingPanel/Examples/Samples/Sources/Assets.xcassets: error: No simulator runtime version from [<DVTBuildVersion 21A342>, <DVTBuildVersion 21C62>, <DVTBuildVersion 21E213>, <DVTBuildVersion 21F79>, <DVTBuildVersion 22B81>] available to use with iphonesimulator SDK version <DVTBuildVersion 22C146> * Used macos-15 to fix random build fails * ci: use macos-15 for all testing to use Xcode 16.2 * Version 2.8.7 * Revert "Disallow interrupting the panel interaction while bouncing over the most expanded state (scenee#652)" This reverts commit b0fd0d4. This change had a problem normal cases. For example, in Maps example a panel interaction jumps occurs because of this. * Allow slight deviation when checking for anchor position. This change addresses the 2nd issue reported in scenee#633. The previous attempt in commit b0fd0d4 was intended to fix this, but it has a regression. This change resolves the issue without introducing any regressions. * Fix a miss spell * Address scenee#661 issue since v2.8.0 (scenee#662) See this comment for more details. scenee#661 (comment) * Version 2.8.8 * ci: add workflow_dispatch event trigger * Update FloatingPanelController * Dump the default config of swift-format on Xcode 16.3 * Lint the library code by built-in swift-format * Ignore project.xcworkspace dir * Update .swift-format * Update the minimum deployment target to iOS 13 * Drop Xcode 13.4.1 support The following errors occur only on Xcode 13.4.1. Addressing them would significantly impair the usability of this library’s API. Therefore, I have decided not to support Xcode 13.4.1. > /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:9:33: error: protocol 'FloatingPanelCoordinator' can only be used as a generic constraint because it has Self or associated type requirements > let coordinator: () -> (any FloatingPanelCoordinator) > ^ > /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:78:42: error: protocol 'FloatingPanelCoordinator' can only be used as a generic constraint because it has Self or associated type requirements > public func makeCoordinator() -> any FloatingPanelCoordinator { > ^ > /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:26:67: error: 'some' types are only implemented for the declared type of properties and subscripts and the return type of functions > @ViewBuilder _ content: @escaping (FloatingPanelProxy) -> some View > ^ > /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:26:9: error: result builder attribute 'ViewBuilder' can only be applied to a parameter of function type > @ViewBuilder _ content: @escaping (FloatingPanelProxy) -> some View > ^ > /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:24:31: error: default argument value of type 'FloatingPanelDefaultCoordinator.Type' cannot be converted to type 'T.Type' > coordinator: T.Type = FloatingPanelDefaultCoordinator.self, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > as! T.Type > /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:28:9: error: generic parameter 'ContentView' could not be inferred > FloatingPanelView( > ^ > /.../FloatingPanel/Sources/SwiftUI/FloatingPanelView.swift:8:49: note: 'ContentView' declared as parameter to type 'FloatingPanelView' > public struct FloatingPanelView<MainView: View, ContentView: View>: UIViewControllerRepresentable { > ^ > /.../FloatingPanel/Sources/SwiftUI/View+floatingPanel.swift:28:9: note: explicitly specify the generic arguments to fix this issue > FloatingPanelView( > ^ > <Self, <#ContentView: View#>> * Expand timeout for some test cases in {Controller,Core}Tests * Implement SwiftUI APIs based on the Maps-SwiftUI app * Added SamplesSwiftUI * Moved Maps-SwiftUI project in workspace * Updated build tools * Fixed xcode 15.1 build * Added FloatingPanel.SurfaceAppearance.box() * Polish source code of CoreTests a bit * Take care of file paths including non-ASCII chars in SwiftFormatBuildToolPlugin * Add .xcodesamplecode.plist * Move 'assets' folder in 'Documentation' folder * Update documentation for the new SwiftUI APIs * Added 'FloatingPanel SwiftUI API Guide' * Updated README * ci: update example builds * ci: fix swift 5.9 and 5.10 builds * ci: use Xcode 16.3 and iOS 18.4 * Add CHANGELOG * Version 3.0.0 * Modify the top page of the DocC * Improve CoreTests a bit * ci: fix the build environments * Fix the pod spec for the SwiftUI APIs * Version 3.0.1 * ci: remove builds using deprecated 'macos-13' machine * Add support for UICornerConfiguration in iOS 26 (scenee#664) * ci: add iOS 26 to test matrix * Pass CoreTests.test_initial_scroll_offset_reset() Since iOS 26, UIGestureRecognizer.state is not able to change even if it's assigned a new value programmatically. Therefore, I created MockPanGestureRecognizer to change the state property in testing. * Fix a build error on Xcode 16 * Fix compilation conditions at c5291d7 * Enable to build it for iOS 12 * Add CoreTests.test_statePublisher * ci: fix a job error * Add 'Star History Chart' at the bottom of README * Set minimum iOS version to v12 * Version 3.1.0 * Support dynamic content updates in SwiftUI Store content hosting controller reference and update it dynamically in updateUIViewController(), allowing panel content to change without recreation. Resolved scenee#672 * Improve SamplesSwiftUI * ci: use Xcode 26.0.1 for all builds * Fix shadow on iOS 26 * examples: fix animation glitch on iOS 26 * Version 3.2.0 * Remove badges from README * ci: fix 'swiftpm' job * Fix scroll offset reset due to floating-point precision errors (scenee#677) When the panel is already at a boundary position, floating-point precision errors on some devices (like iPhone 17 Pro Max) can cause unexpected offset resets in the position calculation. This commit addresses the layout issue where fractional values caused incorrect position evaluation. Based on the initial fix and sample project provided by @0x1306a94. Co-authored-by: 0x1306a94 <onyxes_accent_0a@icloud.com> * Perform view updates during scroll tracking (scenee#679) When we enable floatingPanelScrollTracking on our view inside of the floating panel, some view updates are performed (i.e., SwiftUI views are being instantiated) but no rendering (i.e., body evaluations) occurs. Example code: ```swift content .floatingPanel( coordinator: ContentPanelCoordinator.self, onEvent: onEvent ) { proxy in panelContent .floatingPanelScrollTracking(proxy: proxy) // scroll tracking breaks view updates } ``` We tracked this down to the scroll tracking, and it seems that the performing of view updates inside of the ScrollViewRepresentable was missing. This seems similar to scenee#675. * Version 3.2.1 --------- Co-authored-by: Ivan Levin <100189059+LevinIvan@users.noreply.github.com> Co-authored-by: Shin Yamamoto <shin@scenee.com> Co-authored-by: Will Bishop <17292672+WillBishop@users.noreply.github.com> Co-authored-by: 0x1306a94 <onyxes_accent_0a@icloud.com> Co-authored-by: Sören Gade <gade.soeren@gmail.com>
1 parent 477fd70 commit 58962f0

File tree

68 files changed

+3964
-1236
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

+3964
-1236
lines changed

.circleci/config.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 65 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
name: ci
22

3-
on:
3+
on:
44
push:
5-
branches:
5+
branches:
66
- master
7-
- next
87
pull_request:
9-
branches:
10-
- '*'
8+
branches:
9+
- "*"
10+
workflow_dispatch:
1111

1212
jobs:
1313
build:
@@ -19,17 +19,11 @@ jobs:
1919
matrix:
2020
include:
2121
- swift: "5"
22-
xcode: "16.2"
22+
xcode: "16.4"
2323
runs-on: macos-15
2424
- swift: "5.10"
2525
xcode: "15.4"
2626
runs-on: macos-14
27-
- swift: "5.9"
28-
xcode: "15.2"
29-
runs-on: macos-13
30-
- swift: "5.8"
31-
xcode: "14.3.1"
32-
runs-on: macos-13
3327
steps:
3428
- uses: actions/checkout@v4
3529
- name: Building in Swift ${{ matrix.swift }}
@@ -43,36 +37,36 @@ jobs:
4337
fail-fast: false
4438
matrix:
4539
include:
46-
- os: "18.2"
47-
xcode: "16.2"
40+
- os: "26.0.1"
41+
xcode: "26.0.1"
4842
sim: "iPhone 16 Pro"
49-
parallel: NO # Stop random test job failures
43+
parallel: NO # Stop random test job failures
44+
runs-on: macos-15
45+
- os: "18.5"
46+
xcode: "16.4"
47+
sim: "iPhone 16 Pro"
48+
parallel: NO # Stop random test job failures
5049
runs-on: macos-15
5150
- os: "17.5"
5251
xcode: "15.4"
5352
sim: "iPhone 15 Pro"
54-
parallel: NO # Stop random test job failures
53+
parallel: NO # Stop random test job failures
5554
runs-on: macos-14
56-
- os: "16.4"
57-
xcode: "14.3.1"
58-
sim: "iPhone 14 Pro"
59-
parallel: NO # Stop random test job failures
60-
runs-on: macos-13
6155
steps:
62-
- uses: actions/checkout@v4
63-
- name: Testing in iOS ${{ matrix.os }}
64-
run: |
65-
xcodebuild clean test \
66-
-workspace FloatingPanel.xcworkspace \
67-
-scheme FloatingPanel \
68-
-destination 'platform=iOS Simulator,OS=${{ matrix.os }},name=${{ matrix.sim }}' \
69-
-parallel-testing-enabled '${{ matrix.parallel }}'
56+
- uses: actions/checkout@v4
57+
- name: Testing in iOS ${{ matrix.os }}
58+
run: |
59+
xcodebuild clean test \
60+
-workspace FloatingPanel.xcworkspace \
61+
-scheme FloatingPanel \
62+
-destination 'platform=iOS Simulator,OS=${{ matrix.os }},name=${{ matrix.sim }}' \
63+
-parallel-testing-enabled '${{ matrix.parallel }}'
7064
timeout-minutes: 20
7165

7266
example:
7367
runs-on: macos-15
7468
env:
75-
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
69+
DEVELOPER_DIR: /Applications/Xcode_26.0.1.app/Contents/Developer
7670
strategy:
7771
fail-fast: false
7872
matrix:
@@ -81,82 +75,73 @@ jobs:
8175
- example: "Maps-SwiftUI"
8276
- example: "Stocks"
8377
- example: "Samples"
78+
- example: "SamplesObjC"
79+
- example: "SamplesSwiftUI"
8480
steps:
85-
- uses: actions/checkout@v4
86-
- name: Building ${{ matrix.example }}
87-
# Need to use iphonesimulator18.1 because randomly 18.2<DVTBuildVersion 22C146> isn't available.
88-
run: |
89-
xcodebuild clean build \
90-
-workspace FloatingPanel.xcworkspace \
91-
-scheme ${{ matrix.example }} \
92-
-sdk iphonesimulator
81+
- uses: actions/checkout@v4
82+
- name: Building ${{ matrix.example }}
83+
run: |
84+
xcodebuild clean build \
85+
-workspace FloatingPanel.xcworkspace \
86+
-scheme ${{ matrix.example }} \
87+
-sdk iphonesimulator
9388

9489
swiftpm:
95-
runs-on: macos-15
90+
runs-on: ${{ matrix.runs-on }}
9691
env:
9792
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
9893
strategy:
9994
fail-fast: false
10095
matrix:
101-
xcode: ["16.2", "15.4"]
96+
xcode: ["26.0.1", "16.4", "15.4"]
10297
platform: [iphoneos, iphonesimulator]
10398
arch: [x86_64, arm64]
10499
exclude:
105100
- platform: iphoneos
106101
arch: x86_64
107102
include:
108-
# 18.2
103+
# 26.0.1
109104
- platform: iphoneos
110-
xcode: "16.2"
111-
sys: "ios18.2"
105+
xcode: "26.0.1"
106+
sys: "ios26.0"
107+
runs-on: macos-15
112108
- platform: iphonesimulator
113-
xcode: "16.2"
114-
sys: "ios18.2-simulator"
109+
xcode: "26.0.1"
110+
sys: "ios26.0-simulator"
111+
runs-on: macos-15
112+
# 18.5
113+
- platform: iphoneos
114+
xcode: "16.4"
115+
sys: "ios18.5"
116+
runs-on: macos-15
117+
- platform: iphonesimulator
118+
xcode: "16.4"
119+
sys: "ios18.5-simulator"
120+
runs-on: macos-15
115121
# 17.2
116122
- platform: iphoneos
117123
xcode: "15.4"
118124
sys: "ios17.2"
125+
runs-on: macos-14
119126
- platform: iphonesimulator
120127
xcode: "15.4"
121128
sys: "ios17.2-simulator"
129+
runs-on: macos-14
122130
steps:
123-
- uses: actions/checkout@v4
124-
- name: "Swift Package Manager build"
125-
run: |
126-
xcrun swift build \
127-
--sdk "$(xcrun --sdk ${{ matrix.platform }} --show-sdk-path)" \
128-
-Xswiftc "-target" -Xswiftc "${{ matrix.arch }}-apple-${{ matrix.sys }}"
129-
130-
swiftpm_old:
131-
runs-on: ${{ matrix.runs-on }}
132-
env:
133-
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
134-
strategy:
135-
fail-fast: false
136-
matrix:
137-
include:
138-
# 16.4
139-
- target: "x86_64-apple-ios16.4-simulator"
140-
xcode: "14.3.1"
141-
runs-on: macos-13
142-
- target: "arm64-apple-ios16.4-simulator"
143-
xcode: "14.3.1"
144-
runs-on: macos-13
145-
steps:
146-
- uses: actions/checkout@v4
147-
- name: "Swift Package Manager build"
148-
run: |
149-
swift build \
150-
-Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" \
151-
-Xswiftc "-target" -Xswiftc "${{ matrix.target }}"
131+
- uses: actions/checkout@v4
132+
- name: "Swift Package Manager build"
133+
run: |
134+
xcrun swift build \
135+
--sdk "$(xcrun --sdk ${{ matrix.platform }} --show-sdk-path)" \
136+
-Xswiftc "-target" -Xswiftc "${{ matrix.arch }}-apple-${{ matrix.sys }}"
152137

153138
cocoapods:
154139
runs-on: macos-15
155140
env:
156-
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
141+
DEVELOPER_DIR: /Applications/Xcode_26.0.1.app/Contents/Developer
157142
steps:
158-
- uses: actions/checkout@v4
159-
- name: "CocoaPods: pod lib lint"
160-
run: pod lib lint --allow-warnings --verbose
161-
- name: "CocoaPods: pod spec lint"
162-
run: pod spec lint --allow-warnings --verbose
143+
- uses: actions/checkout@v4
144+
- name: "CocoaPods: pod lib lint"
145+
run: pod lib lint --allow-warnings --verbose
146+
- name: "CocoaPods: pod spec lint"
147+
run: pod spec lint --allow-warnings --verbose

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ DerivedData/
1818
!default.perspectivev3
1919
xcuserdata/
2020
IDEWorkspaceChecks.plis
21+
*.xcodeproj/project.xcworkspace
2122

2223
## Other
2324
*.moved-aside

.swift-format

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"fileScopedDeclarationPrivacy" : {
3+
"accessLevel" : "private"
4+
},
5+
"indentConditionalCompilationBlocks" : false,
6+
"indentSwitchCaseLabels" : false,
7+
"indentation" : {
8+
"spaces" : 4
9+
},
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
14+
"lineBreakBetweenDeclarationAttributes" : false,
15+
"lineLength" : 120,
16+
"maximumBlankLines" : 1,
17+
"multiElementCollectionTrailingCommas" : true,
18+
"noAssignmentInExpressions" : {
19+
"allowedFunctions" : [
20+
"XCTAssertNoThrow"
21+
]
22+
},
23+
"prioritizeKeepingFunctionOutputTogether" : false,
24+
"reflowMultilineStringLiterals" : {
25+
"never" : {
26+
27+
}
28+
},
29+
"respectsExistingLineBreaks" : true,
30+
"rules" : {
31+
"AllPublicDeclarationsHaveDocumentation" : false,
32+
"AlwaysUseLiteralForEmptyCollectionInit" : false,
33+
"AlwaysUseLowerCamelCase" : true,
34+
"AmbiguousTrailingClosureOverload" : true,
35+
"AvoidRetroactiveConformances" : true,
36+
"BeginDocumentationCommentWithOneLineSummary" : false,
37+
"DoNotUseSemicolons" : true,
38+
"DontRepeatTypeInStaticProperties" : true,
39+
"FileScopedDeclarationPrivacy" : true,
40+
"FullyIndirectEnum" : true,
41+
"GroupNumericLiterals" : true,
42+
"IdentifiersMustBeASCII" : true,
43+
"NeverForceUnwrap" : false,
44+
"NeverUseForceTry" : false,
45+
"NeverUseImplicitlyUnwrappedOptionals" : false,
46+
"NoAccessLevelOnExtensionDeclaration" : true,
47+
"NoAssignmentInExpressions" : true,
48+
"NoBlockComments" : true,
49+
"NoCasesWithOnlyFallthrough" : true,
50+
"NoEmptyLinesOpeningClosingBraces" : false,
51+
"NoEmptyTrailingClosureParentheses" : true,
52+
"NoLabelsInCasePatterns" : true,
53+
"NoLeadingUnderscores" : false,
54+
"NoParensAroundConditions" : true,
55+
"NoPlaygroundLiterals" : true,
56+
"NoVoidReturnOnFunctionSignature" : true,
57+
"OmitExplicitReturns" : false,
58+
"OneCasePerLine" : true,
59+
"OneVariableDeclarationPerLine" : true,
60+
"OnlyOneTrailingClosureArgument" : true,
61+
"OrderedImports" : true,
62+
"ReplaceForEachWithForLoop" : true,
63+
"ReturnVoidInsteadOfEmptyTuple" : true,
64+
"TypeNamesShouldBeCapitalized" : true,
65+
"UseEarlyExits" : false,
66+
"UseExplicitNilCheckInConditions" : true,
67+
"UseLetInEveryBoundCaseVariable" : true,
68+
"UseShorthandTypeNames" : true,
69+
"UseSingleLinePropertyGetter" : true,
70+
"UseSynthesizedInitializer" : true,
71+
"UseTripleSlashForDocumentationComments" : true,
72+
"UseWhereClausesInForLoops" : false,
73+
"ValidateDocumentationComments" : false
74+
},
75+
"spacesAroundRangeFormationOperators" : false,
76+
"spacesBeforeEndOfLineComments" : 2,
77+
"tabWidth" : 8,
78+
"version" : 1
79+
}

BuildTools/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
xcuserdata/
5+
DerivedData/
6+
.swiftpm/configuration/registries.json
7+
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
8+
.netrc
9+

BuildTools/Package.swift

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// swift-tools-version: 6.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "build-tools",
7+
products: [
8+
.plugin(
9+
name: "swift-format-plugin",
10+
targets: ["swift-format-plugin"]
11+
)
12+
],
13+
targets: [
14+
.plugin(
15+
name: "swift-format-plugin",
16+
capability: .buildTool()
17+
)
18+
]
19+
)

BuildTools/Package@swift-5.9.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// swift-tools-version: 5.9
2+
// This file is used when the 'built-tools' package is built by Xcode 15 or earlier.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "build-tools",
8+
products: [
9+
.plugin(
10+
name: "swift-format-plugin",
11+
targets: ["swift-format-plugin"]
12+
)
13+
],
14+
targets: [
15+
.plugin(
16+
name: "swift-format-plugin",
17+
capability: .buildTool()
18+
)
19+
]
20+
)

0 commit comments

Comments
 (0)