Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Material
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Material
Commits
b7a1d22a
Unverified
Commit
b7a1d22a
authored
Jan 02, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated CollectionViewCard and BottomSheetController
parent
6e0141ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
Sources/iOS/BottomSheetController.swift
+5
-5
Sources/iOS/CollectionViewCard.swift
+6
-6
Sources/iOS/Menu.swift
+2
-2
No files found.
Sources/iOS/BottomSheetController.swift
View file @
b7a1d22a
...
...
@@ -431,7 +431,7 @@ open class BottomSheetController: RootController {
isUserInteractionEnabled
=
false
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
self
,
willOpen
:
.
right
)
delegate
?
.
bottomSheetController
WillOpen
?(
bottomSheetController
:
self
)
UIView
.
animate
(
withDuration
:
TimeInterval
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
v
.
y
/
velocity
)))),
animations
:
{
[
weak
self
,
v
=
v
]
in
...
...
@@ -446,7 +446,7 @@ open class BottomSheetController: RootController {
return
}
s
.
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
s
,
didOpen
:
.
right
)
s
.
delegate
?
.
bottomSheetController
DidOpen
?(
bottomSheetController
:
s
)
}
}
...
...
@@ -467,7 +467,7 @@ open class BottomSheetController: RootController {
isUserInteractionEnabled
=
true
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
self
,
willClose
:
.
left
)
delegate
?
.
bottomSheetController
WillClose
?(
bottomSheetController
:
self
)
UIView
.
animate
(
withDuration
:
TimeInterval
(
0
==
velocity
?
animationDuration
:
fmax
(
0.1
,
fmin
(
1
,
Double
(
v
.
y
/
velocity
)))),
animations
:
{
[
weak
self
,
v
=
v
]
in
...
...
@@ -484,7 +484,7 @@ open class BottomSheetController: RootController {
s
.
hideView
(
container
:
v
)
s
.
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
s
,
didClose
:
.
left
)
s
.
delegate
?
.
bottomSheetController
DidClose
?(
bottomSheetController
:
s
)
}
}
...
...
@@ -700,7 +700,7 @@ extension BottomSheetController: UIGestureRecognizerDelegate {
return
}
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
self
,
didTapAt
:
recognizer
.
location
(
in
:
view
)
,
position
:
.
left
)
delegate
?
.
bottomSheetController
?(
bottomSheetController
:
self
,
didTapAt
:
recognizer
.
location
(
in
:
view
))
guard
isBottomViewEnabled
&&
isBottomViewOpened
&&
!
isPointContainedWithinView
(
container
:
v
,
point
:
recognizer
.
location
(
in
:
v
))
else
{
return
...
...
Sources/iOS/CollectionViewCard.swift
View file @
b7a1d22a
...
...
@@ -46,8 +46,8 @@ open class CollectionViewCard: Card {
/// A reference to the dataSourceItems.
open
var
dataSourceItems
=
[
DataSourceItem
]()
/// An index of IndexPath to
Menu
Item.
open
var
indexForDataSourceItem
s
=
[
IndexPath
:
Any
]()
/// An index of IndexPath to
DataSource
Item.
open
var
dataSourceItemsIndexPath
s
=
[
IndexPath
:
Any
]()
/// A reference to the collectionView.
@IBInspectable
...
...
@@ -96,9 +96,9 @@ extension CollectionViewCard {
extension
CollectionViewCard
:
CollectionViewDelegate
{
open
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
guard
let
card
=
indexForDataSourceItem
s
[
indexPath
]
as?
Card
else
{
return
}
// guard let card = dataSourceItemsIndexPath
s[indexPath] as? Card else {
//
return
//
}
}
}
...
...
@@ -121,7 +121,7 @@ extension CollectionViewCard: CollectionViewDataSource {
return
cell
}
indexForDataSourceItem
s
[
indexPath
]
=
card
dataSourceItemsIndexPath
s
[
indexPath
]
=
card
if
.
vertical
==
self
.
collectionView
.
scrollDirection
{
card
.
width
=
cell
.
width
...
...
Sources/iOS/Menu.swift
View file @
b7a1d22a
...
...
@@ -294,7 +294,7 @@ extension Menu {
extension
Menu
:
CollectionViewDelegate
{
open
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
guard
let
menuItem
=
collectionViewCard
.
indexForDataSourceItem
s
[
indexPath
]
as?
MenuItem
else
{
guard
let
menuItem
=
collectionViewCard
.
dataSourceItemsIndexPath
s
[
indexPath
]
as?
MenuItem
else
{
return
}
...
...
@@ -321,7 +321,7 @@ extension Menu: CollectionViewDataSource {
return
cell
}
collectionViewCard
.
indexForDataSourceItem
s
[
indexPath
]
=
menuItem
collectionViewCard
.
dataSourceItemsIndexPath
s
[
indexPath
]
=
menuItem
cell
.
menuItem
=
menuItem
cell
.
menuItem
?
.
width
=
cell
.
width
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment