Skip to content

Commit

Permalink
Prepare for 1.0.0 release;
Browse files Browse the repository at this point in the history
  • Loading branch information
Antondomashnev committed Dec 6, 2016
1 parent 72150da commit 3802a90
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ADChromePullToRefresh.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ADChromePullToRefresh"
s.version = "0.5.0"
s.version = "1.0.0"
s.summary = "Google Chrome iOS app pull to refresh"
s.description = <<-DESC
Yet another pull to refresh for your needs
Expand All @@ -16,4 +16,4 @@ Pod::Spec.new do |s|
s.source_files = 'Source/*'

s.frameworks = 'UIKit'
end
end
9 changes: 8 additions & 1 deletion ADChromePullToRefresh.xcodeproj/project.pbxproj
Expand Up @@ -203,7 +203,7 @@
attributes = {
LastSwiftMigration = 0710;
LastSwiftUpdateCheck = 0710;
LastUpgradeCheck = 0710;
LastUpgradeCheck = 0810;
ORGANIZATIONNAME = "Anton Domashnev";
TargetAttributes = {
6D97B6E91AE2C30D0003DDEA = {
Expand Down Expand Up @@ -326,8 +326,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";
Expand All @@ -336,6 +338,7 @@
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand Down Expand Up @@ -370,15 +373,18 @@
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";
COPY_PHASE_STRIP = NO;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand All @@ -388,6 +394,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -20,7 +20,7 @@ You can simply setup your own chrome style pull to refresh using the initializer
* @param scrollViewOriginalOffsetY - initial offset y of the given scrollView
* @param delegate - object conformed to ADChromePullToRefreshDelegate protocol
*/
init(view: UIView, forScrollView scrollView: UIScrollView, scrollViewOriginalOffsetY: CGFloat, delegate: ADChromePullToRefreshDelegate)
init(view: UIView, forScrollView scrollView: UIScrollView, scrollViewOriginalOffsetY: CGFloat, delegate: ADChromePullToRefreshDelegate)
```

To provide custom handler for pull to refresh actions you need to implement this delegate methos in your class
Expand All @@ -29,7 +29,7 @@ To provide custom handler for pull to refresh actions you need to implement this
/*
* Use this function to provide an action for the given action view type
*/
func chromePullToRefresh(pullToRefresh: ADChromePullToRefresh, actionForViewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshAction?
func chromePullToRefresh(_ pullToRefresh: ADChromePullToRefresh, actionForViewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshAction?
```

You're able to customize pull to refresh action view according to your needs 🚀
Expand All @@ -41,7 +41,7 @@ You're able to customize pull to refresh action view according to your needs
* @see ADChromePullToRefreshActionView.swift
* @see UITableViewDelegate - similar method to get header and footer view
*/
func chromePullToRefresh(pullToRefresh: ADChromePullToRefresh, viewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshActionView
func chromePullToRefresh(_ pullToRefresh: ADChromePullToRefresh, viewWithType: ADChromePullToRefreshActionViewType) -> ADChromePullToRefreshActionView
```

## Easy to install
Expand Down
2 changes: 1 addition & 1 deletion Source/ADChromePullToRefresh.swift
Expand Up @@ -109,7 +109,7 @@ class ADChromePullToRefresh: NSObject, ADChromePullToRefreshViewDelegate {
}

func setUpConstraints() {
let viewsDictionary = ["pullToRefresh" : self.pullToRefreshView]
let viewsDictionary: [String : ADChromePullToRefreshView] = ["pullToRefresh" : self.pullToRefreshView]
let horizontalConstraints: [NSLayoutConstraint] = NSLayoutConstraint.constraints(withVisualFormat: "H:|[pullToRefresh]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewsDictionary)
self.pullToRefreshSuperview.addConstraints(horizontalConstraints)
let verticalConstraints: [NSLayoutConstraint] = NSLayoutConstraint.constraints(withVisualFormat: "V:|[pullToRefresh]", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewsDictionary)
Expand Down
2 changes: 1 addition & 1 deletion Source/ADChromePullToRefreshActionView.swift
Expand Up @@ -77,7 +77,7 @@ class ADChromePullToRefreshActionView: UIView {
}

func setUpConstraints() {
let viewsDictionary = ["iconView" : self.iconView]
let viewsDictionary: [String : UIView] = ["iconView" : self.iconView]
let horizontalConstraints: NSArray = NSLayoutConstraint.constraints(withVisualFormat: "H:|[iconView]|", options: NSLayoutFormatOptions(), metrics: nil, views: viewsDictionary) as NSArray
self.addConstraints(horizontalConstraints as! [NSLayoutConstraint])
let verticalConstraints: NSArray = NSLayoutConstraint.constraints(withVisualFormat: "V:|[iconView]|", options: NSLayoutFormatOptions(), metrics: nil, views: viewsDictionary) as NSArray
Expand Down
10 changes: 5 additions & 5 deletions Source/ADChromePullToRefreshView.swift
Expand Up @@ -161,14 +161,14 @@ class ADChromePullToRefreshView: UIView {
func setUpConstraints() {
let verticalMargin = (self.bounds.height - self.viewsSize.height) / 2
let horizontalMargin = (self.bounds.width - self.viewsSize.width * 3 - self.leftActionLeftMargin - self.rightActionRightMargin) / 2
let viewsDictionary = ["refreshView" : self.centerActionView, "leftActionView" : self.leftActionView, "rightActionView" : self.rightActionView, "highlightView": self.highlightView]
let metricsDictionary = ["leftActionLeft": self.leftActionLeftMargin, "rightActionRight": self.rightActionRightMargin, "viewsMargin": horizontalMargin, "viewWidth": self.viewsSize.width, "viewHeight": self.viewsSize.height, "verticalMargin": verticalMargin]
let viewsDictionary: [String : UIView] = ["refreshView" : self.centerActionView, "leftActionView" : self.leftActionView, "rightActionView" : self.rightActionView, "highlightView": self.highlightView]
let metricsDictionary: [String : CGFloat] = ["leftActionLeft": self.leftActionLeftMargin, "rightActionRight": self.rightActionRightMargin, "viewsMargin": horizontalMargin, "viewWidth": self.viewsSize.width, "viewHeight": self.viewsSize.height, "verticalMargin": verticalMargin]
let horizontalConstraints: [NSLayoutConstraint] = NSLayoutConstraint.constraints(withVisualFormat: "|-(leftActionLeft)-[leftActionView(viewWidth)]-(viewsMargin)-[refreshView(viewWidth)]-(viewsMargin)-[rightActionView(viewWidth)]-(rightActionRight)-|", options: NSLayoutFormatOptions(rawValue: 0), metrics: metricsDictionary as [String : AnyObject], views: viewsDictionary)
self.addConstraints(horizontalConstraints)

let actionViews = [self.centerActionView, self.leftActionView, self.rightActionView]
let actionViews: [ADChromePullToRefreshActionView] = [self.centerActionView, self.leftActionView, self.rightActionView]
for actionView in actionViews {
self.addConstraint(self.centerYConstraintForView(actionView!))
self.addConstraint(self.centerYConstraintForView(actionView))
}

self.refreshViewHeightConstraint = self.heightConstraintForActionView(self.centerActionView)
Expand All @@ -180,7 +180,7 @@ class ADChromePullToRefreshView: UIView {
self.rightActionView.addConstraint(self.rightActionViewHeightConstraint)

for actionView in actionViews {
actionView?.setUpConstraints()
actionView.setUpConstraints()
}

let highlightHorizontalConstraints: [NSLayoutConstraint] = NSLayoutConstraint.constraints(withVisualFormat: "H:|[highlightView]|", options: NSLayoutFormatOptions(rawValue: 0), metrics: nil, views: viewsDictionary)
Expand Down

0 comments on commit 3802a90

Please sign in to comment.