Commit 825c260f by Daniel Dahan

development: Morged BarView and ContentView into Bar, and a base sample project

parent 5d842821
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
location = "container:" location = "container:"
name = "Programmatic"> name = "Programmatic">
<FileRef <FileRef
location = "group:Programmatic/Bar/Bar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/BottomNavigationController/BottomNavigationController.xcodeproj"> location = "group:Programmatic/BottomNavigationController/BottomNavigationController.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
......
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
96D5A2871D91F24600D369C4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D5A2861D91F24600D369C4 /* AppDelegate.swift */; };
96D5A2891D91F24600D369C4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96D5A2881D91F24600D369C4 /* ViewController.swift */; };
96D5A28E1D91F24600D369C4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96D5A28D1D91F24600D369C4 /* Assets.xcassets */; };
96D5A2911D91F24600D369C4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96D5A28F1D91F24600D369C4 /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
96B5AF651D91F4F800449DDD /* Embed Frameworks */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96D5A2831D91F24600D369C4 /* Bar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Bar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96D5A2861D91F24600D369C4 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96D5A2881D91F24600D369C4 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96D5A28D1D91F24600D369C4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96D5A2901D91F24600D369C4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96D5A2921D91F24600D369C4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
96D5A2801D91F24600D369C4 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
96D5A27A1D91F24600D369C4 = {
isa = PBXGroup;
children = (
96D5A2851D91F24600D369C4 /* Bar */,
96D5A2841D91F24600D369C4 /* Products */,
);
sourceTree = "<group>";
};
96D5A2841D91F24600D369C4 /* Products */ = {
isa = PBXGroup;
children = (
96D5A2831D91F24600D369C4 /* Bar.app */,
);
name = Products;
sourceTree = "<group>";
};
96D5A2851D91F24600D369C4 /* Bar */ = {
isa = PBXGroup;
children = (
96D5A2861D91F24600D369C4 /* AppDelegate.swift */,
96D5A2881D91F24600D369C4 /* ViewController.swift */,
96D5A28D1D91F24600D369C4 /* Assets.xcassets */,
96D5A28F1D91F24600D369C4 /* LaunchScreen.storyboard */,
96D5A2921D91F24600D369C4 /* Info.plist */,
);
path = Bar;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96D5A2821D91F24600D369C4 /* Bar */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96D5A2951D91F24600D369C4 /* Build configuration list for PBXNativeTarget "Bar" */;
buildPhases = (
96D5A27F1D91F24600D369C4 /* Sources */,
96D5A2801D91F24600D369C4 /* Frameworks */,
96D5A2811D91F24600D369C4 /* Resources */,
96B5AF651D91F4F800449DDD /* Embed Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = Bar;
productName = Bar;
productReference = 96D5A2831D91F24600D369C4 /* Bar.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
96D5A27B1D91F24600D369C4 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0800;
LastUpgradeCheck = 0800;
ORGANIZATIONNAME = CosmicMind;
TargetAttributes = {
96D5A2821D91F24600D369C4 = {
CreatedOnToolsVersion = 8.0;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 96D5A27E1D91F24600D369C4 /* Build configuration list for PBXProject "Bar" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 96D5A27A1D91F24600D369C4;
productRefGroup = 96D5A2841D91F24600D369C4 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
96D5A2821D91F24600D369C4 /* Bar */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
96D5A2811D91F24600D369C4 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D5A2911D91F24600D369C4 /* LaunchScreen.storyboard in Resources */,
96D5A28E1D91F24600D369C4 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
96D5A27F1D91F24600D369C4 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96D5A2891D91F24600D369C4 /* ViewController.swift in Sources */,
96D5A2871D91F24600D369C4 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96D5A28F1D91F24600D369C4 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96D5A2901D91F24600D369C4 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
96D5A2931D91F24600D369C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
96D5A2941D91F24600D369C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
96D5A2961D91F24600D369C4 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Bar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Bar;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Debug;
};
96D5A2971D91F24600D369C4 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = Bar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.Bar;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96D5A27E1D91F24600D369C4 /* Build configuration list for PBXProject "Bar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D5A2931D91F24600D369C4 /* Debug */,
96D5A2941D91F24600D369C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96D5A2951D91F24600D369C4 /* Build configuration list for PBXNativeTarget "Bar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96D5A2961D91F24600D369C4 /* Debug */,
96D5A2971D91F24600D369C4 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 96D5A27B1D91F24600D369C4 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:Bar.xcodeproj">
</FileRef>
</Workspace>
...@@ -29,60 +29,41 @@ ...@@ -29,60 +29,41 @@
*/ */
import UIKit import UIKit
import Material
open class BarView: ContentView { @UIApplicationMain
/// Divider layer. class AppDelegate: UIResponder, UIApplicationDelegate {
open internal(set) var divider: Divider!
/** var window: UIWindow?
An initializer that initializes the object with a NSCoder object.
- Parameter aDecoder: A NSCoder instance.
*/
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
/** func applicationDidFinishLaunching(_ application: UIApplication) {
An initializer that initializes the object with a CGRect object. window = UIWindow(frame: Device.bounds)
If AutoLayout is used, it is better to initilize the instance window!.rootViewController = ViewController()
using the init() initializer. window!.makeKeyAndVisible()
- Parameter frame: A CGRect instance.
*/
public override init(frame: CGRect) {
super.init(frame: frame)
} }
/** func applicationWillResignActive(_ application: UIApplication) {
A convenience initializer with parameter settings. // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
- Parameter leftViews: An Array of UIViews that go on the left side. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
- Parameter rightViews: An Array of UIViews that go on the right side.
*/
public override init(leftViews: [UIView]? = nil, rightViews: [UIView]? = nil) {
super.init(leftViews: leftViews, rightViews: rightViews)
} }
open override func layoutSubviews() { func applicationDidEnterBackground(_ application: UIApplication) {
super.layoutSubviews() // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
guard willLayout else { // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
return
} }
divider.reload()
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
} }
/** func applicationDidBecomeActive(_ application: UIApplication) {
Prepares the view instance when intialized. When subclassing, // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
it is recommended to override the prepare method
to initialize property values and other setup operations.
The super.prepare method should always be called immediately
when subclassing.
*/
open override func prepare() {
super.prepare()
prepareDivider()
} }
/// Prepares the divider. func applicationWillTerminate(_ application: UIApplication) {
private func prepareDivider() { // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
divider = Divider(view: self)
} }
} }
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of CosmicMind nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
import Material
class ViewController: UIViewController {
/// A reference to the Bar.
private var bar: Bar!
/// Left buttons.
private var favoriteButton: IconButton!
/// Right buttons.
private var shareButton: IconButton!
/// Title label.
private var titleLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = Color.white
prepareFavoriteButton()
prepareShareButton()
prepareTitleLabel()
prepareBar()
layoutSubviews()
}
private func prepareFavoriteButton() {
favoriteButton = IconButton(image: Icon.favorite, tintColor: Color.white)
favoriteButton.pulseColor = Color.white
}
private func prepareShareButton() {
shareButton = IconButton(image: Icon.cm.share, tintColor: Color.white)
shareButton.pulseColor = Color.white
}
private func prepareTitleLabel() {
titleLabel = UILabel()
titleLabel.text = "Title"
titleLabel.font = RobotoFont.bold(with: 17)
titleLabel.textColor = Color.white
}
private func prepareBar() {
bar = Bar()
bar.contentEdgeInsetsPreset = .square1
bar.backgroundColor = Color.blue.base
bar.leftViews = [favoriteButton]
bar.rightViews = [shareButton]
}
private func layoutSubviews() {
view.layout(bar).horizontally().center()
bar.contentView.layout(titleLabel).edges()
}
}
...@@ -55,7 +55,6 @@ ...@@ -55,7 +55,6 @@
96BCB7A41CB40DC500C806FE /* CaptureSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75B1CB40DC500C806FE /* CaptureSession.swift */; }; 96BCB7A41CB40DC500C806FE /* CaptureSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75B1CB40DC500C806FE /* CaptureSession.swift */; };
96BCB7A51CB40DC500C806FE /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75C1CB40DC500C806FE /* Capture.swift */; }; 96BCB7A51CB40DC500C806FE /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75C1CB40DC500C806FE /* Capture.swift */; };
96BCB7A61CB40DC500C806FE /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75D1CB40DC500C806FE /* Card.swift */; }; 96BCB7A61CB40DC500C806FE /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75D1CB40DC500C806FE /* Card.swift */; };
96BCB7A71CB40DC500C806FE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75E1CB40DC500C806FE /* ContentView.swift */; };
96BCB7A81CB40DC500C806FE /* FabButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75F1CB40DC500C806FE /* FabButton.swift */; }; 96BCB7A81CB40DC500C806FE /* FabButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB75F1CB40DC500C806FE /* FabButton.swift */; };
96BCB7A91CB40DC500C806FE /* FlatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7601CB40DC500C806FE /* FlatButton.swift */; }; 96BCB7A91CB40DC500C806FE /* FlatButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7601CB40DC500C806FE /* FlatButton.swift */; };
96BCB7AA1CB40DC500C806FE /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7611CB40DC500C806FE /* Grid.swift */; }; 96BCB7AA1CB40DC500C806FE /* Grid.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7611CB40DC500C806FE /* Grid.swift */; };
...@@ -104,7 +103,7 @@ ...@@ -104,7 +103,7 @@
96BCB7DE1CB40DC500C806FE /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; }; 96BCB7DE1CB40DC500C806FE /* SearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; };
96BCB7DF1CB40DC500C806FE /* SearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; }; 96BCB7DF1CB40DC500C806FE /* SearchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; };
96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; }; 96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; };
96BCB7E11CB40DC500C806FE /* BarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; }; 96BCB7E11CB40DC500C806FE /* Bar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* Bar.swift */; };
96BCB7E21CB40DC500C806FE /* RootController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* RootController.swift */; }; 96BCB7E21CB40DC500C806FE /* RootController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* RootController.swift */; };
96BCB7E31CB40DC500C806FE /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79A1CB40DC500C806FE /* TabBar.swift */; }; 96BCB7E31CB40DC500C806FE /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79A1CB40DC500C806FE /* TabBar.swift */; };
96BCB7E41CB40DC500C806FE /* Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79B1CB40DC500C806FE /* Text.swift */; }; 96BCB7E41CB40DC500C806FE /* Text.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96BCB79B1CB40DC500C806FE /* Text.swift */; };
...@@ -156,11 +155,10 @@ ...@@ -156,11 +155,10 @@
96BCB8351CB4115200C806FE /* MaterialTextLayer.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78A1CB40DC500C806FE /* MaterialTextLayer.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8351CB4115200C806FE /* MaterialTextLayer.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78A1CB40DC500C806FE /* MaterialTextLayer.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8361CB4115200C806FE /* Grid.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7611CB40DC500C806FE /* Grid.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8361CB4115200C806FE /* Grid.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7611CB40DC500C806FE /* Grid.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8371CB4115200C806FE /* Layout.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7811CB40DC500C806FE /* Layout.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8371CB4115200C806FE /* Layout.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7811CB40DC500C806FE /* Layout.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8381CB4115200C806FE /* ContentView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB75E1CB40DC500C806FE /* ContentView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7951CB40DC500C806FE /* SearchBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7961CB40DC500C806FE /* SearchBarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83C1CB4115200C806FE /* BarView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* BarView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83C1CB4115200C806FE /* Bar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7981CB40DC500C806FE /* Bar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83D1CB4115200C806FE /* RootController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* RootController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83D1CB4115200C806FE /* RootController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB7991CB40DC500C806FE /* RootController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB83F1CB4115200C806FE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78E1CB40DC500C806FE /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB83F1CB4115200C806FE /* Menu.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78E1CB40DC500C806FE /* Menu.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96BCB8401CB4115200C806FE /* MenuController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78F1CB40DC500C806FE /* MenuController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96BCB8401CB4115200C806FE /* MenuController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BCB78F1CB40DC500C806FE /* MenuController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
...@@ -252,7 +250,6 @@ ...@@ -252,7 +250,6 @@
96BCB75B1CB40DC500C806FE /* CaptureSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureSession.swift; sourceTree = "<group>"; }; 96BCB75B1CB40DC500C806FE /* CaptureSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CaptureSession.swift; sourceTree = "<group>"; };
96BCB75C1CB40DC500C806FE /* Capture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capture.swift; sourceTree = "<group>"; }; 96BCB75C1CB40DC500C806FE /* Capture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Capture.swift; sourceTree = "<group>"; };
96BCB75D1CB40DC500C806FE /* Card.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = "<group>"; }; 96BCB75D1CB40DC500C806FE /* Card.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = "<group>"; };
96BCB75E1CB40DC500C806FE /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
96BCB75F1CB40DC500C806FE /* FabButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FabButton.swift; sourceTree = "<group>"; }; 96BCB75F1CB40DC500C806FE /* FabButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FabButton.swift; sourceTree = "<group>"; };
96BCB7601CB40DC500C806FE /* FlatButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlatButton.swift; sourceTree = "<group>"; }; 96BCB7601CB40DC500C806FE /* FlatButton.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlatButton.swift; sourceTree = "<group>"; };
96BCB7611CB40DC500C806FE /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; }; 96BCB7611CB40DC500C806FE /* Grid.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Grid.swift; sourceTree = "<group>"; };
...@@ -301,7 +298,7 @@ ...@@ -301,7 +298,7 @@
96BCB7951CB40DC500C806FE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; }; 96BCB7951CB40DC500C806FE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
96BCB7961CB40DC500C806FE /* SearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarController.swift; sourceTree = "<group>"; }; 96BCB7961CB40DC500C806FE /* SearchBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBarController.swift; sourceTree = "<group>"; };
96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationDrawerController.swift; sourceTree = "<group>"; }; 96BCB7971CB40DC500C806FE /* NavigationDrawerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationDrawerController.swift; sourceTree = "<group>"; };
96BCB7981CB40DC500C806FE /* BarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarView.swift; sourceTree = "<group>"; }; 96BCB7981CB40DC500C806FE /* Bar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Bar.swift; sourceTree = "<group>"; };
96BCB7991CB40DC500C806FE /* RootController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootController.swift; sourceTree = "<group>"; }; 96BCB7991CB40DC500C806FE /* RootController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RootController.swift; sourceTree = "<group>"; };
96BCB79A1CB40DC500C806FE /* TabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; }; 96BCB79A1CB40DC500C806FE /* TabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
96BCB79B1CB40DC500C806FE /* Text.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Text.swift; sourceTree = "<group>"; }; 96BCB79B1CB40DC500C806FE /* Text.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Text.swift; sourceTree = "<group>"; };
...@@ -368,12 +365,12 @@ ...@@ -368,12 +365,12 @@
name = Divider; name = Divider;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96264BE41D833C8400576F37 /* BarView */ = { 96264BE41D833C8400576F37 /* Bar */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96BCB7981CB40DC500C806FE /* BarView.swift */, 96BCB7981CB40DC500C806FE /* Bar.swift */,
); );
name = BarView; name = Bar;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
96264BE51D833CFF00576F37 /* Reminders */ = { 96264BE51D833CFF00576F37 /* Reminders */ = {
...@@ -500,14 +497,6 @@ ...@@ -500,14 +497,6 @@
name = SearchBar; name = SearchBar;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
963FBF061D669795008F8512 /* ContentView */ = {
isa = PBXGroup;
children = (
96BCB75E1CB40DC500C806FE /* ContentView.swift */,
);
name = ContentView;
sourceTree = "<group>";
};
9661222C1D3EC414008BB4CB /* macOS */ = { 9661222C1D3EC414008BB4CB /* macOS */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -560,14 +549,13 @@ ...@@ -560,14 +549,13 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96BCB8091CB4107700C806FE /* Animation */, 96BCB8091CB4107700C806FE /* Animation */,
96264BE41D833C8400576F37 /* BarView */, 96264BE41D833C8400576F37 /* Bar */,
962DDD081D6FBBD0001C307C /* BottomTabBar */, 962DDD081D6FBBD0001C307C /* BottomTabBar */,
96BCB8031CB40F4B00C806FE /* Button */, 96BCB8031CB40F4B00C806FE /* Button */,
96BCB8021CB40F3B00C806FE /* Card */, 96BCB8021CB40F3B00C806FE /* Card */,
96BCB7FF1CB40EF000C806FE /* Capture */, 96BCB7FF1CB40EF000C806FE /* Capture */,
96264C0C1D84050200576F37 /* Checkbox */, 96264C0C1D84050200576F37 /* Checkbox */,
96BCB8051CB40F9C00C806FE /* Collection */, 96BCB8051CB40F9C00C806FE /* Collection */,
963FBF061D669795008F8512 /* ContentView */,
96BCB8001CB40F0300C806FE /* Color */, 96BCB8001CB40F0300C806FE /* Color */,
962A92581D42839100DBAF8E /* Data */, 962A92581D42839100DBAF8E /* Data */,
96BCB80B1CB410CC00C806FE /* Device */, 96BCB80B1CB410CC00C806FE /* Device */,
...@@ -854,11 +842,10 @@ ...@@ -854,11 +842,10 @@
96BCB8351CB4115200C806FE /* MaterialTextLayer.swift in Headers */, 96BCB8351CB4115200C806FE /* MaterialTextLayer.swift in Headers */,
96BCB8361CB4115200C806FE /* Grid.swift in Headers */, 96BCB8361CB4115200C806FE /* Grid.swift in Headers */,
96BCB8371CB4115200C806FE /* Layout.swift in Headers */, 96BCB8371CB4115200C806FE /* Layout.swift in Headers */,
96BCB8381CB4115200C806FE /* ContentView.swift in Headers */,
96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */, 96BCB8391CB4115200C806FE /* SearchBar.swift in Headers */,
96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */, 96BCB83A1CB4115200C806FE /* SearchBarController.swift in Headers */,
96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */, 96BCB83B1CB4115200C806FE /* NavigationDrawerController.swift in Headers */,
96BCB83C1CB4115200C806FE /* BarView.swift in Headers */, 96BCB83C1CB4115200C806FE /* Bar.swift in Headers */,
96BCB83D1CB4115200C806FE /* RootController.swift in Headers */, 96BCB83D1CB4115200C806FE /* RootController.swift in Headers */,
96BCB83F1CB4115200C806FE /* Menu.swift in Headers */, 96BCB83F1CB4115200C806FE /* Menu.swift in Headers */,
96BCB8401CB4115200C806FE /* MenuController.swift in Headers */, 96BCB8401CB4115200C806FE /* MenuController.swift in Headers */,
...@@ -1136,7 +1123,7 @@ ...@@ -1136,7 +1123,7 @@
96BCB7E71CB40DC500C806FE /* TextView.swift in Sources */, 96BCB7E71CB40DC500C806FE /* TextView.swift in Sources */,
96BCB7C31CB40DC500C806FE /* EdgeInsets.swift in Sources */, 96BCB7C31CB40DC500C806FE /* EdgeInsets.swift in Sources */,
96BCB7CE1CB40DC500C806FE /* CornerRadius.swift in Sources */, 96BCB7CE1CB40DC500C806FE /* CornerRadius.swift in Sources */,
96BCB7E11CB40DC500C806FE /* BarView.swift in Sources */, 96BCB7E11CB40DC500C806FE /* Bar.swift in Sources */,
96BCB7A11CB40DC500C806FE /* BottomNavigationController.swift in Sources */, 96BCB7A11CB40DC500C806FE /* BottomNavigationController.swift in Sources */,
96BCB7D81CB40DC500C806FE /* MenuController.swift in Sources */, 96BCB7D81CB40DC500C806FE /* MenuController.swift in Sources */,
96BCB7D41CB40DC500C806FE /* TransitionAnimation.swift in Sources */, 96BCB7D41CB40DC500C806FE /* TransitionAnimation.swift in Sources */,
...@@ -1164,7 +1151,6 @@ ...@@ -1164,7 +1151,6 @@
96BCB7D21CB40DC500C806FE /* TableViewCell.swift in Sources */, 96BCB7D21CB40DC500C806FE /* TableViewCell.swift in Sources */,
96F1DC881D654FDF0025F925 /* Material+CALayer.swift in Sources */, 96F1DC881D654FDF0025F925 /* Material+CALayer.swift in Sources */,
96BCB7B61CB40DC500C806FE /* Animation.swift in Sources */, 96BCB7B61CB40DC500C806FE /* Animation.swift in Sources */,
96BCB7A71CB40DC500C806FE /* ContentView.swift in Sources */,
96BCB7DB1CB40DC500C806FE /* NavigationItem.swift in Sources */, 96BCB7DB1CB40DC500C806FE /* NavigationItem.swift in Sources */,
96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */, 96BCB7E01CB40DC500C806FE /* NavigationDrawerController.swift in Sources */,
9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */, 9628645F1D540AF300690B69 /* DynamicFontType.swift in Sources */,
......
...@@ -36,7 +36,7 @@ public enum ContentViewAlignment: Int { ...@@ -36,7 +36,7 @@ public enum ContentViewAlignment: Int {
case center case center
} }
open class ContentView: View { open class Bar: View {
/// Should center the contentView. /// Should center the contentView.
open var contentViewAlignment = ContentViewAlignment.any { open var contentViewAlignment = ContentViewAlignment.any {
didSet { didSet {
...@@ -101,6 +101,9 @@ open class ContentView: View { ...@@ -101,6 +101,9 @@ open class ContentView: View {
} }
} }
/// Divider layer.
open internal(set) var divider: Divider!
/// ContentView that holds the any desired subviews. /// ContentView that holds the any desired subviews.
open private(set) lazy var contentView = View() open private(set) lazy var contentView = View()
...@@ -216,6 +219,8 @@ open class ContentView: View { ...@@ -216,6 +219,8 @@ open class ContentView: View {
grid.commit() grid.commit()
contentView.grid.commit() contentView.grid.commit()
divider.reload()
} }
/** /**
...@@ -228,10 +233,16 @@ open class ContentView: View { ...@@ -228,10 +233,16 @@ open class ContentView: View {
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
prepareContentView() prepareContentView()
prepareDivider()
} }
/// Prepares the contentView. /// Prepares the contentView.
private func prepareContentView() { private func prepareContentView() {
contentView.backgroundColor = nil contentView.backgroundColor = nil
} }
/// Prepares the divider.
private func prepareDivider() {
divider = Divider(view: self)
}
} }
...@@ -90,7 +90,7 @@ open class ContentCard: PulseView { ...@@ -90,7 +90,7 @@ open class ContentCard: PulseView {
} }
/// A reference to the bottomBar. /// A reference to the bottomBar.
open var bottomBar: BarView? { open var bottomBar: Bar? {
didSet { didSet {
layoutSubviews() layoutSubviews()
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
import UIKit import UIKit
open class SearchBar: BarView { open class SearchBar: Bar {
/// The UITextField for the searchBar. /// The UITextField for the searchBar.
open private(set) lazy var textField = UITextField() open private(set) lazy var textField = UITextField()
......
...@@ -36,7 +36,7 @@ public enum SnackbarStatus: Int { ...@@ -36,7 +36,7 @@ public enum SnackbarStatus: Int {
case hidden case hidden
} }
open class Snackbar: BarView { open class Snackbar: Bar {
/// A convenience property to set the titleLabel text. /// A convenience property to set the titleLabel text.
open var text: String? { open var text: String? {
get { get {
......
...@@ -49,8 +49,8 @@ extension UIViewController { ...@@ -49,8 +49,8 @@ extension UIViewController {
} }
open class StatusBarController: RootController { open class StatusBarController: RootController {
/// A reference to the statusBarView. /// A reference to the statusBar.
open private(set) lazy var statusBarView = View() open private(set) lazy var statusBar = View()
/** /**
To execute in the order of the layout chain, override this To execute in the order of the layout chain, override this
...@@ -59,7 +59,7 @@ open class StatusBarController: RootController { ...@@ -59,7 +59,7 @@ open class StatusBarController: RootController {
*/ */
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()
statusBarView.isHidden = Device.isLandscape && .phone == Device.userInterfaceIdiom statusBar.isHidden = Device.isLandscape && .phone == Device.userInterfaceIdiom
rootViewController.view.frame = view.bounds rootViewController.view.frame = view.bounds
} }
...@@ -72,13 +72,13 @@ open class StatusBarController: RootController { ...@@ -72,13 +72,13 @@ open class StatusBarController: RootController {
*/ */
open override func prepare() { open override func prepare() {
super.prepare() super.prepare()
prepareStatusBarView() prepareStatusBar()
} }
/// Prepares the statusBarView. /// Prepares the statusBar.
private func prepareStatusBarView() { private func prepareStatusBar() {
statusBarView.zPosition = 3000 statusBar.zPosition = 3000
statusBarView.backgroundColor = Color.black.withAlphaComponent(0.12) statusBar.backgroundColor = Color.black.withAlphaComponent(0.12)
view.layout(statusBarView).top(0).horizontally().height(20) view.layout(statusBar).top().horizontally().height(20)
} }
} }
...@@ -57,7 +57,7 @@ public protocol TabBarDelegate { ...@@ -57,7 +57,7 @@ public protocol TabBarDelegate {
optional func tabBarDidSelectButton(tabBar: TabBar, button: UIButton) optional func tabBarDidSelectButton(tabBar: TabBar, button: UIButton)
} }
open class TabBar: BarView { open class TabBar: Bar {
/// A boolean indicating if the TabBar line is in an animation state. /// A boolean indicating if the TabBar line is in an animation state.
open internal(set) var isAnimating = false open internal(set) var isAnimating = false
......
...@@ -32,7 +32,7 @@ import UIKit ...@@ -32,7 +32,7 @@ import UIKit
private var ToolbarContext: UInt8 = 0 private var ToolbarContext: UInt8 = 0
open class Toolbar: BarView { open class Toolbar: Bar {
/// A convenience property to set the titleLabel text. /// A convenience property to set the titleLabel text.
open var title: String? { open var title: String? {
get { get {
......
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