forked from gordontucker/FittedSheets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from llinardos/gordontucker#154-rubber-band
Add option, disabled by default to avoid retro-compability issues.
- Loading branch information
Showing
5 changed files
with
57 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// RubberBandDemo.swift | ||
// Demos | ||
// | ||
// Created by Leandro Linardos on 08/08/2021. | ||
// Copyright © 2021 Gordon Tucker. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import FittedSheets | ||
|
||
class RubberBandDemo: SimpleDemo { | ||
override class var name: String { "Rubber Band" } | ||
|
||
override class func openDemo(from parent: UIViewController, in view: UIView?) { | ||
let useInlineMode = view != nil | ||
|
||
let controller = ColorDemo() | ||
|
||
let sheet = SheetViewController( | ||
controller: controller, | ||
sizes: [.fixed(150), .fixed(350)], | ||
options: SheetOptions(useInlineMode: useInlineMode, isRubberBandEnabled: true)) | ||
sheet.allowPullingPastMaxHeight = false | ||
sheet.allowPullingPastMinHeight = false | ||
|
||
addSheetEventLogging(to: sheet) | ||
|
||
if let view = view { | ||
sheet.animateIn(to: view, in: parent) | ||
} else { | ||
parent.present(sheet, animated: true, completion: nil) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters