Skip to content

Commit

Permalink
Reorganize project, add Carthage support, add nullability support, mi…
Browse files Browse the repository at this point in the history
…nor refactoring
  • Loading branch information
podkovyrin committed Jan 6, 2017
1 parent f13a9a5 commit a8cf37a
Show file tree
Hide file tree
Showing 48 changed files with 1,338 additions and 996 deletions.
46 changes: 26 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
# OS X Finder
# OS X
.DS_Store

# Xcode per-user config
*.mode1
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
*.perspective
!default.mode2v3
*.perspectivev3
*.pbxuser
xcuserdata

# Build products
build/
*.o
*.LinkFileList
!default.perspectivev3
xcuserdata/
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa

# Automatic backup files
*~.nib/
*.swp
*~
*.dat
*.dep
# Bundler
.bundle

# AppCode specific files
.idea/
*.iml
Carthage
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
Pods/
Example/Podfile.lock
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

osx_image: xcode7.3
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -workspace Example/APNumberPad.xcworkspace -scheme APNumberPad-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
40 changes: 25 additions & 15 deletions APNumberPad.podspec
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
Pod::Spec.new do |s|
s.name = 'APNumberPad'
s.version = '1.1.3'
s.summary = 'Full clone of iOS number keyboard with customizable function button'
s.description = 'Custom keyboard for iOS allows you to create a keyboard inputView '\
'that looks and feels just like the iPhone keyboard '\
'with UIKeyboardTypeNumberPad as keyboardType. '\
'Also APNumberPad provides customizable left-function button.'
s.homepage = 'https://github.com/podkovyrin/APNumberPad'
s.license = 'MIT'
s.author = { 'Andrew Podkovyrin' => '[email protected]' }
s.source = { :git => 'https://github.com/podkovyrin/APNumberPad.git', :tag => s.version.to_s }
s.platform = :ios, '6.0'
s.source_files = 'APNumberPad/APNumberPad/*.{h,m}'
s.resources = 'APNumberPad/APNumberPad.bundle'
s.requires_arc = true
s.name = 'APNumberPad'
s.version = '1.2.0'
s.summary = 'Full clone of iOS number keyboard with customizable function button'

s.description = <<-DESC
Custom keyboard for iOS allows you to create a keyboard inputView
that looks and feels just like the iPhone keyboard
with UIKeyboardTypeNumberPad as keyboardType.
Also APNumberPad provides customizable left-function button.
DESC

s.homepage = 'https://github.com/podkovyrin/APNumberPad'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'Andrew Podkovyrin' => '[email protected]' }
s.source = { :git => 'https://github.com/podkovyrin/APNumberPad.git', :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/podkovyr'

s.ios.deployment_target = '8.2'

s.source_files = 'APNumberPad/Classes/**/*'
s.resource_bundles = {
'APNumberPad' => ['APNumberPad/Assets/*.png']
}

s.frameworks = 'UIKit'
end
521 changes: 0 additions & 521 deletions APNumberPad.xcodeproj/project.pbxproj

This file was deleted.

This file was deleted.

79 changes: 0 additions & 79 deletions APNumberPad/APNumberPad/APNumberPadDefaultStyle.m

This file was deleted.

25 changes: 0 additions & 25 deletions APNumberPad/APNumberPad/NSBundle+APNumberPad.m

This file was deleted.

File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface APNumberButton : UIButton

+ (instancetype)buttonWithBackgroundColor:(UIColor *)backgroundColor highlightedColor:(UIColor *)highlightedColor;
Expand All @@ -16,3 +18,5 @@
- (void)np_touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
@implementation UIImage (APNumberPad)

+ (UIImage *)ap_imageWithColor:(UIColor *)color {
CGRect rect = CGRectMake(0.0f, 0.0f, 1.0f, 1.0f);
CGRect rect = CGRectMake(0.0, 0.0, 1.0, 1.0);
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();

CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, rect);

UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

return image;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
//

#import <UIKit/UIKit.h>

#import "APNumberPadStyle.h"

NS_ASSUME_NONNULL_BEGIN

@protocol APNumberPadDelegate;

///

@interface APNumberPad : UIView <UIInputViewAudioFeedback>

+ (instancetype)numberPadWithDelegate:(id<APNumberPadDelegate>)delegate numberPadStyleClass:(Class)styleClass;

+ (instancetype)numberPadWithDelegate:(id<APNumberPadDelegate>)delegate;
+ (instancetype)numberPadWithDelegate:(id<APNumberPadDelegate>)delegate numberPadStyleClass:(nullable Class)styleClass;

/**
* Left function button for custom configuration
Expand Down Expand Up @@ -44,3 +46,5 @@
- (void)numberPad:(APNumberPad *)numberPad functionButtonAction:(UIButton *)functionButton textInput:(UIResponder<UITextInput> *)textInput;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit a8cf37a

Please sign in to comment.