Skip to content

Commit 477fd70

Browse files
Sina-KHLevinIvanscenee
authored
Update to v2.8.8 (#1)
* 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 * Fixed WKWebView scroll issues * Fixed scrolling issue when two scrollable content where pushed on each other and transition was not completed yet. * Prevent simultaniously scrolling the FloatingPanel in two directions. * Prevent unwanted scroll scenarios on NBS, if _innerScrollView should catch the panGesture. * Lock all the scroll-views on animations * Ignore small scroll-view touches and do NOT pass them to outer scroll-view. * Consider inner scroll-view as modal gesture handler scroll-view if it's with is larger than `parentWidth - 32` instead of `parentWidth` * Fixed unwanted scroll-view locks * Added passthroughView to let presented view controller pass touches to the previous view controller when view is totally hidden --------- Co-authored-by: Ivan Levin <100189059+LevinIvan@users.noreply.github.com> Co-authored-by: Shin Yamamoto <shin@scenee.com>
1 parent f58a8b9 commit 477fd70

File tree

13 files changed

+229
-77
lines changed

13 files changed

+229
-77
lines changed

.circleci/config.yml

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
11
version: 2.1
22

33
jobs:
4+
build-swift_5_7:
5+
macos:
6+
xcode: 13.4.1
7+
steps:
8+
- checkout
9+
- run: xcodebuild -scheme FloatingPanel -workspace FloatingPanel.xcworkspace SWIFT_VERSION=5.7 clean build
10+
11+
build-swiftpm_ios15_7:
12+
macos:
13+
xcode: 13.4.1
14+
steps:
15+
- checkout
16+
- run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.7-simulator"
17+
- run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "arm64-apple-ios15.7-simulator"
18+
19+
test-ios15_5-iPhone_13_Pro:
20+
macos:
21+
xcode: 13.4.1
22+
steps:
23+
- checkout
24+
- run: xcodebuild clean test -scheme FloatingPanel -workspace FloatingPanel.xcworkspace -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13 Pro'
425
test-ios14_5-iPhone_12_Pro:
526
macos:
627
xcode: 13.4.1
728
steps:
829
- checkout
930
- run: xcodebuild clean test -scheme FloatingPanel -workspace FloatingPanel.xcworkspace -destination 'platform=iOS Simulator,OS=14.5,name=iPhone 12 Pro'
1031

32+
1133
workflows:
1234
test:
1335
jobs:
14-
- test-ios14_5-iPhone_12_Pro
36+
- build-swift_5_7:
37+
name: build (5.7, 13.4.1)
38+
- build-swiftpm_ios15_7:
39+
name: swiftpm ({x86_64,arm64}-apple-ios15.5-simulator, 13.4.1)
40+
- test-ios14_5-iPhone_12_Pro:
41+
name: test (15.5, 13.4.1, iPhone 12 Pro)
42+
- test-ios15_5-iPhone_13_Pro:
43+
name: test (14.5, 13.4.1, iPhone 13 Pro)

.github/workflows/ci.yml

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
include:
21+
- swift: "5"
22+
xcode: "16.2"
23+
runs-on: macos-15
2124
- swift: "5.10"
2225
xcode: "15.4"
2326
runs-on: macos-14
@@ -27,15 +30,6 @@ jobs:
2730
- swift: "5.8"
2831
xcode: "14.3.1"
2932
runs-on: macos-13
30-
- swift: "5.7"
31-
xcode: "14.1"
32-
runs-on: macos-12
33-
- swift: "5.6"
34-
xcode: "13.4.1"
35-
runs-on: macos-12
36-
- swift: "5.5"
37-
xcode: "13.2.1"
38-
runs-on: macos-12
3933
steps:
4034
- uses: actions/checkout@v4
4135
- name: Building in Swift ${{ matrix.swift }}
@@ -49,6 +43,11 @@ jobs:
4943
fail-fast: false
5044
matrix:
5145
include:
46+
- os: "18.2"
47+
xcode: "16.2"
48+
sim: "iPhone 16 Pro"
49+
parallel: NO # Stop random test job failures
50+
runs-on: macos-15
5251
- os: "17.5"
5352
xcode: "15.4"
5453
sim: "iPhone 15 Pro"
@@ -59,11 +58,6 @@ jobs:
5958
sim: "iPhone 14 Pro"
6059
parallel: NO # Stop random test job failures
6160
runs-on: macos-13
62-
- os: "15.5"
63-
xcode: "13.4.1"
64-
sim: "iPhone 13 Pro"
65-
parallel: NO # Stop random test job failures
66-
runs-on: macos-12
6761
steps:
6862
- uses: actions/checkout@v4
6963
- name: Testing in iOS ${{ matrix.os }}
@@ -76,9 +70,9 @@ jobs:
7670
timeout-minutes: 20
7771

7872
example:
79-
runs-on: macos-14
73+
runs-on: macos-15
8074
env:
81-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
75+
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
8276
strategy:
8377
fail-fast: false
8478
matrix:
@@ -90,29 +84,40 @@ jobs:
9084
steps:
9185
- uses: actions/checkout@v4
9286
- name: Building ${{ matrix.example }}
87+
# Need to use iphonesimulator18.1 because randomly 18.2<DVTBuildVersion 22C146> isn't available.
9388
run: |
9489
xcodebuild clean build \
9590
-workspace FloatingPanel.xcworkspace \
9691
-scheme ${{ matrix.example }} \
9792
-sdk iphonesimulator
9893
9994
swiftpm:
100-
runs-on: macos-14
95+
runs-on: macos-15
10196
env:
102-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
97+
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
10398
strategy:
10499
fail-fast: false
105100
matrix:
101+
xcode: ["16.2", "15.4"]
106102
platform: [iphoneos, iphonesimulator]
107103
arch: [x86_64, arm64]
108104
exclude:
109105
- platform: iphoneos
110106
arch: x86_64
111107
include:
108+
# 18.2
109+
- platform: iphoneos
110+
xcode: "16.2"
111+
sys: "ios18.2"
112+
- platform: iphonesimulator
113+
xcode: "16.2"
114+
sys: "ios18.2-simulator"
112115
# 17.2
113116
- platform: iphoneos
117+
xcode: "15.4"
114118
sys: "ios17.2"
115119
- platform: iphonesimulator
120+
xcode: "15.4"
116121
sys: "ios17.2-simulator"
117122
steps:
118123
- uses: actions/checkout@v4
@@ -137,13 +142,6 @@ jobs:
137142
- target: "arm64-apple-ios16.4-simulator"
138143
xcode: "14.3.1"
139144
runs-on: macos-13
140-
# 15.7
141-
- target: "x86_64-apple-ios15.7-simulator"
142-
xcode: "14.1"
143-
runs-on: macos-12
144-
- target: "arm64-apple-ios15.7-simulator"
145-
xcode: "14.1"
146-
runs-on: macos-12
147145
steps:
148146
- uses: actions/checkout@v4
149147
- name: "Swift Package Manager build"
@@ -153,12 +151,12 @@ jobs:
153151
-Xswiftc "-target" -Xswiftc "${{ matrix.target }}"
154152
155153
cocoapods:
156-
runs-on: macos-14
154+
runs-on: macos-15
157155
env:
158-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
156+
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
159157
steps:
160158
- uses: actions/checkout@v4
161159
- name: "CocoaPods: pod lib lint"
162-
run: pod lib lint --allow-warnings
160+
run: pod lib lint --allow-warnings --verbose
163161
- name: "CocoaPods: pod spec lint"
164-
run: pod spec lint --allow-warnings
162+
run: pod spec lint --allow-warnings --verbose

Examples/Samples/Sources/PanelLayouts.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,18 @@ class ModalPanelLayout: FloatingPanelLayout {
7676
return 0.3
7777
}
7878
}
79+
80+
class ModalPanelLayout2: FloatingPanelLayout {
81+
let position: FloatingPanelPosition = .bottom
82+
let initialState: FloatingPanelState = .half
83+
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] {
84+
[
85+
.full: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .superview),
86+
.half: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .superview)
87+
]
88+
}
89+
func backdropAlpha(for _: FloatingPanelState) -> CGFloat {
90+
0.6
91+
}
92+
}
93+

Examples/Samples/Sources/UseCases/UseCase.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ enum UseCase: Int, CaseIterable {
99
case showDetail
1010
case showModal
1111
case showPanelModal
12+
case showPanelModal2
1213
case showMultiPanelModal
1314
case showPanelInSheetModal
1415
case showOnWindow
@@ -39,6 +40,7 @@ extension UseCase {
3940
case .showDetail: return "Show Detail Panel"
4041
case .showModal: return "Show Modal"
4142
case .showPanelModal: return "Show Panel Modal"
43+
case .showPanelModal2: return "Show Panel Modal 2"
4244
case .showMultiPanelModal: return "Show Multi Panel Modal"
4345
case .showOnWindow: return "Show Panel over Window"
4446
case .showPanelInSheetModal: return "Show Panel in Sheet Modal"
@@ -81,10 +83,11 @@ extension UseCase {
8183
case .trackingTextView: return .storyboard("ConsoleViewController") // Storyboard only
8284
case .showDetail: return .storyboard(String(describing: DetailViewController.self))
8385
case .showModal: return .storyboard(String(describing: ModalViewController.self))
86+
case .showPanelModal: return .viewController(DebugTableViewController())
87+
case .showPanelModal2: return .storyboard("ConsoleViewController")
8488
case .showMultiPanelModal: return .viewController(DebugTableViewController())
8589
case .showOnWindow: return .viewController(DebugTableViewController())
8690
case .showPanelInSheetModal: return .viewController(DebugTableViewController())
87-
case .showPanelModal: return .viewController(DebugTableViewController())
8891
case .showTabBar: return .storyboard(String(describing: TabBarViewController.self))
8992
case .showPageView: return .viewController(DebugTableViewController())
9093
case .showPageContentView: return .viewController(DebugTableViewController())

Examples/Samples/Sources/UseCases/UseCaseController.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,14 @@ extension UseCaseController {
178178

179179
mainVC.present(fpc, animated: true, completion: nil)
180180

181+
case .showPanelModal2:
182+
let fpc = FloatingPanelController()
183+
fpc.set(contentViewController: contentVC)
184+
fpc.delegate = self
185+
fpc.track(scrollView: (contentVC as? DebugTextViewController)!.textView)
186+
187+
mainVC.present(fpc, animated: true, completion: nil)
188+
181189
case .showMultiPanelModal:
182190
let fpc = MultiPanelController()
183191
mainVC.present(fpc, animated: true, completion: nil)
@@ -202,10 +210,10 @@ extension UseCaseController {
202210
fpc.set(contentViewController: contentVC)
203211
fpc.delegate = self
204212

205-
let apprearance = SurfaceAppearance()
206-
apprearance.cornerRadius = 38.5
207-
apprearance.shadows = []
208-
fpc.surfaceView.appearance = apprearance
213+
let appearance = SurfaceAppearance()
214+
appearance.cornerRadius = 38.5
215+
appearance.shadows = []
216+
fpc.surfaceView.appearance = appearance
209217
fpc.isRemovalInteractionEnabled = true
210218

211219
let mvc = UIViewController()
@@ -435,6 +443,8 @@ extension UseCaseController: FloatingPanelControllerDelegate {
435443
return newCollection.verticalSizeClass == .compact ? RemovablePanelLandscapeLayout() : RemovablePanelLayout()
436444
case .showIntrinsicView:
437445
return IntrinsicPanelLayout()
446+
case .showPanelModal2:
447+
return ModalPanelLayout2()
438448
case .showPanelModal:
439449
if vc != mainPanelVC && vc != detailPanelVC {
440450
return ModalPanelLayout()

FloatingPanel.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
Pod::Spec.new do |s|
22

33
s.name = "FloatingPanel"
4-
s.version = "2.8.4"
4+
s.version = "2.8.8"
55
s.summary = "FloatingPanel is a clean and easy-to-use UI component of a floating panel interface."
66
s.description = <<-DESC
77
FloatingPanel is a clean and easy-to-use UI component for a new interface introduced in Apple Maps, Shortcuts and Stocks app.
88
The new interface displays the related contents and utilities in parallel as a user wants.
99
DESC
1010
s.homepage = "https://github.com/scenee/FloatingPanel"
1111
s.author = "Shin Yamamoto"
12-
s.social_media_url = "https://twitter.com/scenee"
12+
s.social_media_url = "https://x.com/scenee"
1313

1414
s.platform = :ios, "11.0"
1515
s.source = { :git => "https://github.com/scenee/FloatingPanel.git", :tag => s.version.to_s }

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
FloatingPanel is a simple and easy-to-use UI component designed for a user interface featured in Apple Maps, Shortcuts and Stocks app.
99
The user interface displays related content and utilities alongside the main content.
1010

11-
Please see also [the API reference@SPI](https://swiftpackageindex.com/scenee/FloatingPanel/2.8.4/documentation/floatingpanel) for more details.
11+
Please see also [the API reference@SPI](https://swiftpackageindex.com/scenee/FloatingPanel/2.8.8/documentation/floatingpanel) for more details.
1212

1313
![Maps](https://github.com/SCENEE/FloatingPanel/blob/master/assets/maps.gif)
1414
![Stocks](https://github.com/SCENEE/FloatingPanel/blob/master/assets/stocks.gif)

0 commit comments

Comments
 (0)