Group and license file

This commit is contained in:
Victor Baro
2014-08-17 02:24:59 +01:00
parent cf162c7045
commit 6204d3ecd9
10 changed files with 132 additions and 24 deletions

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Victor Baro
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.

View File

@@ -1,3 +1,4 @@
platform :ios, '7.0'
pod 'UIColor+FlatColors'
pod 'pop'

25
VBFPopFlatButton.podspec Normal file
View File

@@ -0,0 +1,25 @@
Pod::Spec.new do |s|
s.name = 'VBFPopFlatButton'
s.version = '0.0.1'
s.summary = 'Animated flat button using POP'
s.homepage = 'https://github.com/iBaro/VBFPopFlatButton'
s.license = {
:type => 'MIT',
:file => 'LICENSE'
}
s.author = {
'Victor Baro' => 'dev.vbaro@gmail.com'
}
s.source = {
:git => 'https://github.com/iBaro/VBFPopFlatButton.git',
:tag => s.version.to_s
}
s.source_files = 'VBFPopFlatButton/VBFPopFlatButtonClasses/*.{m,h}'
s.requires_arc = true
s.dependency 'pop'
s.dependency 'UIColor+FlatColors'
s.platform = :ios, '7.0'
end

View File

@@ -8,12 +8,12 @@
/* Begin PBXBuildFile section */
42BE9306C051469DA9559016 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B20D85CE3AC647209454ADCD /* libPods.a */; };
C751BD0F199FC67C00EC7FD6 /* VBFPopFlatButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C751BD0D199FC67C00EC7FD6 /* VBFPopFlatButton.m */; };
C733771019A0370F001896CA /* VBFDoubleSegment.m in Sources */ = {isa = PBXBuildFile; fileRef = C733770D19A0370F001896CA /* VBFDoubleSegment.m */; };
C733771119A0370F001896CA /* VBFPopFlatButton.m in Sources */ = {isa = PBXBuildFile; fileRef = C733770F19A0370F001896CA /* VBFPopFlatButton.m */; };
C751BD14199FC72900EC7FD6 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C751BD13199FC72900EC7FD6 /* CoreGraphics.framework */; };
C751BD16199FC73400EC7FD6 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C751BD15199FC73400EC7FD6 /* UIKit.framework */; };
C751BD18199FC73E00EC7FD6 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C751BD17199FC73E00EC7FD6 /* Foundation.framework */; };
C754655B199FC84500B06B35 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C754655A199FC84500B06B35 /* QuartzCore.framework */; };
C754655E199FC8A100B06B35 /* VBFDoubleSegment.m in Sources */ = {isa = PBXBuildFile; fileRef = C754655D199FC8A100B06B35 /* VBFDoubleSegment.m */; };
C7C4924B199FC4A2004CAF5A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C4924A199FC4A2004CAF5A /* main.m */; };
C7C4924E199FC4A2004CAF5A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C4924D199FC4A2004CAF5A /* AppDelegate.m */; };
C7C49251199FC4A2004CAF5A /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C7C49250199FC4A2004CAF5A /* ViewController.m */; };
@@ -35,14 +35,14 @@
/* Begin PBXFileReference section */
0E4700CABFE446B7AB63DC37 /* Pods.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.xcconfig; path = Pods/Pods.xcconfig; sourceTree = "<group>"; };
B20D85CE3AC647209454ADCD /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
C751BD0C199FC67C00EC7FD6 /* VBFPopFlatButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VBFPopFlatButton.h; sourceTree = "<group>"; };
C751BD0D199FC67C00EC7FD6 /* VBFPopFlatButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VBFPopFlatButton.m; sourceTree = "<group>"; };
C733770C19A0370F001896CA /* VBFDoubleSegment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VBFDoubleSegment.h; path = VBFPopFlatButtonClasses/VBFDoubleSegment.h; sourceTree = "<group>"; };
C733770D19A0370F001896CA /* VBFDoubleSegment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VBFDoubleSegment.m; path = VBFPopFlatButtonClasses/VBFDoubleSegment.m; sourceTree = "<group>"; };
C733770E19A0370F001896CA /* VBFPopFlatButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VBFPopFlatButton.h; path = VBFPopFlatButtonClasses/VBFPopFlatButton.h; sourceTree = "<group>"; };
C733770F19A0370F001896CA /* VBFPopFlatButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VBFPopFlatButton.m; path = VBFPopFlatButtonClasses/VBFPopFlatButton.m; sourceTree = "<group>"; };
C751BD13199FC72900EC7FD6 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
C751BD15199FC73400EC7FD6 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
C751BD17199FC73E00EC7FD6 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
C754655A199FC84500B06B35 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
C754655C199FC8A100B06B35 /* VBFDoubleSegment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VBFDoubleSegment.h; sourceTree = "<group>"; };
C754655D199FC8A100B06B35 /* VBFDoubleSegment.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VBFDoubleSegment.m; sourceTree = "<group>"; };
C7C49245199FC4A2004CAF5A /* VBFPopFlatButton.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = VBFPopFlatButton.app; sourceTree = BUILT_PRODUCTS_DIR; };
C7C49249199FC4A2004CAF5A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C7C4924A199FC4A2004CAF5A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
@@ -95,10 +95,10 @@
C751BD10199FC68300EC7FD6 /* VBFPopFlatButton */ = {
isa = PBXGroup;
children = (
C751BD0C199FC67C00EC7FD6 /* VBFPopFlatButton.h */,
C751BD0D199FC67C00EC7FD6 /* VBFPopFlatButton.m */,
C754655C199FC8A100B06B35 /* VBFDoubleSegment.h */,
C754655D199FC8A100B06B35 /* VBFDoubleSegment.m */,
C733770C19A0370F001896CA /* VBFDoubleSegment.h */,
C733770D19A0370F001896CA /* VBFDoubleSegment.m */,
C733770E19A0370F001896CA /* VBFPopFlatButton.h */,
C733770F19A0370F001896CA /* VBFPopFlatButton.m */,
);
name = VBFPopFlatButton;
sourceTree = "<group>";
@@ -298,10 +298,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C733771119A0370F001896CA /* VBFPopFlatButton.m in Sources */,
C7C49251199FC4A2004CAF5A /* ViewController.m in Sources */,
C751BD0F199FC67C00EC7FD6 /* VBFPopFlatButton.m in Sources */,
C733771019A0370F001896CA /* VBFDoubleSegment.m in Sources */,
C7C4924E199FC4A2004CAF5A /* AppDelegate.m in Sources */,
C754655E199FC8A100B06B35 /* VBFDoubleSegment.m in Sources */,
C7C4924B199FC4A2004CAF5A /* main.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@@ -0,0 +1,41 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>2A502538-C87B-4387-9593-FAA5B008AA28</string>
<key>IDESourceControlProjectName</key>
<string>VBFPopFlatButton</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>A9382D58-F924-4E60-8E1E-4F41803E2677</key>
<string>ssh://github.com/iBaro/VBFPopFlatButton.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>VBFPopFlatButton.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>A9382D58-F924-4E60-8E1E-4F41803E2677</key>
<string>..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>ssh://github.com/iBaro/VBFPopFlatButton.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>A9382D58-F924-4E60-8E1E-4F41803E2677</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>A9382D58-F924-4E60-8E1E-4F41803E2677</string>
<key>IDESourceControlWCCName</key>
<string>VBFPopFlatButton</string>
</dict>
</array>
</dict>
</plist>

View File

@@ -11,7 +11,9 @@
#import "VBFPopFlatButton.h"
@interface ViewController ()
@property (nonatomic, strong) VBFPopFlatButton *flatButton;
@property (nonatomic, strong) VBFPopFlatButton *flatRoundedButton;
@property (nonatomic, strong) VBFPopFlatButton *flatPlainButton;
@end
@implementation ViewController
@@ -21,29 +23,47 @@
// Do any additional setup after loading the view, typically from a nib.
self.view.backgroundColor = [UIColor flatPeterRiverColor];
self.flatButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(150, 150, 30, 30)
self.flatRoundedButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(100, 150, 30, 30)
buttonType:buttonMenuType
buttonStyle:buttonRoundedStyle];
self.flatButton.roundBackgroundColor = [UIColor whiteColor];
self.flatButton.lineThickness = 2;
self.flatButton.linesColor = [UIColor flatPeterRiverColor];
[self.flatButton addTarget:self action:@selector(flatButtonPressed) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.flatButton];
self.flatRoundedButton.roundBackgroundColor = [UIColor whiteColor];
self.flatRoundedButton.lineThickness = 2;
self.flatRoundedButton.linesColor = [UIColor flatPeterRiverColor];
[self.flatRoundedButton addTarget:self
action:@selector(flatRoundedButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.flatRoundedButton];
self.flatPlainButton = [[VBFPopFlatButton alloc]initWithFrame:CGRectMake(200, 150, 30, 30)
buttonType:buttonAddType
buttonStyle:buttonPlainStyle];
self.flatPlainButton.lineThickness = 2;
self.flatPlainButton.linesColor = [UIColor whiteColor];
[self.flatPlainButton addTarget:self
action:@selector(flatPlainButtonPressed)
forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.flatPlainButton];
}
- (IBAction)buttonPressed:(UIButton *)sender {
if (sender.tag != 9) {
[self.flatButton animateToType:sender.tag];
[self.flatRoundedButton animateToType:sender.tag];
[self.flatPlainButton animateToType:sender.tag];
} else {
[self.flatButton animateToType:arc4random()%9];
[self.flatRoundedButton animateToType:arc4random()%9];
[self.flatPlainButton animateToType:arc4random()%9];
}
}
- (void) flatButtonPressed {
- (void) flatRoundedButtonPressed {
NSLog(@"Button pressed");
[self.flatButton animateToType:arc4random()%9];
[self.flatRoundedButton animateToType:arc4random()%9];
}
- (void) flatPlainButtonPressed {
NSLog(@"Button pressed");
[self.flatPlainButton animateToType:arc4random()%9];
}
@end