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
62a7d0e0
Commit
62a7d0e0
authored
Jan 14, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed DialogController event handlers
parent
85c13ac2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
Sources/iOS/DialogBuilder.swift
+4
-4
Sources/iOS/DialogController.swift
+8
-8
No files found.
Sources/iOS/DialogBuilder.swift
View file @
62a7d0e0
...
...
@@ -26,7 +26,7 @@ open class DialogBuilder<T: DialogView> {
open
func
isCancelable
(
_
value
:
Bool
,
handler
:
(()
->
Void
)?
=
nil
)
->
DialogBuilder
{
controller
.
isCancelable
=
value
controller
.
canceled
Handler
=
handler
controller
.
didCancel
Handler
=
handler
return
self
}
...
...
@@ -37,19 +37,19 @@ open class DialogBuilder<T: DialogView> {
open
func
positive
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
DialogBuilder
{
dialogView
.
positiveButton
.
title
=
title
controller
.
positive
Handler
=
handler
controller
.
didTapPositiveButton
Handler
=
handler
return
self
}
open
func
negative
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
DialogBuilder
{
dialogView
.
negativeButton
.
title
=
title
controller
.
negative
Handler
=
handler
controller
.
didTapNegativeButton
Handler
=
handler
return
self
}
open
func
neutral
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
DialogBuilder
{
dialogView
.
neutralButton
.
title
=
title
controller
.
neutral
Handler
=
handler
controller
.
didTapNeutralButton
Handler
=
handler
return
self
}
...
...
Sources/iOS/DialogController.swift
View file @
62a7d0e0
...
...
@@ -36,29 +36,29 @@ open class DialogController<T: DialogView>: UIViewController {
dialogView
.
maxSize
=
CGSize
(
width
:
Screen
.
width
*
0.8
,
height
:
Screen
.
height
*
0.9
)
}
open
var
canceled
Handler
:
(()
->
Void
)?
open
var
didCancel
Handler
:
(()
->
Void
)?
open
var
shouldDismissHandler
:
((
Button
?)
->
Bool
)?
open
var
positive
Handler
:
(()
->
Void
)?
open
var
negative
Handler
:
(()
->
Void
)?
open
var
neutral
Handler
:
(()
->
Void
)?
open
var
didTapPositiveButton
Handler
:
(()
->
Void
)?
open
var
didTapNegativeButton
Handler
:
(()
->
Void
)?
open
var
didTapNeutralButton
Handler
:
(()
->
Void
)?
@objc
private
func
didTapView
()
{
guard
isCancelable
else
{
return
}
dismiss
(
nil
)
canceled
Handler
?()
didCancel
Handler
?()
}
@objc
private
func
didTapButton
(
_
sender
:
Button
)
{
switch
sender
{
case
dialogView
.
positiveButton
:
positive
Handler
?()
didTapPositiveButton
Handler
?()
case
dialogView
.
negativeButton
:
negative
Handler
?()
didTapNegativeButton
Handler
?()
case
dialogView
.
neutralButton
:
neutral
Handler
?()
didTapNeutralButton
Handler
?()
default
:
break
}
...
...
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