Commit aaab03b5 by Daniel Dahan

updated Divider access

parent 3898ce7f
......@@ -55,6 +55,6 @@ class AppBottomNavigationController: BottomNavigationController {
/// Prepares the tabBar.
private func prepareTabBar() {
tabBar.depthPreset = .none
tabBar.divider.color = Color.grey.lighten3
tabBar.dividerColor = Color.grey.lighten3
}
}
......@@ -124,8 +124,8 @@ class ViewController: UIViewController {
bottomBar.contentEdgeInsetsPreset = .square1
bottomBar.cornerRadiusPreset = .cornerRadius1
bottomBar.divider.color = Color.grey.lighten3
bottomBar.divider.alignment = .top
bottomBar.dividerColor = Color.grey.lighten3
bottomBar.dividerAlignment = .top
bottomBar.contentView.grid.views = [favoriteButton, shareButton, starButton]
}
......
......@@ -119,8 +119,8 @@ class ViewController: UIViewController {
bottomBar.contentEdgeInsetsPreset = .square1
bottomBar.cornerRadiusPreset = .cornerRadius1
bottomBar.divider.color = Color.grey.lighten3
bottomBar.divider.alignment = .top
bottomBar.dividerColor = Color.grey.lighten3
bottomBar.dividerAlignment = .top
bottomBar.contentView.grid.views = [favoriteButton, shareButton, starButton]
}
......
......@@ -42,6 +42,6 @@ class AppToolbarController: ToolbarController {
private func prepareToolbar() {
toolbar.title = "Photo Library"
toolbar.depthPreset = .none
toolbar.divider.color = Color.grey.lighten3
toolbar.dividerColor = Color.grey.lighten3
}
}
......@@ -50,7 +50,7 @@ class PhotoLibraryCollectionReusableView: CollectionReusableView {
toolbar.contentEdgeInsets.left = 16
toolbar.contentEdgeInsets.right = 16
toolbar.depthPreset = .none
toolbar.divider.color = Color.grey.lighten3
toolbar.dividerColor = Color.grey.lighten3
layout(toolbar).edges()
}
}
......@@ -127,8 +127,8 @@ class ViewController: UIViewController {
bottomBar.contentEdgeInsetsPreset = .square1
bottomBar.cornerRadiusPreset = .cornerRadius1
bottomBar.divider.color = Color.grey.lighten3
bottomBar.divider.alignment = .top
bottomBar.dividerColor = Color.grey.lighten3
bottomBar.dividerAlignment = .top
bottomBar.contentView.grid.views = [favoriteButton, shareButton, starButton]
}
......
......@@ -17,8 +17,6 @@
96784FD81D906DCB0061C06C /* RemindersItemsCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96784FD71D906DCB0061C06C /* RemindersItemsCollectionView.swift */; };
96784FDA1D906DF60061C06C /* RemindersItemsCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96784FD91D906DF60061C06C /* RemindersItemsCollectionViewCell.swift */; };
96784FDC1D906E190061C06C /* AppNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96784FDB1D906E190061C06C /* AppNavigationController.swift */; };
9690B3F81D99DFA000E7F42A /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9690B3F71D99DFA000E7F42A /* Material.framework */; };
9690B3F91D99DFA000E7F42A /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9690B3F71D99DFA000E7F42A /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -28,7 +26,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
9690B3F91D99DFA000E7F42A /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -48,7 +45,6 @@
96784FD71D906DCB0061C06C /* RemindersItemsCollectionView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersItemsCollectionView.swift; sourceTree = "<group>"; };
96784FD91D906DF60061C06C /* RemindersItemsCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersItemsCollectionViewCell.swift; sourceTree = "<group>"; };
96784FDB1D906E190061C06C /* AppNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppNavigationController.swift; sourceTree = "<group>"; };
9690B3F71D99DFA000E7F42A /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Material.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -56,7 +52,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9690B3F81D99DFA000E7F42A /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -66,7 +61,6 @@
96784F2B1D901F610061C06C = {
isa = PBXGroup;
children = (
9690B3F71D99DFA000E7F42A /* Material.framework */,
96784F361D901F610061C06C /* RemindersController */,
96784F351D901F610061C06C /* Products */,
);
......@@ -131,7 +125,6 @@
TargetAttributes = {
96784F331D901F610061C06C = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 9Z76XCNLGL;
ProvisioningStyle = Automatic;
};
};
......@@ -293,7 +286,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 9Z76XCNLGL;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = RemindersController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.RemindersController;
......@@ -306,7 +299,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = 9Z76XCNLGL;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = RemindersController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.RemindersController;
......
......@@ -46,7 +46,7 @@ class AppNavigationController: NavigationController {
}
v.depthPreset = .none
v.divider.color = Color.grey.lighten3
v.dividerColor = Color.grey.lighten3
}
}
......@@ -63,8 +63,8 @@ class ViewController: UIViewController {
private func prepareTabBar() {
tabBar = TabBar()
tabBar.divider.color = Color.grey.lighten3
tabBar.divider.alignment = .top
tabBar.dividerColor = Color.grey.lighten3
tabBar.dividerAlignment = .top
tabBar.lineColor = Color.blue.base
tabBar.lineAlignment = .top
......
......@@ -37,6 +37,41 @@ public enum ContentViewAlignment: Int {
}
open class Bar: View {
/// Divider layer.
internal private(set) var divider: Divider!
/// Divider color.
@IBInspectable
open var dividerColor: UIColor? {
get {
return divider.color
}
set(value) {
divider.color = value
}
}
/// Divider animation.
open var dividerAlignment: DividerAlignment {
get {
return divider.alignment
}
set(value) {
divider.alignment = value
}
}
/// Divider height.
@IBInspectable
open var dividerHeight: CGFloat {
get {
return divider.height
}
set(value) {
divider.height = value
}
}
/// Should center the contentView.
open var contentViewAlignment = ContentViewAlignment.any {
didSet {
......@@ -101,41 +136,6 @@ open class Bar: View {
}
}
/// Divider layer.
internal lazy var divider: Divider = Divider(view: self)
/// Divider color.
@IBInspectable
open var dividerColor: UIColor? {
get {
return divider.color
}
set(value) {
divider.color = value
}
}
/// Divider animation.
open var dividerAlignment: DividerAlignment {
get {
return divider.alignment
}
set(value) {
divider.alignment = value
}
}
/// Divider height.
@IBInspectable
open var dividerHeight: CGFloat {
get {
return divider.height
}
set(value) {
divider.height = value
}
}
/// ContentView that holds the any desired subviews.
open private(set) lazy var contentView = View()
......@@ -265,10 +265,16 @@ open class Bar: View {
open override func prepare() {
super.prepare()
prepareContentView()
prepareDivider()
}
/// Prepares the contentView.
private func prepareContentView() {
contentView.backgroundColor = nil
}
/// Prepares the divider.
private func prepareDivider() {
divider = Divider(view: self)
}
}
......@@ -159,7 +159,7 @@ open class BottomNavigationController: UITabBarController, UITabBarControllerDel
/// Prepares the tabBar.
private func prepareTabBar() {
tabBar.depthPreset = .depth1
tabBar.divider.alignment = .top
tabBar.dividerAlignment = .top
let image = UIImage.imageWithColor(color: Color.clear, size: CGSize(width: 1, height: 1))
tabBar.shadowImage = image
tabBar.backgroundImage = image
......
......@@ -137,7 +137,7 @@ private var TabBarKey: UInt8 = 0
extension UITabBar {
/// TabBarItem reference.
internal private(set) var divider: Divider! {
internal private(set) var divider: Divider {
get {
return AssociatedObject(base: self, key: &TabBarKey) {
return Divider(view: self)
......
......@@ -33,7 +33,7 @@ import UIKit
@objc(CollectionViewCell)
open class CollectionViewCell: UICollectionViewCell {
/// Divider layer.
internal private(set) lazy var divider: Divider = Divider(view: self)
internal private(set) var divider: Divider!
/// Divider color.
@IBInspectable
......@@ -331,6 +331,7 @@ open class CollectionViewCell: UICollectionViewCell {
open func prepare() {
contentScaleFactor = Device.scale
prepareVisualLayer()
prepareDivider()
}
/// Prepares the visualLayer property.
......@@ -345,4 +346,9 @@ open class CollectionViewCell: UICollectionViewCell {
visualLayer.frame = bounds
visualLayer.cornerRadius = cornerRadius
}
/// Prepares the divider.
private func prepareDivider() {
divider = Divider(view: self)
}
}
......@@ -40,7 +40,7 @@ public enum NavigationBarStyle: Int {
open class NavigationBar: UINavigationBar {
/// Divider layer.
internal private(set) lazy var divider: Divider = Divider(view: self)
internal private(set) var divider: Divider!
/// Divider color.
@IBInspectable
......@@ -335,6 +335,7 @@ open class NavigationBar: UINavigationBar {
shadowImage = image
setBackgroundImage(image, for: .default)
backgroundColor = Color.white
prepareDivider()
}
/**
......@@ -356,4 +357,9 @@ open class NavigationBar: UINavigationBar {
}
item.titleView = UIView(frame: .zero)
}
/// Prepares the divider.
private func prepareDivider() {
divider = Divider(view: self)
}
}
......@@ -258,7 +258,7 @@ open class PageTabBarController: RootController {
/// Prepares the pageTabBar.
private func preparePageTabBar() {
pageTabBar.zPosition = 1000
pageTabBar.divider.color = Color.grey.lighten3
pageTabBar.dividerColor = Color.grey.lighten3
view.addSubview(pageTabBar)
pageTabBar.select(at: selectedIndex)
}
......
......@@ -225,7 +225,7 @@ open class TabBar: Bar {
/// Prepares the divider.
private func prepareDivider() {
divider.alignment = .top
dividerAlignment = .top
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment