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
fe4294dc
Commit
fe4294dc
authored
Oct 16, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed DialogBuilder to Dialog
parent
2ea0efcd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
19 deletions
+16
-19
Material.xcodeproj/project.pbxproj
+4
-4
Sources/iOS/Dialog.swift
+12
-15
No files found.
Material.xcodeproj/project.pbxproj
View file @
fe4294dc
...
...
@@ -175,7 +175,7 @@
9D054A6620D175AC00D0528D
/* Material+UILabel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9D054A6420D175AC00D0528D
/* Material+UILabel.swift */
;
};
9D39A81B20FE8ED100BA8FA1
/* ViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9D39A81A20FE8ED100BA8FA1
/* ViewController.swift */
;
};
9D9089B92118914500605DC9
/* Editor.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9D9089B82118914500605DC9
/* Editor.swift */
;
};
9DE25DE02170D7AF000C04DF
/* Dialog
Builder.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9DE25DDF2170D7AF000C04DF
/* DialogBuilder
.swift */
;
};
9DE25DE02170D7AF000C04DF
/* Dialog
.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9DE25DDF2170D7AF000C04DF
/* Dialog
.swift */
;
};
9DE25DE22170D7C0000C04DF
/* DialogController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9DE25DE12170D7C0000C04DF
/* DialogController.swift */
;
};
9DE25DE42170D7FF000C04DF
/* DialogView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9DE25DE32170D7FF000C04DF
/* DialogView.swift */
;
};
9DE84D721FF0252600586C8B
/* RadioButtonGroup.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9DE84D6F1FF0252500586C8B
/* RadioButtonGroup.swift */
;
};
...
...
@@ -301,7 +301,7 @@
9D054A6420D175AC00D0528D
/* Material+UILabel.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Material+UILabel.swift"
;
sourceTree
=
"<group>"
;
};
9D39A81A20FE8ED100BA8FA1
/* ViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
ViewController.swift
;
sourceTree
=
"<group>"
;
};
9D9089B82118914500605DC9
/* Editor.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Editor.swift
;
sourceTree
=
"<group>"
;
};
9DE25DDF2170D7AF000C04DF
/* Dialog
Builder.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DialogBuilder
.swift
;
sourceTree
=
"<group>"
;
};
9DE25DDF2170D7AF000C04DF
/* Dialog
.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
Dialog
.swift
;
sourceTree
=
"<group>"
;
};
9DE25DE12170D7C0000C04DF
/* DialogController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DialogController.swift
;
sourceTree
=
"<group>"
;
};
9DE25DE32170D7FF000C04DF
/* DialogView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
DialogView.swift
;
sourceTree
=
"<group>"
;
};
9DE84D6F1FF0252500586C8B
/* RadioButtonGroup.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
RadioButtonGroup.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -781,7 +781,7 @@
9DE25DDE2170D779000C04DF
/* Dialogs */
=
{
isa
=
PBXGroup
;
children
=
(
9DE25DDF2170D7AF000C04DF
/* Dialog
Builder
.swift */
,
9DE25DDF2170D7AF000C04DF
/* Dialog.swift */
,
9DE25DE12170D7C0000C04DF
/* DialogController.swift */
,
9DE25DE32170D7FF000C04DF
/* DialogView.swift */
,
);
...
...
@@ -1037,7 +1037,7 @@
96328B971E05C0BB009A4C90
/* TableView.swift in Sources */
,
965E80F81DD4D59500D61E4B
/* ImageCard.swift in Sources */
,
96328B991E05C0CE009A4C90
/* TableViewController.swift in Sources */
,
9DE25DE02170D7AF000C04DF
/* Dialog
Builder
.swift in Sources */
,
9DE25DE02170D7AF000C04DF
/* Dialog.swift in Sources */
,
965E80F91DD4D59500D61E4B
/* PresenterCard.swift in Sources */
,
96E09DC81F2287E50000B121
/* TabsController.swift in Sources */
,
961154CC1F32A7B100A78D74
/* ChipBar.swift in Sources */
,
...
...
Sources/iOS/Dialog
Builder
.swift
→
Sources/iOS/Dialog.swift
View file @
fe4294dc
...
...
@@ -33,13 +33,10 @@
import
UIKit
/// A typealias referring to DialogBuilder<DialogView>.
public
typealias
Dialog
=
DialogBuilder
<
DialogView
>
/// A builder for DialogController.
open
class
Dialog
Builder
<
T
:
DialogView
>
{
open
class
Dialog
{
/// A reference to dialog controller.
public
let
controller
=
DialogController
<
T
>
()
public
let
controller
=
DialogController
<
DialogView
>
()
/// An empty initializer.
public
init
()
{
}
...
...
@@ -49,7 +46,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter _ text: A string.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
title
(
_
text
:
String
?)
->
Dialog
Builder
{
open
func
title
(
_
text
:
String
?)
->
Dialog
{
dialogView
.
titleLabel
.
text
=
text
return
self
}
...
...
@@ -59,7 +56,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter _ text: A string.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
details
(
_
text
:
String
?)
->
Dialog
Builder
{
open
func
details
(
_
text
:
String
?)
->
Dialog
{
dialogView
.
detailsLabel
.
text
=
text
return
self
}
...
...
@@ -70,7 +67,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter handler: A closure handling tap.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
positive
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
Builder
{
open
func
positive
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
{
dialogView
.
positiveButton
.
title
=
title
controller
.
didTapPositiveButtonHandler
=
handler
return
self
...
...
@@ -82,7 +79,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter handler: A closure handling tap.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
negative
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
Builder
{
open
func
negative
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
{
dialogView
.
negativeButton
.
title
=
title
controller
.
didTapNegativeButtonHandler
=
handler
return
self
...
...
@@ -94,7 +91,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter handler: A closure handling tap.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
neutral
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
Builder
{
open
func
neutral
(
_
title
:
String
?,
handler
:
(()
->
Void
)?)
->
Dialog
{
dialogView
.
neutralButton
.
title
=
title
controller
.
didTapNeutralButtonHandler
=
handler
return
self
...
...
@@ -106,7 +103,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter handler: A closure handling cancellation.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
isCancelable
(
_
value
:
Bool
,
handler
:
(()
->
Void
)?
=
nil
)
->
Dialog
Builder
{
open
func
isCancelable
(
_
value
:
Bool
,
handler
:
(()
->
Void
)?
=
nil
)
->
Dialog
{
controller
.
isCancelable
=
value
controller
.
didCancelHandler
=
handler
return
self
...
...
@@ -118,7 +115,7 @@ open class DialogBuilder<T: DialogView> {
- Parameter handler: A closure handling if dialog can be dismissed.
- Returns: DialogBuilder itself to allow chaining.
*/
open
func
shouldDismiss
(
handler
:
((
T
,
Button
?)
->
Bool
)?)
->
DialogBuilder
{
open
func
shouldDismiss
(
handler
:
((
DialogView
,
Button
?)
->
Bool
)?)
->
Dialog
{
controller
.
shouldDismissHandler
=
handler
return
self
}
...
...
@@ -129,15 +126,15 @@ open class DialogBuilder<T: DialogView> {
- Returns: DialogBuilder itself to allow chaining.
*/
@discardableResult
open
func
show
(
_
viewController
:
UIViewController
)
->
Dialog
Builder
{
open
func
show
(
_
viewController
:
UIViewController
)
->
Dialog
{
viewController
.
present
(
controller
,
animated
:
true
,
completion
:
nil
)
return
self
}
}
private
extension
Dialog
Builder
{
private
extension
Dialog
{
/// Returns dialogView of controller.
var
dialogView
:
T
{
var
dialogView
:
DialogView
{
return
controller
.
dialogView
}
}
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