Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone_workspace
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone_workspace
Commits
7b7d3d90
Commit
7b7d3d90
authored
8 years ago
by
Oliver Wiese
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
94c4e4b8
71b67bab
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.DS_Store
+0
-0
0 additions, 0 deletions
.DS_Store
Pods/VENTokenField/VENTokenField/VENTokenField.h
+1
-0
1 addition, 0 deletions
Pods/VENTokenField/VENTokenField/VENTokenField.h
Pods/VENTokenField/VENTokenField/VENTokenField.m
+19
-9
19 additions, 9 deletions
Pods/VENTokenField/VENTokenField/VENTokenField.m
with
20 additions
and
9 deletions
.DS_Store
deleted
100644 → 0
+
0
−
0
View file @
94c4e4b8
File deleted
This diff is collapsed.
Click to expand it.
Pods/VENTokenField/VENTokenField/VENTokenField.h
+
1
−
0
View file @
7b7d3d90
...
...
@@ -55,6 +55,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
weak
,
nonatomic
)
id
<
VENTokenFieldDataSource
>
dataSource
;
@property
(
strong
,
nonatomic
,
nonnull
)
NSMutableArray
<
NSString
*>
*
textTokens
;
@property
(
strong
,
nonatomic
,
nonnull
)
NSMutableArray
<
NSString
*>
*
mailTokens
;
@property
(
atomic
)
BOOL
readOnly
;
-
(
void
)
reloadData
;
-
(
void
)
collapse
;
...
...
This diff is collapsed.
Click to expand it.
Pods/VENTokenField/VENTokenField/VENTokenField.m
+
19
−
9
View file @
7b7d3d90
...
...
@@ -85,6 +85,7 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
-
(
void
)
setUpInit
{
_readOnly
=
false
;
_textTokens
=
[
NSMutableArray
array
];
_mailTokens
=
[
NSMutableArray
array
];
_enter
=
false
;
...
...
@@ -96,9 +97,9 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
self
.
horizontalInset
=
VENTokenFieldDefaultHorizontalInset
;
self
.
tokenPadding
=
VENTokenFieldDefaultTokenPadding
;
self
.
minInputWidth
=
VENTokenFieldDefaultMinInputWidth
;
self
.
colorScheme
=
[
UIColor
blue
Color
];
self
.
toLabelTextColor
=
[
UIColor
colorWithRed
:
112
/
255
.
0
f
green
:
124
/
255
.
0
f
blue
:
124
/
255
.
0
f
alpha
:
1
.
0
f
];
self
.
inputTextFieldTextColor
=
[
UIColor
colorWithRed
:
38
/
255
.
0
f
green
:
39
/
255
.
0
f
blue
:
41
/
255
.
0
f
alpha
:
1
.
0
f
];
self
.
colorScheme
=
[
UIColor
darkGray
Color
];
self
.
toLabelTextColor
=
[
UIColor
darkGrayColor
];
self
.
inputTextFieldTextColor
=
[
UIColor
blackColor
];
//[self addTarget:self action:@selector(delegate:tokenFieldDidEndEditing:) forControlEvents:UIControlEventEditingChanged];
[
_inputTextField
addTarget
:
self
action
:
@selector
(
inputTextFieldEditingEnd
:
)
forControlEvents
:
UIControlEventEditingDidEnd
];
...
...
@@ -263,7 +264,7 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
-
(
void
)
layoutInputTextFieldWithCurrentX
:(
CGFloat
*
)
currentX
currentY
:(
CGFloat
*
)
currentY
clearInput
:(
BOOL
)
clearInput
{
CGFloat
inputTextFieldWidth
=
self
.
scrollView
.
contentSize
.
width
-
*
currentX
;
if
(
inputTextFieldWidth
<
self
.
minInputWidth
)
{
if
(
!
_readOnly
&&
inputTextFieldWidth
<
self
.
minInputWidth
)
{
inputTextFieldWidth
=
self
.
scrollView
.
contentSize
.
width
;
*
currentY
+=
[
self
heightForToken
];
*
currentX
=
0
;
...
...
@@ -318,10 +319,12 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
token
.
didTapTokenBlock
=
^
{
[
weakSelf
didTapToken
:
weakToken
];
};
[
token
setTitleText
:[
NSString
stringWithFormat
:
@"%@,"
,
title
]];
if
(
i
==
[
self
numberOfTokens
]
-
1
)
{
[
token
setTitleText
:[
NSString
stringWithFormat
:
@"%@"
,
title
]];
}
else
{
[
token
setTitleText
:[
NSString
stringWithFormat
:
@"%@,"
,
title
]];
}
token
.
colorScheme
=
[
self
colorSchemeForTokenAtIndex
:
i
];
[
self
.
tokens
addObject
:
token
];
if
(
*
currentX
+
token
.
width
<=
self
.
scrollView
.
contentSize
.
width
)
{
// token fits in current line
...
...
@@ -374,7 +377,7 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
if
(
!
_toLabel
)
{
_toLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectZero
];
_toLabel
.
textColor
=
self
.
toLabelTextColor
;
_toLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
7
.
0
];
//[UIFont fontWithName:@"HelveticaNeue" size:15.5];
_toLabel
.
font
=
[
UIFont
systemFontOfSize
:
1
5
.
0
];
//[UIFont fontWithName:@"HelveticaNeue" size:15.5];
_toLabel
.
x
=
0
;
[
_toLabel
sizeToFit
];
[
_toLabel
setHeight
:[
self
heightForToken
]];
...
...
@@ -412,6 +415,9 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
-
(
VENBackspaceTextField
*
)
inputTextField
{
if
(
_readOnly
)
{
return
nil
;
}
if
(
!
_inputTextField
)
{
_inputTextField
=
[[
VENBackspaceTextField
alloc
]
init
];
[
_inputTextField
setKeyboardType
:
self
.
inputTextFieldKeyboardType
];
...
...
@@ -477,6 +483,10 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
-
(
void
)
didTapToken
:(
VENToken
*
)
token
{
if
(
_readOnly
)
{
[
self
.
delegate
tokenField
:
self
didTappedTokenTwice
:[
self
.
tokens
indexOfObject
:
token
]];
return
;
}
VENToken
*
tempToken
=
nil
;
for
(
VENToken
*
aToken
in
self
.
tokens
)
{
if
(
aToken
==
token
)
{
...
...
@@ -512,7 +522,7 @@ static const CGFloat VENTokenFieldDefaultMaxHeight = 2000.0;//150.0;
BOOL
visible
=
[
highlightedTokens
count
]
==
0
;
if
(
visible
)
{
[
self
inputTextFieldBecomeFirstResponder
];
}
else
{
}
else
if
(
!
_readOnly
)
{
[
self
.
invisibleTextField
becomeFirstResponder
];
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment