Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0e27410
Replace fatal errors in transitionDuration delegate methods (#642)
LevinIvan Aug 5, 2024
71f419a
Version 2.8.5
scenee Aug 5, 2024
3a3d534
Fix doc comments' errors (#644)
scenee Sep 6, 2024
b6e8928
Version 2.8.6
scenee Sep 7, 2024
b0fd0d4
Disallow interrupting the panel interaction while bouncing over the m…
scenee Nov 9, 2024
479cce4
Reset `initialScrollOffset` after the attracting animation ends (#659)
scenee Mar 7, 2025
370e306
ci: use Xcode 16.2 (#653)
scenee Mar 7, 2025
9592baa
ci: use macos-15 for all testing to use Xcode 16.2
scenee Mar 13, 2025
a1f20ce
Version 2.8.7
scenee Apr 5, 2025
dd49fde
Revert "Disallow interrupting the panel interaction while bouncing ov…
scenee Apr 21, 2025
afff000
Allow slight deviation when checking for anchor position.
scenee Apr 21, 2025
dfa9a77
Fix a miss spell
scenee Apr 21, 2025
09f9036
Address #661 issue since v2.8.0 (#662)
scenee Apr 22, 2025
1d2e3a0
Version 2.8.8
scenee Apr 22, 2025
2e8a0f3
Fixed WKWebView scroll issues
Sina-KH Jun 17, 2024
107229d
Fixed scrolling issue when two scrollable content where pushed on eac…
Sina-KH Jun 19, 2024
0a21396
Prevent simultaniously scrolling the FloatingPanel in two directions.
Sina-KH Jun 19, 2024
75d162b
Prevent unwanted scroll scenarios on NBS, if _innerScrollView should …
Sina-KH Jun 20, 2024
edd74fc
Lock all the scroll-views on animations
Sina-KH Jun 20, 2024
4595ece
Ignore small scroll-view touches and do NOT pass them to outer scroll…
Sina-KH Jul 8, 2024
fa94043
Consider inner scroll-view as modal gesture handler scroll-view if it…
Sina-KH Sep 20, 2024
6f6cd7f
Fixed unwanted scroll-view locks
Sina-KH Oct 10, 2024
242a050
Added passthroughView to let presented view controller pass touches t…
Sina-KH Oct 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
version: 2.1

jobs:
build-swift_5_7:
macos:
xcode: 13.4.1
steps:
- checkout
- run: xcodebuild -scheme FloatingPanel -workspace FloatingPanel.xcworkspace SWIFT_VERSION=5.7 clean build

build-swiftpm_ios15_7:
macos:
xcode: 13.4.1
steps:
- checkout
- run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios15.7-simulator"
- run: swift build -Xswiftc "-sdk" -Xswiftc "`xcrun --sdk iphonesimulator --show-sdk-path`" -Xswiftc "-target" -Xswiftc "arm64-apple-ios15.7-simulator"

test-ios15_5-iPhone_13_Pro:
macos:
xcode: 13.4.1
steps:
- checkout
- run: xcodebuild clean test -scheme FloatingPanel -workspace FloatingPanel.xcworkspace -destination 'platform=iOS Simulator,OS=15.5,name=iPhone 13 Pro'
test-ios14_5-iPhone_12_Pro:
macos:
xcode: 13.4.1
steps:
- checkout
- run: xcodebuild clean test -scheme FloatingPanel -workspace FloatingPanel.xcworkspace -destination 'platform=iOS Simulator,OS=14.5,name=iPhone 12 Pro'


workflows:
test:
jobs:
- test-ios14_5-iPhone_12_Pro
- build-swift_5_7:
name: build (5.7, 13.4.1)
- build-swiftpm_ios15_7:
name: swiftpm ({x86_64,arm64}-apple-ios15.5-simulator, 13.4.1)
- test-ios14_5-iPhone_12_Pro:
name: test (15.5, 13.4.1, iPhone 12 Pro)
- test-ios15_5-iPhone_13_Pro:
name: test (14.5, 13.4.1, iPhone 13 Pro)
56 changes: 27 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
fail-fast: false
matrix:
include:
- swift: "5"
xcode: "16.2"
runs-on: macos-15
- swift: "5.10"
xcode: "15.4"
runs-on: macos-14
Expand All @@ -27,15 +30,6 @@ jobs:
- swift: "5.8"
xcode: "14.3.1"
runs-on: macos-13
- swift: "5.7"
xcode: "14.1"
runs-on: macos-12
- swift: "5.6"
xcode: "13.4.1"
runs-on: macos-12
- swift: "5.5"
xcode: "13.2.1"
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Building in Swift ${{ matrix.swift }}
Expand All @@ -49,6 +43,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: "18.2"
xcode: "16.2"
sim: "iPhone 16 Pro"
parallel: NO # Stop random test job failures
runs-on: macos-15
- os: "17.5"
xcode: "15.4"
sim: "iPhone 15 Pro"
Expand All @@ -59,11 +58,6 @@ jobs:
sim: "iPhone 14 Pro"
parallel: NO # Stop random test job failures
runs-on: macos-13
- os: "15.5"
xcode: "13.4.1"
sim: "iPhone 13 Pro"
parallel: NO # Stop random test job failures
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: Testing in iOS ${{ matrix.os }}
Expand All @@ -76,9 +70,9 @@ jobs:
timeout-minutes: 20

example:
runs-on: macos-14
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
strategy:
fail-fast: false
matrix:
Expand All @@ -90,29 +84,40 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Building ${{ matrix.example }}
# Need to use iphonesimulator18.1 because randomly 18.2<DVTBuildVersion 22C146> isn't available.
run: |
xcodebuild clean build \
-workspace FloatingPanel.xcworkspace \
-scheme ${{ matrix.example }} \
-sdk iphonesimulator

swiftpm:
runs-on: macos-14
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
strategy:
fail-fast: false
matrix:
xcode: ["16.2", "15.4"]
platform: [iphoneos, iphonesimulator]
arch: [x86_64, arm64]
exclude:
- platform: iphoneos
arch: x86_64
include:
# 18.2
- platform: iphoneos
xcode: "16.2"
sys: "ios18.2"
- platform: iphonesimulator
xcode: "16.2"
sys: "ios18.2-simulator"
# 17.2
- platform: iphoneos
xcode: "15.4"
sys: "ios17.2"
- platform: iphonesimulator
xcode: "15.4"
sys: "ios17.2-simulator"
steps:
- uses: actions/checkout@v4
Expand All @@ -137,13 +142,6 @@ jobs:
- target: "arm64-apple-ios16.4-simulator"
xcode: "14.3.1"
runs-on: macos-13
# 15.7
- target: "x86_64-apple-ios15.7-simulator"
xcode: "14.1"
runs-on: macos-12
- target: "arm64-apple-ios15.7-simulator"
xcode: "14.1"
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- name: "Swift Package Manager build"
Expand All @@ -153,12 +151,12 @@ jobs:
-Xswiftc "-target" -Xswiftc "${{ matrix.target }}"

cocoapods:
runs-on: macos-14
runs-on: macos-15
env:
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: "CocoaPods: pod lib lint"
run: pod lib lint --allow-warnings
run: pod lib lint --allow-warnings --verbose
- name: "CocoaPods: pod spec lint"
run: pod spec lint --allow-warnings
run: pod spec lint --allow-warnings --verbose
15 changes: 15 additions & 0 deletions Examples/Samples/Sources/PanelLayouts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,18 @@ class ModalPanelLayout: FloatingPanelLayout {
return 0.3
}
}

class ModalPanelLayout2: FloatingPanelLayout {
let position: FloatingPanelPosition = .bottom
let initialState: FloatingPanelState = .half
var anchors: [FloatingPanelState: FloatingPanelLayoutAnchoring] {
[
.full: FloatingPanelLayoutAnchor(fractionalInset: 0.0, edge: .top, referenceGuide: .superview),
.half: FloatingPanelLayoutAnchor(fractionalInset: 0.5, edge: .bottom, referenceGuide: .superview)
]
}
func backdropAlpha(for _: FloatingPanelState) -> CGFloat {
0.6
}
}

5 changes: 4 additions & 1 deletion Examples/Samples/Sources/UseCases/UseCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ enum UseCase: Int, CaseIterable {
case showDetail
case showModal
case showPanelModal
case showPanelModal2
case showMultiPanelModal
case showPanelInSheetModal
case showOnWindow
Expand Down Expand Up @@ -39,6 +40,7 @@ extension UseCase {
case .showDetail: return "Show Detail Panel"
case .showModal: return "Show Modal"
case .showPanelModal: return "Show Panel Modal"
case .showPanelModal2: return "Show Panel Modal 2"
case .showMultiPanelModal: return "Show Multi Panel Modal"
case .showOnWindow: return "Show Panel over Window"
case .showPanelInSheetModal: return "Show Panel in Sheet Modal"
Expand Down Expand Up @@ -81,10 +83,11 @@ extension UseCase {
case .trackingTextView: return .storyboard("ConsoleViewController") // Storyboard only
case .showDetail: return .storyboard(String(describing: DetailViewController.self))
case .showModal: return .storyboard(String(describing: ModalViewController.self))
case .showPanelModal: return .viewController(DebugTableViewController())
case .showPanelModal2: return .storyboard("ConsoleViewController")
case .showMultiPanelModal: return .viewController(DebugTableViewController())
case .showOnWindow: return .viewController(DebugTableViewController())
case .showPanelInSheetModal: return .viewController(DebugTableViewController())
case .showPanelModal: return .viewController(DebugTableViewController())
case .showTabBar: return .storyboard(String(describing: TabBarViewController.self))
case .showPageView: return .viewController(DebugTableViewController())
case .showPageContentView: return .viewController(DebugTableViewController())
Expand Down
18 changes: 14 additions & 4 deletions Examples/Samples/Sources/UseCases/UseCaseController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ extension UseCaseController {

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

case .showPanelModal2:
let fpc = FloatingPanelController()
fpc.set(contentViewController: contentVC)
fpc.delegate = self
fpc.track(scrollView: (contentVC as? DebugTextViewController)!.textView)

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

case .showMultiPanelModal:
let fpc = MultiPanelController()
mainVC.present(fpc, animated: true, completion: nil)
Expand All @@ -202,10 +210,10 @@ extension UseCaseController {
fpc.set(contentViewController: contentVC)
fpc.delegate = self

let apprearance = SurfaceAppearance()
apprearance.cornerRadius = 38.5
apprearance.shadows = []
fpc.surfaceView.appearance = apprearance
let appearance = SurfaceAppearance()
appearance.cornerRadius = 38.5
appearance.shadows = []
fpc.surfaceView.appearance = appearance
fpc.isRemovalInteractionEnabled = true

let mvc = UIViewController()
Expand Down Expand Up @@ -435,6 +443,8 @@ extension UseCaseController: FloatingPanelControllerDelegate {
return newCollection.verticalSizeClass == .compact ? RemovablePanelLandscapeLayout() : RemovablePanelLayout()
case .showIntrinsicView:
return IntrinsicPanelLayout()
case .showPanelModal2:
return ModalPanelLayout2()
case .showPanelModal:
if vc != mainPanelVC && vc != detailPanelVC {
return ModalPanelLayout()
Expand Down
4 changes: 2 additions & 2 deletions FloatingPanel.podspec
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Pod::Spec.new do |s|

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

s.platform = :ios, "11.0"
s.source = { :git => "https://github.com/scenee/FloatingPanel.git", :tag => s.version.to_s }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
FloatingPanel is a simple and easy-to-use UI component designed for a user interface featured in Apple Maps, Shortcuts and Stocks app.
The user interface displays related content and utilities alongside the main content.

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

![Maps](https://github.com/SCENEE/FloatingPanel/blob/master/assets/maps.gif)
![Stocks](https://github.com/SCENEE/FloatingPanel/blob/master/assets/stocks.gif)
Expand Down
10 changes: 10 additions & 0 deletions Sources/Controller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,16 @@ open class FloatingPanelController: UIViewController {

private var _contentViewController: UIViewController?

public var isAnimating: Bool = false {
didSet {
if isAnimating {
floatingPanel.lockAllScrollViews()
} else {
floatingPanel.unlockAllScrollViews()
}
}
}

private(set) var floatingPanel: Core!
private var preSafeAreaInsets: UIEdgeInsets = .zero // Capture the latest one
private var safeAreaInsetsObservation: NSKeyValueObservation?
Expand Down
Loading
Loading