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
584e8fda
Commit
584e8fda
authored
Aug 21, 2016
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
development: updated TextField rules for Swift 3
parent
55ab6425
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
Sources/iOS/BottomTabBar.swift
+25
-26
Sources/iOS/TextField.swift
+0
-0
No files found.
Sources/iOS/BottomTabBar.swift
View file @
584e8fda
...
@@ -38,12 +38,13 @@ extension UITabBarItem {
...
@@ -38,12 +38,13 @@ extension UITabBarItem {
}
}
@IBDesignable
@IBDesignable
public
class
BottomTabBar
:
UITabBar
{
open
class
BottomTabBar
:
UITabBar
{
/// Automatically aligns the BottomNavigationBar to the superview.
/// Automatically aligns the BottomNavigationBar to the superview.
public
var
autoLayoutToSuperview
:
Bool
=
true
open
var
isAlignedToParentAutomatically
=
true
/// A property that accesses the backing layer's backgroundColor.
/// A property that accesses the backing layer's backgroundColor.
@IBInspectable
public
override
var
backgroundColor
:
UIColor
?
{
@IBInspectable
open
override
var
backgroundColor
:
UIColor
?
{
didSet
{
didSet
{
barTintColor
=
backgroundColor
barTintColor
=
backgroundColor
}
}
...
@@ -70,17 +71,17 @@ public class BottomTabBar: UITabBar {
...
@@ -70,17 +71,17 @@ public class BottomTabBar: UITabBar {
prepareView
()
prepareView
()
}
}
public
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
open
override
func
layoutSublayers
(
of
layer
:
CALayer
)
{
super
.
layoutSublayers
(
of
:
layer
)
super
.
layoutSublayers
(
of
:
layer
)
if
self
.
layer
==
layer
{
if
self
.
layer
==
layer
{
layoutShape
()
layoutShape
()
}
}
}
}
public
override
func
layoutSubviews
()
{
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
super
.
layoutSubviews
()
layoutShadowPath
()
layoutShadowPath
()
if
let
v
:
Array
<
UITabBarItem
>
=
items
{
if
let
v
=
items
{
for
item
in
v
{
for
item
in
v
{
if
.
phone
==
Device
.
userInterfaceIdiom
{
if
.
phone
==
Device
.
userInterfaceIdiom
{
if
nil
==
item
.
title
{
if
nil
==
item
.
title
{
...
@@ -90,41 +91,39 @@ public class BottomTabBar: UITabBar {
...
@@ -90,41 +91,39 @@ public class BottomTabBar: UITabBar {
let
inset
:
CGFloat
=
6
let
inset
:
CGFloat
=
6
item
.
titlePositionAdjustment
.
vertical
=
-
inset
item
.
titlePositionAdjustment
.
vertical
=
-
inset
}
}
}
else
{
}
else
if
nil
==
item
.
title
{
if
nil
==
item
.
title
{
let
inset
:
CGFloat
=
9
let
inset
:
CGFloat
=
9
item
.
imageInsets
=
UIEdgeInsetsMake
(
inset
,
0
,
-
inset
,
0
)
item
.
imageInsets
=
UIEdgeInsetsMake
(
inset
,
0
,
-
inset
,
0
)
}
else
{
}
else
{
let
inset
:
CGFloat
=
3
let
inset
:
CGFloat
=
3
item
.
imageInsets
=
UIEdgeInsetsMake
(
inset
,
0
,
-
inset
,
0
)
item
.
imageInsets
=
UIEdgeInsetsMake
(
inset
,
0
,
-
inset
,
0
)
item
.
titlePositionAdjustment
.
vertical
=
-
inset
item
.
titlePositionAdjustment
.
vertical
=
-
inset
}
}
}
}
}
}
}
}
}
public
override
func
didMoveToSuperview
()
{
open
override
func
didMoveToSuperview
()
{
super
.
didMoveToSuperview
()
super
.
didMoveToSuperview
()
if
autoLayoutToSuperview
{
if
isAlignedToParentAutomatically
{
if
let
v
:
UIView
=
superview
{
if
let
v
=
superview
{
_
=
v
.
layout
(
self
)
.
bottom
()
.
horizontally
()
_
=
v
.
layout
(
self
)
.
bottom
()
.
horizontally
()
}
}
}
}
}
}
/**
/**
Prepares the view instance when intialized. When subclassing,
Prepares the view instance when intialized. When subclassing,
it is recommended to override the prepareView method
it is recommended to override the prepareView method
to initialize property values and other setup operations.
to initialize property values and other setup operations.
The super.prepareView method should always be called immediately
The super.prepareView method should always be called immediately
when subclassing.
when subclassing.
*/
*/
public
func
prepareView
()
{
public
func
prepareView
()
{
depthPreset
=
.
depth1
depthPreset
=
.
depth1
contentScaleFactor
=
Device
.
scale
contentScaleFactor
=
Device
.
scale
backgroundColor
=
Color
.
white
backgroundColor
=
Color
.
white
let
image
:
UIImage
?
=
UIImage
.
imageWithColor
(
color
:
Color
.
clear
,
size
:
CGSize
(
width
:
1
,
height
:
1
))
let
image
=
UIImage
.
imageWithColor
(
color
:
Color
.
clear
,
size
:
CGSize
(
width
:
1
,
height
:
1
))
shadowImage
=
image
shadowImage
=
image
backgroundImage
=
image
backgroundImage
=
image
}
}
...
...
Sources/iOS/TextField.swift
View file @
584e8fda
This diff is collapsed.
Click to expand it.
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