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