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
fdf7dd71
Commit
fdf7dd71
authored
Aug 08, 2018
by
Orkhan Alikhanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added convenience properties to reach Editor's internal textView
parent
5efc51e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
Sources/iOS/Editor.swift
+61
-0
No files found.
Sources/iOS/Editor.swift
View file @
fdf7dd71
...
...
@@ -151,6 +151,25 @@ open class Editor: View {
layoutPlaceholderLabel
()
layoutDivider
()
}
@discardableResult
open
override
func
becomeFirstResponder
()
->
Bool
{
return
textView
.
becomeFirstResponder
()
}
@discardableResult
open
override
func
resignFirstResponder
()
->
Bool
{
return
textView
.
resignFirstResponder
()
}
open
override
var
inputAccessoryView
:
UIView
?
{
get
{
return
textView
.
inputAccessoryView
}
set
(
value
)
{
textView
.
inputAccessoryView
=
value
}
}
}
...
...
@@ -282,3 +301,45 @@ private extension Editor {
UIView
.
animate
(
withDuration
:
0.15
,
animations
:
layoutPlaceholderLabel
)
}
}
public
extension
Editor
{
/// A reference to the textView text.
var
text
:
String
!
{
get
{
return
textView
.
text
}
set
(
value
)
{
textView
.
text
=
value
}
}
/// A reference to the textView font.
var
font
:
UIFont
?
{
get
{
return
textView
.
font
}
set
(
value
)
{
textView
.
font
=
value
}
}
/// A reference to the textView placeholder.
var
placeholder
:
String
?
{
get
{
return
textView
.
placeholder
}
set
(
value
)
{
textView
.
placeholder
=
value
}
}
/// A reference to the textView textAlignment.
var
textAlignment
:
NSTextAlignment
{
get
{
return
textView
.
textAlignment
}
set
(
value
)
{
textView
.
textAlignment
=
value
}
}
}
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