Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b9f02d317e | |||
| 29d3fe128e | |||
| 0463bb7a8e | |||
| 12f8e2bc0d | |||
| 578b3dbb41 |
@@ -33,6 +33,7 @@ playground.xcworkspace
|
||||
|
||||
# Swift Package Manager
|
||||
.build/
|
||||
.swiftpm/
|
||||
|
||||
# Carthage
|
||||
Carthage/Build
|
||||
@@ -14,6 +14,7 @@
|
||||
F445CA9121AED92700184254 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F445CA8F21AED92700184254 /* LaunchScreen.storyboard */; };
|
||||
F459D75B21C3AB9A00798524 /* ModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75A21C3AB9A00798524 /* ModalViewController.swift */; };
|
||||
F459D75D21C3ABBD00798524 /* ModalTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F459D75C21C3ABBD00798524 /* ModalTableViewController.swift */; };
|
||||
F4803BF523082FDA0092C9BC /* SPStorkArrowMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BF423082FDA0092C9BC /* SPStorkArrowMode.swift */; };
|
||||
F4DB849622609C05005082AA /* SPVibration.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DB83F522609C03005082AA /* SPVibration.swift */; };
|
||||
F4DB849722609C05005082AA /* SPPromoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DB83F922609C03005082AA /* SPPromoTableViewCell.swift */; };
|
||||
F4DB849822609C05005082AA /* SPFormButtonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DB83FB22609C03005082AA /* SPFormButtonTableViewCell.swift */; };
|
||||
@@ -161,6 +162,7 @@
|
||||
F445CA9221AED92700184254 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
F459D75A21C3AB9A00798524 /* ModalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalViewController.swift; sourceTree = "<group>"; };
|
||||
F459D75C21C3ABBD00798524 /* ModalTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalTableViewController.swift; sourceTree = "<group>"; };
|
||||
F4803BF423082FDA0092C9BC /* SPStorkArrowMode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SPStorkArrowMode.swift; sourceTree = "<group>"; };
|
||||
F4DB83F522609C03005082AA /* SPVibration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPVibration.swift; sourceTree = "<group>"; };
|
||||
F4DB83F922609C03005082AA /* SPPromoTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPPromoTableViewCell.swift; sourceTree = "<group>"; };
|
||||
F4DB83FB22609C03005082AA /* SPFormButtonTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPFormButtonTableViewCell.swift; sourceTree = "<group>"; };
|
||||
@@ -833,6 +835,7 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4E0E37E22CF6B940020D754 /* SPStorkHaptic.swift */,
|
||||
F4803BF423082FDA0092C9BC /* SPStorkArrowMode.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
@@ -988,6 +991,7 @@
|
||||
F4DB84A622609C05005082AA /* SPSocialButton.swift in Sources */,
|
||||
F4DB84E022609C05005082AA /* SPUICollectionViewExtenshion.swift in Sources */,
|
||||
F4E0E39222CF6B940020D754 /* SPStorkCodeDraw.swift in Sources */,
|
||||
F4803BF523082FDA0092C9BC /* SPStorkArrowMode.swift in Sources */,
|
||||
F4DB84E222609C05005082AA /* SPUITabBarControllerExtenshion.swift in Sources */,
|
||||
F4DB84A122609C05005082AA /* SPProposeTableViewCell.swift in Sources */,
|
||||
F4E0E39922CF6B940020D754 /* SPStorkCloseButton.swift in Sources */,
|
||||
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,29 @@
|
||||
// The MIT License (MIT)
|
||||
// Copyright © 2017 Ivan Vorobei (hello@ivanvorobei.by)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import UIKit
|
||||
|
||||
public enum SPStorkArrowMode {
|
||||
|
||||
case auto
|
||||
case alwaysArrow
|
||||
case alwaysLine
|
||||
}
|
||||
+3
@@ -29,6 +29,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
|
||||
var showIndicator: Bool = true
|
||||
var indicatorColor: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1)
|
||||
var hideIndicatorWhenScroll: Bool = false
|
||||
var indicatorMode: SPStorkArrowMode = .auto
|
||||
var customHeight: CGFloat? = nil
|
||||
var translateForDismiss: CGFloat = 200
|
||||
var hapticMoments: [SPStorkHapticMoments] = [.willDismissIfRelease]
|
||||
@@ -119,6 +120,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
|
||||
self.indicatorView.heightAnchor.constraint(equalToConstant: 13).isActive = true
|
||||
self.indicatorView.centerXAnchor.constraint(equalTo: presentedView.centerXAnchor).isActive = true
|
||||
self.indicatorView.topAnchor.constraint(equalTo: presentedView.topAnchor, constant: 12).isActive = true
|
||||
self.indicatorView.mode = self.indicatorMode
|
||||
|
||||
if UIAccessibility.isVoiceOverRunning {
|
||||
let accessibleIndicatorOverlayButton = UIButton(type: .custom)
|
||||
@@ -529,6 +531,7 @@ extension SPStorkPresentationController {
|
||||
private func updateLayoutIndicator() {
|
||||
self.indicatorView.style = .line
|
||||
self.indicatorView.sizeToFit()
|
||||
self.indicatorView.style = .arrow
|
||||
}
|
||||
|
||||
private func updateLayoutCloseButton() {
|
||||
|
||||
+2
@@ -29,6 +29,7 @@ public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTrans
|
||||
public var showIndicator: Bool = true
|
||||
public var indicatorColor: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1)
|
||||
public var hideIndicatorWhenScroll: Bool = false
|
||||
public var indicatorMode: SPStorkArrowMode = .auto
|
||||
public var customHeight: CGFloat? = nil
|
||||
public var translateForDismiss: CGFloat = 200
|
||||
public var cornerRadius: CGFloat = 10
|
||||
@@ -44,6 +45,7 @@ public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTrans
|
||||
controller.showIndicator = self.showIndicator
|
||||
controller.indicatorColor = self.indicatorColor
|
||||
controller.hideIndicatorWhenScroll = self.hideIndicatorWhenScroll
|
||||
controller.indicatorMode = self.indicatorMode
|
||||
controller.customHeight = self.customHeight
|
||||
controller.translateForDismiss = self.translateForDismiss
|
||||
controller.cornerRadius = self.cornerRadius
|
||||
|
||||
+33
-11
@@ -25,23 +25,41 @@ open class SPStorkIndicatorView: UIView {
|
||||
|
||||
var style: Style = .line {
|
||||
didSet {
|
||||
switch self.style {
|
||||
case .line:
|
||||
self.animate {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
case .arrow:
|
||||
self.animate {
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
if self.mode == .auto {
|
||||
switch self.style {
|
||||
case .line:
|
||||
self.animate {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
case .arrow:
|
||||
self.animate {
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.mode == .alwaysArrow {
|
||||
self.leftView.layer.removeAllAnimations()
|
||||
self.rightView.layer.removeAllAnimations()
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
}
|
||||
|
||||
if self.mode == .alwaysLine {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mode: SPStorkArrowMode = .auto
|
||||
|
||||
var color: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1) {
|
||||
didSet {
|
||||
self.leftView.backgroundColor = self.color
|
||||
@@ -66,6 +84,10 @@ open class SPStorkIndicatorView: UIView {
|
||||
|
||||
override open func sizeToFit() {
|
||||
super.sizeToFit()
|
||||
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
|
||||
self.frame = CGRect.init(x: self.frame.origin.x, y: self.frame.origin.y, width: 36, height: 13)
|
||||
|
||||
let height: CGFloat = 5
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
|
||||
+5
-10
@@ -1,21 +1,16 @@
|
||||
// swift-tools-version:5.1
|
||||
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
||||
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "SPStorkController",
|
||||
platforms: [.iOS(.v10)],
|
||||
platforms: [
|
||||
.iOS(.v10)
|
||||
],
|
||||
products: [
|
||||
.library(
|
||||
name: "SPStorkController",
|
||||
targets: ["SPStorkController"]),
|
||||
.library(name: "SPStorkController", targets: ["SPStorkController"])
|
||||
],
|
||||
targets: [
|
||||
.target(
|
||||
name: "SPStorkController",
|
||||
dependencies: [],
|
||||
path: "Source/SPStorkController"
|
||||
)
|
||||
.target(name: "SPStorkController", dependencies: [], path: "Source/SPStorkController")
|
||||
]
|
||||
)
|
||||
|
||||
@@ -173,6 +173,12 @@ Property `hideIndicatorWhenScroll` shows or hides indicator when scrolling. Defa
|
||||
transitionDelegate.hideIndicatorWhenScroll = true
|
||||
```
|
||||
|
||||
You can set always line or arrow indicator. Set `indicatorMode`:
|
||||
|
||||
```swift
|
||||
transitionDelegate.indicatorMode = .alwaysLine
|
||||
```
|
||||
|
||||
### Dismissing
|
||||
|
||||
You can also configure events that will dimiss the controller.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Pod::Spec.new do |s|
|
||||
|
||||
s.name = "SPStorkController"
|
||||
s.version = "1.7.7"
|
||||
s.version = "1.7.9"
|
||||
s.summary = "Very similar to the controllers displayed in Apple Music, Podcasts and Mail Apple's applications."
|
||||
s.homepage = "https://github.com/IvanVorobei/SPStorkController"
|
||||
s.source = { :git => "https://github.com/IvanVorobei/SPStorkController.git", :tag => s.version }
|
||||
|
||||
@@ -7,38 +7,40 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
F437B76722D62FF000E6074C /* SPStorkHaptic.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75422D62FF000E6074C /* SPStorkHaptic.swift */; };
|
||||
F437B76822D62FF000E6074C /* SPStorkSeque.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75522D62FF000E6074C /* SPStorkSeque.swift */; };
|
||||
F437B76922D62FF000E6074C /* SPStorkCodeDraw.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75722D62FF000E6074C /* SPStorkCodeDraw.swift */; };
|
||||
F437B76A22D62FF000E6074C /* SPStorkController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75822D62FF000E6074C /* SPStorkController.swift */; };
|
||||
F437B76B22D62FF000E6074C /* SPStorkTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75A22D62FF000E6074C /* SPStorkTransitioningDelegate.swift */; };
|
||||
F437B76C22D62FF000E6074C /* SPStorkPresentingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75B22D62FF000E6074C /* SPStorkPresentingAnimationController.swift */; };
|
||||
F437B76D22D62FF000E6074C /* SPStorkPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75C22D62FF000E6074C /* SPStorkPresentationController.swift */; };
|
||||
F437B76E22D62FF000E6074C /* SPStorkDismissingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75D22D62FF000E6074C /* SPStorkDismissingAnimationController.swift */; };
|
||||
F437B76F22D62FF000E6074C /* SPStorkViewControllerExtenshion.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B75F22D62FF000E6074C /* SPStorkViewControllerExtenshion.swift */; };
|
||||
F437B77022D62FF000E6074C /* SPStorkCloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B76122D62FF000E6074C /* SPStorkCloseButton.swift */; };
|
||||
F437B77122D62FF000E6074C /* SPStorkIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B76222D62FF000E6074C /* SPStorkIndicatorView.swift */; };
|
||||
F437B77222D62FF000E6074C /* SPStorkCloseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B76322D62FF000E6074C /* SPStorkCloseView.swift */; };
|
||||
F437B77322D62FF000E6074C /* SPStorkControllerConfirmDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B76522D62FF000E6074C /* SPStorkControllerConfirmDelegate.swift */; };
|
||||
F437B77422D62FF000E6074C /* SPStorkControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F437B76622D62FF000E6074C /* SPStorkControllerDelegate.swift */; };
|
||||
F4803C0C230836F40092C9BC /* SPStorkHaptic.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BF8230836F40092C9BC /* SPStorkHaptic.swift */; };
|
||||
F4803C0D230836F50092C9BC /* SPStorkArrowMode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BF9230836F40092C9BC /* SPStorkArrowMode.swift */; };
|
||||
F4803C0E230836F50092C9BC /* SPStorkSeque.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BFA230836F40092C9BC /* SPStorkSeque.swift */; };
|
||||
F4803C0F230836F50092C9BC /* SPStorkCodeDraw.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BFC230836F40092C9BC /* SPStorkCodeDraw.swift */; };
|
||||
F4803C10230836F50092C9BC /* SPStorkController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BFD230836F40092C9BC /* SPStorkController.swift */; };
|
||||
F4803C11230836F50092C9BC /* SPStorkTransitioningDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803BFF230836F40092C9BC /* SPStorkTransitioningDelegate.swift */; };
|
||||
F4803C12230836F50092C9BC /* SPStorkPresentingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C00230836F40092C9BC /* SPStorkPresentingAnimationController.swift */; };
|
||||
F4803C13230836F50092C9BC /* SPStorkPresentationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C01230836F40092C9BC /* SPStorkPresentationController.swift */; };
|
||||
F4803C14230836F50092C9BC /* SPStorkDismissingAnimationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C02230836F40092C9BC /* SPStorkDismissingAnimationController.swift */; };
|
||||
F4803C15230836F50092C9BC /* SPStorkViewControllerExtenshion.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C04230836F40092C9BC /* SPStorkViewControllerExtenshion.swift */; };
|
||||
F4803C16230836F50092C9BC /* SPStorkCloseButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C06230836F40092C9BC /* SPStorkCloseButton.swift */; };
|
||||
F4803C17230836F50092C9BC /* SPStorkIndicatorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C07230836F40092C9BC /* SPStorkIndicatorView.swift */; };
|
||||
F4803C18230836F50092C9BC /* SPStorkCloseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C08230836F40092C9BC /* SPStorkCloseView.swift */; };
|
||||
F4803C19230836F50092C9BC /* SPStorkControllerConfirmDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C0A230836F40092C9BC /* SPStorkControllerConfirmDelegate.swift */; };
|
||||
F4803C1A230836F50092C9BC /* SPStorkControllerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4803C0B230836F40092C9BC /* SPStorkControllerDelegate.swift */; };
|
||||
F4DB85222260A4FD005082AA /* SPStorkController.h in Headers */ = {isa = PBXBuildFile; fileRef = F4DB85202260A4FD005082AA /* SPStorkController.h */; settings = {ATTRIBUTES = (Public, ); }; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
F437B75422D62FF000E6074C /* SPStorkHaptic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkHaptic.swift; sourceTree = "<group>"; };
|
||||
F437B75522D62FF000E6074C /* SPStorkSeque.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkSeque.swift; sourceTree = "<group>"; };
|
||||
F437B75722D62FF000E6074C /* SPStorkCodeDraw.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCodeDraw.swift; sourceTree = "<group>"; };
|
||||
F437B75822D62FF000E6074C /* SPStorkController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkController.swift; sourceTree = "<group>"; };
|
||||
F437B75A22D62FF000E6074C /* SPStorkTransitioningDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkTransitioningDelegate.swift; sourceTree = "<group>"; };
|
||||
F437B75B22D62FF000E6074C /* SPStorkPresentingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentingAnimationController.swift; sourceTree = "<group>"; };
|
||||
F437B75C22D62FF000E6074C /* SPStorkPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentationController.swift; sourceTree = "<group>"; };
|
||||
F437B75D22D62FF000E6074C /* SPStorkDismissingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkDismissingAnimationController.swift; sourceTree = "<group>"; };
|
||||
F437B75F22D62FF000E6074C /* SPStorkViewControllerExtenshion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkViewControllerExtenshion.swift; sourceTree = "<group>"; };
|
||||
F437B76122D62FF000E6074C /* SPStorkCloseButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCloseButton.swift; sourceTree = "<group>"; };
|
||||
F437B76222D62FF000E6074C /* SPStorkIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkIndicatorView.swift; sourceTree = "<group>"; };
|
||||
F437B76322D62FF000E6074C /* SPStorkCloseView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCloseView.swift; sourceTree = "<group>"; };
|
||||
F437B76522D62FF000E6074C /* SPStorkControllerConfirmDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkControllerConfirmDelegate.swift; sourceTree = "<group>"; };
|
||||
F437B76622D62FF000E6074C /* SPStorkControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkControllerDelegate.swift; sourceTree = "<group>"; };
|
||||
F4803BF8230836F40092C9BC /* SPStorkHaptic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkHaptic.swift; sourceTree = "<group>"; };
|
||||
F4803BF9230836F40092C9BC /* SPStorkArrowMode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkArrowMode.swift; sourceTree = "<group>"; };
|
||||
F4803BFA230836F40092C9BC /* SPStorkSeque.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkSeque.swift; sourceTree = "<group>"; };
|
||||
F4803BFC230836F40092C9BC /* SPStorkCodeDraw.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCodeDraw.swift; sourceTree = "<group>"; };
|
||||
F4803BFD230836F40092C9BC /* SPStorkController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkController.swift; sourceTree = "<group>"; };
|
||||
F4803BFF230836F40092C9BC /* SPStorkTransitioningDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkTransitioningDelegate.swift; sourceTree = "<group>"; };
|
||||
F4803C00230836F40092C9BC /* SPStorkPresentingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentingAnimationController.swift; sourceTree = "<group>"; };
|
||||
F4803C01230836F40092C9BC /* SPStorkPresentationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkPresentationController.swift; sourceTree = "<group>"; };
|
||||
F4803C02230836F40092C9BC /* SPStorkDismissingAnimationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkDismissingAnimationController.swift; sourceTree = "<group>"; };
|
||||
F4803C04230836F40092C9BC /* SPStorkViewControllerExtenshion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkViewControllerExtenshion.swift; sourceTree = "<group>"; };
|
||||
F4803C06230836F40092C9BC /* SPStorkCloseButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCloseButton.swift; sourceTree = "<group>"; };
|
||||
F4803C07230836F40092C9BC /* SPStorkIndicatorView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkIndicatorView.swift; sourceTree = "<group>"; };
|
||||
F4803C08230836F40092C9BC /* SPStorkCloseView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkCloseView.swift; sourceTree = "<group>"; };
|
||||
F4803C0A230836F40092C9BC /* SPStorkControllerConfirmDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkControllerConfirmDelegate.swift; sourceTree = "<group>"; };
|
||||
F4803C0B230836F40092C9BC /* SPStorkControllerDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SPStorkControllerDelegate.swift; sourceTree = "<group>"; };
|
||||
F4DB851D2260A4FD005082AA /* SPStorkController.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SPStorkController.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
F4DB85202260A4FD005082AA /* SPStorkController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SPStorkController.h; sourceTree = "<group>"; };
|
||||
F4DB85212260A4FD005082AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
@@ -55,75 +57,6 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
F437B75222D62FF000E6074C /* SPStorkController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75322D62FF000E6074C /* Models */,
|
||||
F437B75522D62FF000E6074C /* SPStorkSeque.swift */,
|
||||
F437B75622D62FF000E6074C /* CodeDraw */,
|
||||
F437B75822D62FF000E6074C /* SPStorkController.swift */,
|
||||
F437B75922D62FF000E6074C /* TransitioningDelegate */,
|
||||
F437B75E22D62FF000E6074C /* Extenshion */,
|
||||
F437B76022D62FF000E6074C /* Views */,
|
||||
F437B76422D62FF000E6074C /* Protocols */,
|
||||
);
|
||||
path = SPStorkController;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B75322D62FF000E6074C /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75422D62FF000E6074C /* SPStorkHaptic.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B75622D62FF000E6074C /* CodeDraw */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75722D62FF000E6074C /* SPStorkCodeDraw.swift */,
|
||||
);
|
||||
path = CodeDraw;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B75922D62FF000E6074C /* TransitioningDelegate */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75A22D62FF000E6074C /* SPStorkTransitioningDelegate.swift */,
|
||||
F437B75B22D62FF000E6074C /* SPStorkPresentingAnimationController.swift */,
|
||||
F437B75C22D62FF000E6074C /* SPStorkPresentationController.swift */,
|
||||
F437B75D22D62FF000E6074C /* SPStorkDismissingAnimationController.swift */,
|
||||
);
|
||||
path = TransitioningDelegate;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B75E22D62FF000E6074C /* Extenshion */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75F22D62FF000E6074C /* SPStorkViewControllerExtenshion.swift */,
|
||||
);
|
||||
path = Extenshion;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B76022D62FF000E6074C /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B76122D62FF000E6074C /* SPStorkCloseButton.swift */,
|
||||
F437B76222D62FF000E6074C /* SPStorkIndicatorView.swift */,
|
||||
F437B76322D62FF000E6074C /* SPStorkCloseView.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F437B76422D62FF000E6074C /* Protocols */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B76522D62FF000E6074C /* SPStorkControllerConfirmDelegate.swift */,
|
||||
F437B76622D62FF000E6074C /* SPStorkControllerDelegate.swift */,
|
||||
);
|
||||
path = Protocols;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4437E4F22B50918006E6498 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -133,6 +66,76 @@
|
||||
path = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803BF6230836F40092C9BC /* SPStorkController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803BF7230836F40092C9BC /* Models */,
|
||||
F4803BFA230836F40092C9BC /* SPStorkSeque.swift */,
|
||||
F4803BFB230836F40092C9BC /* CodeDraw */,
|
||||
F4803BFD230836F40092C9BC /* SPStorkController.swift */,
|
||||
F4803BFE230836F40092C9BC /* TransitioningDelegate */,
|
||||
F4803C03230836F40092C9BC /* Extenshion */,
|
||||
F4803C05230836F40092C9BC /* Views */,
|
||||
F4803C09230836F40092C9BC /* Protocols */,
|
||||
);
|
||||
path = SPStorkController;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803BF7230836F40092C9BC /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803BF8230836F40092C9BC /* SPStorkHaptic.swift */,
|
||||
F4803BF9230836F40092C9BC /* SPStorkArrowMode.swift */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803BFB230836F40092C9BC /* CodeDraw */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803BFC230836F40092C9BC /* SPStorkCodeDraw.swift */,
|
||||
);
|
||||
path = CodeDraw;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803BFE230836F40092C9BC /* TransitioningDelegate */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803BFF230836F40092C9BC /* SPStorkTransitioningDelegate.swift */,
|
||||
F4803C00230836F40092C9BC /* SPStorkPresentingAnimationController.swift */,
|
||||
F4803C01230836F40092C9BC /* SPStorkPresentationController.swift */,
|
||||
F4803C02230836F40092C9BC /* SPStorkDismissingAnimationController.swift */,
|
||||
);
|
||||
path = TransitioningDelegate;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803C03230836F40092C9BC /* Extenshion */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803C04230836F40092C9BC /* SPStorkViewControllerExtenshion.swift */,
|
||||
);
|
||||
path = Extenshion;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803C05230836F40092C9BC /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803C06230836F40092C9BC /* SPStorkCloseButton.swift */,
|
||||
F4803C07230836F40092C9BC /* SPStorkIndicatorView.swift */,
|
||||
F4803C08230836F40092C9BC /* SPStorkCloseView.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4803C09230836F40092C9BC /* Protocols */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F4803C0A230836F40092C9BC /* SPStorkControllerConfirmDelegate.swift */,
|
||||
F4803C0B230836F40092C9BC /* SPStorkControllerDelegate.swift */,
|
||||
);
|
||||
path = Protocols;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F4DB85132260A4FD005082AA = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -152,7 +155,7 @@
|
||||
F4DB851F2260A4FD005082AA /* Source */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F437B75222D62FF000E6074C /* SPStorkController */,
|
||||
F4803BF6230836F40092C9BC /* SPStorkController */,
|
||||
F4437E4F22B50918006E6498 /* Supporting Files */,
|
||||
);
|
||||
path = Source;
|
||||
@@ -236,20 +239,21 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
F437B76A22D62FF000E6074C /* SPStorkController.swift in Sources */,
|
||||
F437B76E22D62FF000E6074C /* SPStorkDismissingAnimationController.swift in Sources */,
|
||||
F437B76D22D62FF000E6074C /* SPStorkPresentationController.swift in Sources */,
|
||||
F437B76F22D62FF000E6074C /* SPStorkViewControllerExtenshion.swift in Sources */,
|
||||
F437B76822D62FF000E6074C /* SPStorkSeque.swift in Sources */,
|
||||
F437B77422D62FF000E6074C /* SPStorkControllerDelegate.swift in Sources */,
|
||||
F437B77322D62FF000E6074C /* SPStorkControllerConfirmDelegate.swift in Sources */,
|
||||
F437B77022D62FF000E6074C /* SPStorkCloseButton.swift in Sources */,
|
||||
F437B76C22D62FF000E6074C /* SPStorkPresentingAnimationController.swift in Sources */,
|
||||
F437B77122D62FF000E6074C /* SPStorkIndicatorView.swift in Sources */,
|
||||
F437B77222D62FF000E6074C /* SPStorkCloseView.swift in Sources */,
|
||||
F437B76922D62FF000E6074C /* SPStorkCodeDraw.swift in Sources */,
|
||||
F437B76722D62FF000E6074C /* SPStorkHaptic.swift in Sources */,
|
||||
F437B76B22D62FF000E6074C /* SPStorkTransitioningDelegate.swift in Sources */,
|
||||
F4803C10230836F50092C9BC /* SPStorkController.swift in Sources */,
|
||||
F4803C11230836F50092C9BC /* SPStorkTransitioningDelegate.swift in Sources */,
|
||||
F4803C19230836F50092C9BC /* SPStorkControllerConfirmDelegate.swift in Sources */,
|
||||
F4803C1A230836F50092C9BC /* SPStorkControllerDelegate.swift in Sources */,
|
||||
F4803C15230836F50092C9BC /* SPStorkViewControllerExtenshion.swift in Sources */,
|
||||
F4803C17230836F50092C9BC /* SPStorkIndicatorView.swift in Sources */,
|
||||
F4803C0C230836F40092C9BC /* SPStorkHaptic.swift in Sources */,
|
||||
F4803C12230836F50092C9BC /* SPStorkPresentingAnimationController.swift in Sources */,
|
||||
F4803C18230836F50092C9BC /* SPStorkCloseView.swift in Sources */,
|
||||
F4803C13230836F50092C9BC /* SPStorkPresentationController.swift in Sources */,
|
||||
F4803C0E230836F50092C9BC /* SPStorkSeque.swift in Sources */,
|
||||
F4803C14230836F50092C9BC /* SPStorkDismissingAnimationController.swift in Sources */,
|
||||
F4803C0D230836F50092C9BC /* SPStorkArrowMode.swift in Sources */,
|
||||
F4803C0F230836F50092C9BC /* SPStorkCodeDraw.swift in Sources */,
|
||||
F4803C16230836F50092C9BC /* SPStorkCloseButton.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// The MIT License (MIT)
|
||||
// Copyright © 2017 Ivan Vorobei (hello@ivanvorobei.by)
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
import UIKit
|
||||
|
||||
public enum SPStorkArrowMode {
|
||||
|
||||
case auto
|
||||
case alwaysArrow
|
||||
case alwaysLine
|
||||
}
|
||||
@@ -29,6 +29,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
|
||||
var showIndicator: Bool = true
|
||||
var indicatorColor: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1)
|
||||
var hideIndicatorWhenScroll: Bool = false
|
||||
var indicatorMode: SPStorkArrowMode = .auto
|
||||
var customHeight: CGFloat? = nil
|
||||
var translateForDismiss: CGFloat = 200
|
||||
var hapticMoments: [SPStorkHapticMoments] = [.willDismissIfRelease]
|
||||
@@ -119,6 +120,7 @@ class SPStorkPresentationController: UIPresentationController, UIGestureRecogniz
|
||||
self.indicatorView.heightAnchor.constraint(equalToConstant: 13).isActive = true
|
||||
self.indicatorView.centerXAnchor.constraint(equalTo: presentedView.centerXAnchor).isActive = true
|
||||
self.indicatorView.topAnchor.constraint(equalTo: presentedView.topAnchor, constant: 12).isActive = true
|
||||
self.indicatorView.mode = self.indicatorMode
|
||||
|
||||
if UIAccessibility.isVoiceOverRunning {
|
||||
let accessibleIndicatorOverlayButton = UIButton(type: .custom)
|
||||
@@ -529,6 +531,7 @@ extension SPStorkPresentationController {
|
||||
private func updateLayoutIndicator() {
|
||||
self.indicatorView.style = .line
|
||||
self.indicatorView.sizeToFit()
|
||||
self.indicatorView.style = .arrow
|
||||
}
|
||||
|
||||
private func updateLayoutCloseButton() {
|
||||
|
||||
@@ -29,6 +29,7 @@ public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTrans
|
||||
public var showIndicator: Bool = true
|
||||
public var indicatorColor: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1)
|
||||
public var hideIndicatorWhenScroll: Bool = false
|
||||
public var indicatorMode: SPStorkArrowMode = .auto
|
||||
public var customHeight: CGFloat? = nil
|
||||
public var translateForDismiss: CGFloat = 200
|
||||
public var cornerRadius: CGFloat = 10
|
||||
@@ -44,6 +45,7 @@ public final class SPStorkTransitioningDelegate: NSObject, UIViewControllerTrans
|
||||
controller.showIndicator = self.showIndicator
|
||||
controller.indicatorColor = self.indicatorColor
|
||||
controller.hideIndicatorWhenScroll = self.hideIndicatorWhenScroll
|
||||
controller.indicatorMode = self.indicatorMode
|
||||
controller.customHeight = self.customHeight
|
||||
controller.translateForDismiss = self.translateForDismiss
|
||||
controller.cornerRadius = self.cornerRadius
|
||||
|
||||
@@ -25,23 +25,41 @@ open class SPStorkIndicatorView: UIView {
|
||||
|
||||
var style: Style = .line {
|
||||
didSet {
|
||||
switch self.style {
|
||||
case .line:
|
||||
self.animate {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
case .arrow:
|
||||
self.animate {
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
if self.mode == .auto {
|
||||
switch self.style {
|
||||
case .line:
|
||||
self.animate {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
case .arrow:
|
||||
self.animate {
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.mode == .alwaysArrow {
|
||||
self.leftView.layer.removeAllAnimations()
|
||||
self.rightView.layer.removeAllAnimations()
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
let angle = CGFloat(20 * Float.pi / 180)
|
||||
self.leftView.transform = CGAffineTransform.init(rotationAngle: angle)
|
||||
self.rightView.transform = CGAffineTransform.init(rotationAngle: -angle)
|
||||
}
|
||||
|
||||
if self.mode == .alwaysLine {
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mode: SPStorkArrowMode = .auto
|
||||
|
||||
var color: UIColor = UIColor.init(red: 202/255, green: 201/255, blue: 207/255, alpha: 1) {
|
||||
didSet {
|
||||
self.leftView.backgroundColor = self.color
|
||||
@@ -66,6 +84,10 @@ open class SPStorkIndicatorView: UIView {
|
||||
|
||||
override open func sizeToFit() {
|
||||
super.sizeToFit()
|
||||
|
||||
self.leftView.transform = .identity
|
||||
self.rightView.transform = .identity
|
||||
|
||||
self.frame = CGRect.init(x: self.frame.origin.x, y: self.frame.origin.y, width: 36, height: 13)
|
||||
|
||||
let height: CGFloat = 5
|
||||
|
||||
Reference in New Issue
Block a user