Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2055059a2 | ||
|
|
6245b8be13 | ||
|
|
50d92f3c3b | ||
|
|
afddd1e959 | ||
|
|
52ac833f7c | ||
|
|
49e429c393 | ||
|
|
0c0c28a31d |
No files matched your search
@@ -10,12 +10,14 @@
|
|||||||
#import "GradientButton.h"
|
#import "GradientButton.h"
|
||||||
#import "PureLayout/PureLayout.h"
|
#import "PureLayout/PureLayout.h"
|
||||||
|
|
||||||
|
|
||||||
@interface gradiendButtonViewController () {
|
@interface gradiendButtonViewController () {
|
||||||
|
|
||||||
GradientButton *button;
|
GradientButton *button;
|
||||||
GradientButton *autoLayoutButton;
|
GradientButton *autoLayoutButton;
|
||||||
BOOL didUpdateConstraints;
|
BOOL didUpdateConstraints;
|
||||||
|
|
||||||
|
UIButton *presentControllerButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -42,6 +44,13 @@
|
|||||||
|
|
||||||
[self.view addSubview:autoLayoutButton];
|
[self.view addSubview:autoLayoutButton];
|
||||||
|
|
||||||
|
presentControllerButton = [UIButton newAutoLayoutView];
|
||||||
|
[presentControllerButton setTitle:@"Presenta Conttoller" forState:UIControlStateNormal];
|
||||||
|
[presentControllerButton addTarget:self action:@selector(presentAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[presentControllerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
||||||
|
|
||||||
|
[self.view addSubview:presentControllerButton];
|
||||||
|
|
||||||
// Do any additional setup after loading the view, typically from a nib.
|
// Do any additional setup after loading the view, typically from a nib.
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,11 +107,26 @@
|
|||||||
[autoLayoutButton autoPinEdgeToSuperviewEdge:ALEdgeTrailing withInset:40];
|
[autoLayoutButton autoPinEdgeToSuperviewEdge:ALEdgeTrailing withInset:40];
|
||||||
[autoLayoutButton autoSetDimension:ALDimensionHeight toSize:50];
|
[autoLayoutButton autoSetDimension:ALDimensionHeight toSize:50];
|
||||||
|
|
||||||
|
[presentControllerButton autoMatchDimension:ALDimensionHeight toDimension:ALDimensionHeight ofView:autoLayoutButton];
|
||||||
|
[presentControllerButton autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:autoLayoutButton];
|
||||||
|
[presentControllerButton autoPinEdge:ALEdgeTop toEdge:ALEdgeBottom ofView:autoLayoutButton];
|
||||||
|
[presentControllerButton autoAlignAxisToSuperviewAxis:ALAxisVertical];
|
||||||
|
|
||||||
didUpdateConstraints = YES;
|
didUpdateConstraints = YES;
|
||||||
}
|
}
|
||||||
[super updateViewConstraints];
|
[super updateViewConstraints];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) presentAction:(UIButton *) sender {
|
||||||
|
gradiendButtonViewController *viewController = [[gradiendButtonViewController alloc] init];
|
||||||
|
|
||||||
|
[self presentViewController:viewController animated:YES completion:nil];
|
||||||
|
|
||||||
|
|
||||||
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||||
|
[viewController dismissViewControllerAnimated:YES completion:nil];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
- (void)didReceiveMemoryWarning
|
- (void)didReceiveMemoryWarning
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ PODS:
|
|||||||
- FBSnapshotTestCase/Core (2.1.0)
|
- FBSnapshotTestCase/Core (2.1.0)
|
||||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
||||||
- FBSnapshotTestCase/Core
|
- FBSnapshotTestCase/Core
|
||||||
- GradientButton (0.1.4)
|
- GradientButton (0.2.0):
|
||||||
|
- PureLayout
|
||||||
- PureLayout (3.0.1)
|
- PureLayout (3.0.1)
|
||||||
- Specta (1.0.5)
|
- Specta (1.0.5)
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ SPEC CHECKSUMS:
|
|||||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
||||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
||||||
GradientButton: 44bc0921357db40e4860b3e6af5d1fe54078e800
|
GradientButton: 7be2c4bc564d0cfe7c3043a4410723d95050cc0d
|
||||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
||||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||||
|
|
||||||
|
|||||||
+8
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "GradientButton",
|
"name": "GradientButton",
|
||||||
"version": "0.1.4",
|
"version": "0.2.0",
|
||||||
"summary": "GradientButton is a UIBUtton subclassing with gradient support",
|
"summary": "GradientButton is a UIBUtton subclassing with gradient support",
|
||||||
"homepage": "https://github.com/giuseppenucifora/GradientButton",
|
"homepage": "https://github.com/giuseppenucifora/GradientButton",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"source": {
|
"source": {
|
||||||
"git": "https://github.com/giuseppenucifora/GradientButton.git",
|
"git": "https://github.com/giuseppenucifora/GradientButton.git",
|
||||||
"tag": "0.1.4"
|
"tag": "0.2.0"
|
||||||
},
|
},
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"ios": "7.0"
|
"ios": "7.0"
|
||||||
@@ -21,5 +21,10 @@
|
|||||||
"Pod/Assets/*.png"
|
"Pod/Assets/*.png"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"frameworks": "QuartzCore"
|
"frameworks": "QuartzCore",
|
||||||
|
"dependencies": {
|
||||||
|
"PureLayout": [
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Generated
+3
-2
@@ -9,7 +9,8 @@ PODS:
|
|||||||
- FBSnapshotTestCase/Core (2.1.0)
|
- FBSnapshotTestCase/Core (2.1.0)
|
||||||
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
- FBSnapshotTestCase/SwiftSupport (2.1.0):
|
||||||
- FBSnapshotTestCase/Core
|
- FBSnapshotTestCase/Core
|
||||||
- GradientButton (0.1.4)
|
- GradientButton (0.2.0):
|
||||||
|
- PureLayout
|
||||||
- PureLayout (3.0.1)
|
- PureLayout (3.0.1)
|
||||||
- Specta (1.0.5)
|
- Specta (1.0.5)
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ SPEC CHECKSUMS:
|
|||||||
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
Expecta: e1c022fcd33910b6be89c291d2775b3fe27a89fe
|
||||||
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
Expecta+Snapshots: c343f410c7a6392f3e22e78f94c44b6c0749a516
|
||||||
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
FBSnapshotTestCase: 366ecd378511d7716c79991cd8067d1eed23578d
|
||||||
GradientButton: 44bc0921357db40e4860b3e6af5d1fe54078e800
|
GradientButton: 7be2c4bc564d0cfe7c3043a4410723d95050cc0d
|
||||||
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
PureLayout: f35f5384c9c4e4479df041dbe33ad7577b71ddfb
|
||||||
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
Specta: ac94d110b865115fe60ff2c6d7281053c6f8e8a2
|
||||||
|
|
||||||
|
|||||||
+1237
-1165
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -14,7 +14,7 @@
|
|||||||
buildForArchiving = "YES">
|
buildForArchiving = "YES">
|
||||||
<BuildableReference
|
<BuildableReference
|
||||||
BuildableIdentifier = 'primary'
|
BuildableIdentifier = 'primary'
|
||||||
BlueprintIdentifier = '71AFE04B13EC9CD3D9995CD6'
|
BlueprintIdentifier = 'A005A3C52F8B1643B0539EAB'
|
||||||
BlueprintName = 'GradientButton'
|
BlueprintName = 'GradientButton'
|
||||||
ReferencedContainer = 'container:Pods.xcodeproj'
|
ReferencedContainer = 'container:Pods.xcodeproj'
|
||||||
BuildableName = 'GradientButton.framework'>
|
BuildableName = 'GradientButton.framework'>
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>0.1.4</string>
|
<string>0.2.0</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
|
|||||||
+13
@@ -24,6 +24,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
## PureLayout
|
||||||
|
|
||||||
|
This code is distributed under the terms and conditions of the MIT license.
|
||||||
|
|
||||||
|
Copyright (c) 2014-2015 Tyler Fox
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
## Expecta
|
## Expecta
|
||||||
|
|
||||||
Copyright (c) 2011-2015 Specta Team - https://github.com/specta
|
Copyright (c) 2011-2015 Specta Team - https://github.com/specta
|
||||||
|
|||||||
+17
@@ -39,6 +39,23 @@ THE SOFTWARE.
|
|||||||
<key>Type</key>
|
<key>Type</key>
|
||||||
<string>PSGroupSpecifier</string>
|
<string>PSGroupSpecifier</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>FooterText</key>
|
||||||
|
<string>This code is distributed under the terms and conditions of the MIT license.
|
||||||
|
|
||||||
|
Copyright (c) 2014-2015 Tyler Fox
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
</string>
|
||||||
|
<key>Title</key>
|
||||||
|
<string>PureLayout</string>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>PSGroupSpecifier</string>
|
||||||
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
<key>FooterText</key>
|
<key>FooterText</key>
|
||||||
<string>Copyright (c) 2011-2015 Specta Team - https://github.com/specta
|
<string>Copyright (c) 2011-2015 Specta Team - https://github.com/specta
|
||||||
|
|||||||
Generated
+2
@@ -85,6 +85,7 @@ strip_invalid_archs() {
|
|||||||
|
|
||||||
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
if [[ "$CONFIGURATION" == "Debug" ]]; then
|
||||||
install_framework "Pods-GradientButton_Tests/GradientButton.framework"
|
install_framework "Pods-GradientButton_Tests/GradientButton.framework"
|
||||||
|
install_framework "Pods-GradientButton_Tests/PureLayout.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/Expecta.framework"
|
install_framework "Pods-GradientButton_Tests/Expecta.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/Expecta_Snapshots.framework"
|
install_framework "Pods-GradientButton_Tests/Expecta_Snapshots.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/FBSnapshotTestCase.framework"
|
install_framework "Pods-GradientButton_Tests/FBSnapshotTestCase.framework"
|
||||||
@@ -92,6 +93,7 @@ if [[ "$CONFIGURATION" == "Debug" ]]; then
|
|||||||
fi
|
fi
|
||||||
if [[ "$CONFIGURATION" == "Release" ]]; then
|
if [[ "$CONFIGURATION" == "Release" ]]; then
|
||||||
install_framework "Pods-GradientButton_Tests/GradientButton.framework"
|
install_framework "Pods-GradientButton_Tests/GradientButton.framework"
|
||||||
|
install_framework "Pods-GradientButton_Tests/PureLayout.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/Expecta.framework"
|
install_framework "Pods-GradientButton_Tests/Expecta.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/Expecta_Snapshots.framework"
|
install_framework "Pods-GradientButton_Tests/Expecta_Snapshots.framework"
|
||||||
install_framework "Pods-GradientButton_Tests/FBSnapshotTestCase.framework"
|
install_framework "Pods-GradientButton_Tests/FBSnapshotTestCase.framework"
|
||||||
|
|||||||
Example/Pods/Target Support Files/Pods-GradientButton_Tests/Pods-GradientButton_Tests.debug.xcconfig
Generated
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/GradientButton.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/GradientButton.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PureLayout.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "GradientButton" -framework "Specta"
|
OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "GradientButton" -framework "PureLayout" -framework "Specta"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GradientButton_Tests
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GradientButton_Tests
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
|
||||||
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
|
||||||
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/GradientButton.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers"
|
OTHER_CFLAGS = $(inherited) -iquote "$CONFIGURATION_BUILD_DIR/Expecta.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Expecta_Snapshots.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/FBSnapshotTestCase.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/GradientButton.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/PureLayout.framework/Headers" -iquote "$CONFIGURATION_BUILD_DIR/Specta.framework/Headers"
|
||||||
OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "GradientButton" -framework "Specta"
|
OTHER_LDFLAGS = $(inherited) -framework "Expecta" -framework "Expecta_Snapshots" -framework "FBSnapshotTestCase" -framework "GradientButton" -framework "PureLayout" -framework "Specta"
|
||||||
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
|
||||||
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GradientButton_Tests
|
PODS_FRAMEWORK_BUILD_PATH = $(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-GradientButton_Tests
|
||||||
PODS_ROOT = ${SRCROOT}/Pods
|
PODS_ROOT = ${SRCROOT}/Pods
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = "GradientButton"
|
s.name = "GradientButton"
|
||||||
s.version = "0.1.4"
|
s.version = "0.2.0"
|
||||||
s.summary = "GradientButton is a UIBUtton subclassing with gradient support"
|
s.summary = "GradientButton is a UIBUtton subclassing with gradient support"
|
||||||
|
|
||||||
# This description is used to generate tags and improve search results.
|
# This description is used to generate tags and improve search results.
|
||||||
@@ -34,5 +34,5 @@ s.resource_bundles = {
|
|||||||
|
|
||||||
# s.public_header_files = 'Pod/Classes/**/*.h'
|
# s.public_header_files = 'Pod/Classes/**/*.h'
|
||||||
s.frameworks = 'QuartzCore'
|
s.frameworks = 'QuartzCore'
|
||||||
# s.dependency 'AFNetworking', '~> 2.3'
|
s.dependency 'PureLayout'
|
||||||
end
|
end
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "GradientButton.h"
|
#import "GradientButton.h"
|
||||||
|
#import "PureLayout.h"
|
||||||
|
|
||||||
@interface GradientButton()
|
@interface GradientButton()
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@
|
|||||||
- (instancetype) init {
|
- (instancetype) init {
|
||||||
self = [super init];
|
self = [super init];
|
||||||
if (self) {
|
if (self) {
|
||||||
[self addObserver:self forKeyPath:@"bounds" options:0 context:nil];
|
|
||||||
_colors = [[NSMutableArray alloc] init];
|
_colors = [[NSMutableArray alloc] init];
|
||||||
_cgColors = [[NSMutableArray alloc] init];
|
_cgColors = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
@@ -34,7 +35,6 @@
|
|||||||
- (instancetype) initWithCoder:(NSCoder *)aDecoder {
|
- (instancetype) initWithCoder:(NSCoder *)aDecoder {
|
||||||
self = [super initWithCoder:aDecoder];
|
self = [super initWithCoder:aDecoder];
|
||||||
if (self) {
|
if (self) {
|
||||||
[self addObserver:self forKeyPath:@"bounds" options:0 context:nil];
|
|
||||||
_colors = [[NSMutableArray alloc] init];
|
_colors = [[NSMutableArray alloc] init];
|
||||||
_cgColors = [[NSMutableArray alloc] init];
|
_cgColors = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
@@ -44,35 +44,12 @@
|
|||||||
- (instancetype) initWithFrame:(CGRect)frame {
|
- (instancetype) initWithFrame:(CGRect)frame {
|
||||||
self = [super initWithFrame:frame];
|
self = [super initWithFrame:frame];
|
||||||
if (self) {
|
if (self) {
|
||||||
[self addObserver:self forKeyPath:@"bounds" options:0 context:nil];
|
|
||||||
_colors = [[NSMutableArray alloc] init];
|
_colors = [[NSMutableArray alloc] init];
|
||||||
_cgColors = [[NSMutableArray alloc] init];
|
_cgColors = [[NSMutableArray alloc] init];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
// Only override drawRect: if you perform custom drawing.
|
|
||||||
// An empty implementation adversely affects performance during animation.
|
|
||||||
- (void)drawRect:(CGRect)rect {
|
|
||||||
// Drawing code
|
|
||||||
}
|
|
||||||
|
|
||||||
UIColor *topColor = [@"fd843e" colorFromHex];
|
|
||||||
UIColor *bottomColor = [@"ff4e50" colorFromHex];
|
|
||||||
|
|
||||||
CAGradientLayer *checkoutButtonViewGradient = [CAGradientLayer layer];
|
|
||||||
checkoutButtonViewGradient.colors = [NSArray arrayWithObjects: (id)topColor.CGColor, (id)bottomColor.CGColor, nil];
|
|
||||||
checkoutButtonViewGradient.frame = _checkoutButton.bounds;
|
|
||||||
checkoutButtonViewGradient.startPoint = CGPointMake(0, 0);
|
|
||||||
|
|
||||||
[_checkoutButton.layer insertSublayer:checkoutButtonViewGradient atIndex:0];
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void) setbackgroundLayerWithColors:(NSArray *) colors startPoint:(CGPoint) startPoint {
|
- (void) setbackgroundLayerWithColors:(NSArray *) colors startPoint:(CGPoint) startPoint {
|
||||||
if (colors && [colors count] > 0) {
|
if (colors && [colors count] > 0) {
|
||||||
_colors = [[NSMutableArray alloc] initWithArray:colors];
|
_colors = [[NSMutableArray alloc] initWithArray:colors];
|
||||||
@@ -112,6 +89,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (void) setFrame:(CGRect)frame {
|
- (void) setFrame:(CGRect)frame {
|
||||||
[super setFrame:frame];
|
[super setFrame:frame];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
@@ -135,18 +114,10 @@
|
|||||||
{
|
{
|
||||||
if (object == self && [keyPath isEqualToString:@"bounds"]) {
|
if (object == self && [keyPath isEqualToString:@"bounds"]) {
|
||||||
if(_gradientLayer) {
|
if(_gradientLayer) {
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[self setbackgroundLayerWithColors:_colors startPoint:_startPoint];
|
[self setbackgroundLayerWithColors:_colors startPoint:_startPoint];
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) dealloc {
|
|
||||||
|
|
||||||
[self removeObserver:self forKeyPath:@"bounds"];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
Reference in new issue
Block a user