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
ef355c28
Commit
ef355c28
authored
Sep 26, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing conflicted files
parent
6b0bd134
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
30 deletions
+60
-30
Sources/iOS/ChipBarController.swift
+12
-12
Sources/iOS/CollectionView.swift
+6
-2
Sources/iOS/Layer.swift
+18
-16
Sources/iOS/TextField.swift
+0
-0
Sources/iOS/Toolbar.swift
+24
-0
No files found.
Sources/iOS/ChipBarController.swift
View file @
ef355c28
...
...
@@ -45,7 +45,7 @@ extension UIViewController {
This is the recommended method of accessing the ChipBarController
through child UIViewControllers.
*/
public
var
chip
s
Controller
:
ChipBarController
?
{
public
var
chip
Bar
Controller
:
ChipBarController
?
{
return
traverseViewControllerHierarchyForClassType
()
}
}
...
...
@@ -61,25 +61,25 @@ open class ChipBarController: TransitionController {
layoutSubviews
()
}
}
/// The ChipBar used to switch between view controllers.
@IBInspectable
open
let
chipBar
=
ChipBar
()
/// The chipBar alignment.
open
var
chipBarAlignment
=
ChipBarAlignment
.
bottom
{
didSet
{
layoutSubviews
()
}
}
open
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
layoutChipBar
()
layoutContainer
()
layoutRootViewController
()
}
open
override
func
prepare
()
{
super
.
prepare
()
prepareChipBar
()
...
...
@@ -98,12 +98,12 @@ fileprivate extension ChipBarController {
/// Layout the container.
func
layoutContainer
()
{
chipBar
.
frame
.
size
.
width
=
view
.
bounds
.
width
switch
displayStyle
{
case
.
partial
:
let
p
=
chipBar
.
bounds
.
height
let
y
=
view
.
bounds
.
height
-
p
switch
chipBarAlignment
{
case
.
top
:
container
.
frame
.
origin
.
y
=
p
...
...
@@ -115,18 +115,18 @@ fileprivate extension ChipBarController {
container
.
frame
.
origin
.
y
=
0
container
.
frame
.
size
.
height
=
view
.
bounds
.
height
}
container
.
frame
.
size
.
width
=
view
.
bounds
.
width
case
.
full
:
container
.
frame
=
view
.
bounds
}
}
/// Layout the chipBar.
func
layoutChipBar
()
{
chipBar
.
frame
.
size
.
width
=
view
.
bounds
.
width
switch
chipBarAlignment
{
case
.
top
:
chipBar
.
isHidden
=
false
...
...
@@ -138,7 +138,7 @@ fileprivate extension ChipBarController {
chipBar
.
isHidden
=
true
}
}
/// Layout the rootViewController.
func
layoutRootViewController
()
{
rootViewController
.
view
.
frame
=
container
.
bounds
...
...
Sources/iOS/CollectionView.swift
View file @
ef355c28
...
...
@@ -114,13 +114,17 @@ open class CollectionView: UICollectionView {
- Parameter frame: A CGRect defining the view's frame.
*/
public
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
CollectionViewLayout
())
let
layout
=
UICollectionViewFlowLayout
()
layout
.
itemSize
=
CGSize
(
width
:
100
,
height
:
100
)
super
.
init
(
frame
:
frame
,
collectionViewLayout
:
layout
)
prepare
()
}
/// A convenience initializer that initializes the object.
public
init
()
{
super
.
init
(
frame
:
.
zero
,
collectionViewLayout
:
CollectionViewLayout
())
let
layout
=
UICollectionViewFlowLayout
()
layout
.
itemSize
=
CGSize
(
width
:
100
,
height
:
100
)
super
.
init
(
frame
:
.
zero
,
collectionViewLayout
:
layout
)
prepare
()
}
...
...
Sources/iOS/Layer.swift
View file @
ef355c28
...
...
@@ -39,7 +39,7 @@ open class Layer: CAShapeLayer {
the image to a desired shape within the visualLayer.
*/
open
let
visualLayer
=
CAShapeLayer
()
/**
A property that manages an image for the visualLayer's contents
property. Images should not be set to the backing layer's contents
...
...
@@ -51,7 +51,7 @@ open class Layer: CAShapeLayer {
visualLayer
.
contents
=
image
?
.
cgImage
}
}
/**
Allows a relative subrectangle within the range of 0 to 1 to be
specified for the visualLayer's contents property. This allows
...
...
@@ -63,7 +63,7 @@ open class Layer: CAShapeLayer {
visualLayer
.
contentsRect
=
contentsRect
}
}
/**
A CGRect that defines a stretchable region inside the visualLayer
with a fixed border around the edge.
...
...
@@ -73,7 +73,7 @@ open class Layer: CAShapeLayer {
visualLayer
.
contentsCenter
=
contentsCenter
}
}
/**
A floating point value that defines a ratio between the pixel
dimensions of the visualLayer's contents property and the size
...
...
@@ -85,14 +85,14 @@ open class Layer: CAShapeLayer {
visualLayer
.
contentsScale
=
contentsScale
}
}
/// A Preset for the contentsGravity property.
open
var
contentsGravityPreset
:
Gravity
{
didSet
{
contentsGravity
=
GravityToValue
(
gravity
:
contentsGravityPreset
)
}
}
/// Determines how content should be aligned within the visualLayer's bounds.
@IBInspectable
open
override
var
contentsGravity
:
String
{
...
...
@@ -103,7 +103,7 @@ open class Layer: CAShapeLayer {
visualLayer
.
contentsGravity
=
value
}
}
/**
A property that sets the cornerRadius of the backing layer. If the shape
property has a value of .circle when the cornerRadius is set, it will
...
...
@@ -116,7 +116,7 @@ open class Layer: CAShapeLayer {
shapePreset
=
.
none
}
}
/**
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
...
...
@@ -126,7 +126,7 @@ open class Layer: CAShapeLayer {
super
.
init
(
coder
:
aDecoder
)
prepareVisualLayer
()
}
/**
An initializer the same as init(). The layer parameter is ignored
to avoid crashes on certain architectures.
...
...
@@ -137,14 +137,14 @@ open class Layer: CAShapeLayer {
super
.
init
(
layer
:
layer
)
prepareVisualLayer
()
}
/// A convenience initializer.
public
override
init
()
{
contentsGravityPreset
=
.
resizeAspectFill
super
.
init
()
prepareVisualLayer
()
}
/**
An initializer that initializes the object with a CGRect object.
- Parameter frame: A CGRect instance.
...
...
@@ -153,23 +153,25 @@ open class Layer: CAShapeLayer {
self
.
init
()
self
.
frame
=
frame
}
open
override
func
layoutSublayers
()
{
super
.
layoutSublayers
()
layoutShape
()
layoutVisualLayer
()
layoutShadowPath
()
}
}
fileprivate
extension
Layer
{
/// Prepares the visualLayer property.
open
func
prepareVisualLayer
()
{
func
prepareVisualLayer
()
{
visualLayer
.
zPosition
=
0
visualLayer
.
masksToBounds
=
true
addSublayer
(
visualLayer
)
}
/// Manages the layout for the visualLayer property.
internal
func
layoutVisualLayer
()
{
func
layoutVisualLayer
()
{
visualLayer
.
frame
=
bounds
visualLayer
.
cornerRadius
=
cornerRadius
}
...
...
Sources/iOS/TextField.swift
View file @
ef355c28
This diff is collapsed.
Click to expand it.
Sources/iOS/Toolbar.swift
View file @
ef355c28
...
...
@@ -33,10 +33,34 @@ import UIKit
fileprivate
var
ToolbarContext
:
UInt8
=
0
open
class
Toolbar
:
Bar
{
/// A convenience property to set the titleLabel.text.
@IBInspectable
open
var
title
:
String
?
{
get
{
return
titleLabel
.
text
}
set
(
value
)
{
titleLabel
.
text
=
value
layoutSubviews
()
}
}
/// Title label.
@IBInspectable
open
let
titleLabel
=
UILabel
()
/// A convenience property to set the detailLabel.text.
@IBInspectable
open
var
detail
:
String
?
{
get
{
return
detailLabel
.
text
}
set
(
value
)
{
detailLabel
.
text
=
value
layoutSubviews
()
}
}
/// Detail label.
@IBInspectable
open
let
detailLabel
=
UILabel
()
...
...
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