Commit 71b92d5c by Daniel Dahan

development: added convenience CALayer backgroundColor property called bgColor…

development: added convenience CALayer backgroundColor property called bgColor to avoid dealing with cgColor
parent 29c8b327
......@@ -110,6 +110,7 @@
TargetAttributes = {
96784F6F1D901FB90061C06C = {
CreatedOnToolsVersion = 8.0;
DevelopmentTeam = 9Z76XCNLGL;
ProvisioningStyle = Automatic;
};
};
......@@ -266,7 +267,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9Z76XCNLGL;
INFOPLIST_FILE = CaptureController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.CaptureController;
......@@ -279,7 +280,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 9Z76XCNLGL;
INFOPLIST_FILE = CaptureController/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.CaptureController;
......
......@@ -46,7 +46,7 @@ class AppCaptureController: CaptureController {
toolbar.detailLabel.isHidden = true
toolbar.detail = "Recording"
toolbar.detailLabel.textColor = red.accent1
toolbar.detailLabel.textColor = Color.red.accent1
toolbar.leftViews = [switchCamerasButton]
toolbar.rightViews = [flashButton]
......@@ -55,7 +55,7 @@ class AppCaptureController: CaptureController {
private func prepareCaptureButton() {
captureButton.width = 72
captureButton.height = 72
captureButton.backgroundColor = red.darken1.withAlphaComponent(0.3)
captureButton.backgroundColor = Color.red.darken1.withAlphaComponent(0.3)
captureButton.borderColor = .white
captureButton.borderWidthPreset = .border3
captureButton.depthPreset = .none
......
......@@ -49,7 +49,7 @@ class ViewController: UIViewController {
layer = Layer(frame: CGRect(x: (w - d) / 2, y: (h - d) / 2, width: d, height: d))
layer.depthPreset = .depth3
layer.shapePreset = .circle
layer.backgroundColor = Color.white.cgColor
layer.bgColor = .white
layer.image = UIImage(named: "CosmicMind")
view.layer.addSublayer(layer)
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.1.2'
s.version = '2.2.0'
s.license = 'BSD-3-Clause'
s.summary = 'Material is an animation and graphics framework that is used to create beautiful applications.'
s.homepage = 'http://cosmicmind.io'
......
......@@ -1204,8 +1204,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -1256,8 +1258,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
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_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
......@@ -1279,6 +1283,7 @@
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = Material;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
......@@ -1293,7 +1298,7 @@
CLANG_ANALYZER_OBJC_UNUSED_IVARS = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
......@@ -1318,7 +1323,7 @@
CLANG_ANALYZER_OBJC_UNUSED_IVARS = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
......@@ -1382,7 +1387,7 @@
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
DEFINES_MODULE = YES;
......@@ -1407,7 +1412,7 @@
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "";
COMBINE_HIDPI_IMAGES = YES;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.1.2</string>
<string>2.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -79,7 +79,7 @@ open class Button: UIButton {
@IBInspectable
open override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
......@@ -89,11 +89,17 @@ open class CaptureController: ToolbarController, CaptureDelegate, CaptureSession
view.backgroundColor = .black
display = .full
prepareStatusBar()
prepareToolbar()
prepareCapture()
}
/// Prepares the Toolbar.
/// Prepares the statusBar.
private func prepareStatusBar() {
statusBar.backgroundColor = .clear
}
/// Prepares the toolbar.
private func prepareToolbar() {
toolbar.backgroundColor = .clear
toolbar.depthPreset = .none
......
......@@ -70,7 +70,7 @@ open class CapturePreview: View {
/// Prepares the previewLayer.
private func preparePreviewLayer() {
layer.backgroundColor = Color.black.cgColor
layer.bgColor = .black
layer.masksToBounds = true
(layer as! AVCaptureVideoPreviewLayer).videoGravity = AVLayerVideoGravityResizeAspectFill
}
......
......@@ -186,7 +186,7 @@ open class CollectionReusableView: UICollectionReusableView {
/// A property that accesses the backing layer's background
@IBInspectable open override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
......@@ -193,7 +193,7 @@ open class CollectionViewCell: UICollectionViewCell {
@IBInspectable
open override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
......@@ -248,13 +248,13 @@ extension CALayer {
}
}
/// A UIColor reference to the `backgroundcgColor`.
open var color: UIColor? {
/// A UIColor reference to the `backgroundColor`.
open var bgColor: UIColor? {
get {
return nil == backgroundColor ? nil : UIColor(cgColor: backgroundColor!)
}
set(value) {
backgroundColor = color?.cgColor
backgroundColor = bgColor?.cgColor
}
}
......
......@@ -81,7 +81,7 @@ internal extension Animation {
}
pLayer.cornerRadius = n / 2
pLayer.backgroundColor = pulse.color.withAlphaComponent(pulse.opacity).cgColor
pLayer.bgColor = pulse.color.withAlphaComponent(pulse.opacity)
pLayer.transform = CATransform3DMakeAffineTransform(CGAffineTransform(scaleX: 0, y: 0))
})
......
......@@ -78,7 +78,7 @@ open class TableViewCell: UITableViewCell {
@IBInspectable
open override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
......@@ -38,7 +38,7 @@ public class TextView: UITextView {
/// A property that accesses the backing layer's background
@IBInspectable public override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
......@@ -120,7 +120,7 @@ open class View: UIView {
@IBInspectable
open override var backgroundColor: UIColor? {
didSet {
layer.backgroundColor = backgroundColor?.cgColor
layer.bgColor = backgroundColor
}
}
......
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