Compare commits
11 Commits
0.2.2
...
travis-fixes
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3a0f89f0 | |||
| 4192455568 | |||
| 390c839b5f | |||
| b756e812d6 | |||
| d5ef7d799d | |||
| d3c94d1434 | |||
| 6c25aa3810 | |||
| eefea9e3ac | |||
| 5f9a0fc315 | |||
| 0786c47efd | |||
| 0f2d5cbccd |
+7
-5
@@ -3,11 +3,13 @@
|
||||
# * https://github.com/supermarin/xcpretty#usage
|
||||
|
||||
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
|
||||
cache: cocoapods
|
||||
podfile: Example/Podfile
|
||||
before_install:
|
||||
- rvm install 2.2.2
|
||||
- rvm use 2.2.2
|
||||
- gem install cocoapods
|
||||
- pod install --project-directory=Example
|
||||
install:
|
||||
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
|
||||
script:
|
||||
|
||||
@@ -531,7 +531,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MaterialDesignSpinner/MaterialDesignSpinner-Prefix.pch";
|
||||
INFOPLIST_FILE = "MaterialDesignSpinner/MaterialDesignSpinner-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
@@ -545,7 +545,7 @@
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "MaterialDesignSpinner/MaterialDesignSpinner-Prefix.pch";
|
||||
INFOPLIST_FILE = "MaterialDesignSpinner/MaterialDesignSpinner-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 7.1;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9052" systemVersion="15A284" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="vXZ-lx-hvc">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9040"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
|
||||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
@@ -21,7 +21,6 @@
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HW3-rr-Akw" customClass="MMMaterialDesignSpinner">
|
||||
<rect key="frame" x="200" y="200" width="200" height="200"/>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="HW3-rr-Akw" secondAttribute="height" multiplier="1:1" id="eh9-m5-0OE"/>
|
||||
@@ -29,7 +28,6 @@
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bxJ-ep-Qc5">
|
||||
<rect key="frame" x="253" y="420" width="94" height="30"/>
|
||||
<animations/>
|
||||
<state key="normal" title="Change Color"/>
|
||||
<connections>
|
||||
<action selector="changeColorButtonTouched:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="zUc-r8-e9P"/>
|
||||
@@ -37,32 +35,63 @@
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Umg-oT-Dv1">
|
||||
<rect key="frame" x="235" y="458" width="131" height="30"/>
|
||||
<animations/>
|
||||
<state key="normal" title="Change Line Width"/>
|
||||
<connections>
|
||||
<action selector="changeLineWidthButtonTouched:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Kgo-vV-Mja"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P6d-eP-pjF">
|
||||
<rect key="frame" x="180" y="496" width="240" height="30"/>
|
||||
<subviews>
|
||||
<slider opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" value="1.5" minValue="0.0" maxValue="10" translatesAutoresizingMaskIntoConstraints="NO" id="BCa-2B-PxA">
|
||||
<rect key="frame" x="72" y="0.0" width="170" height="31"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="166" id="oZZ-eP-B6N"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<action selector="durationSliderValueUpdated:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="Yt3-t2-Zln"/>
|
||||
<action selector="durationSliderValueUpdated:" destination="vXZ-lx-hvc" eventType="touchUpOutside" id="btR-st-mNM"/>
|
||||
</connections>
|
||||
</slider>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Duration" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oZk-x6-Cbo">
|
||||
<rect key="frame" x="0.0" y="4" width="66" height="21"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="oZk-x6-Cbo" firstAttribute="centerY" secondItem="BCa-2B-PxA" secondAttribute="centerY" id="9CN-GK-gQI"/>
|
||||
<constraint firstItem="BCa-2B-PxA" firstAttribute="leading" secondItem="oZk-x6-Cbo" secondAttribute="trailing" constant="8.5" id="E0Y-Nj-D7M"/>
|
||||
<constraint firstItem="BCa-2B-PxA" firstAttribute="top" secondItem="P6d-eP-pjF" secondAttribute="top" id="MGc-Sw-dlP"/>
|
||||
<constraint firstItem="oZk-x6-Cbo" firstAttribute="leading" secondItem="P6d-eP-pjF" secondAttribute="leading" id="Qop-uU-SMI"/>
|
||||
<constraint firstAttribute="bottom" secondItem="BCa-2B-PxA" secondAttribute="bottom" id="rMj-n9-UZP"/>
|
||||
<constraint firstAttribute="trailing" secondItem="BCa-2B-PxA" secondAttribute="trailing" id="yAh-JG-gqX"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<animations/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstItem="Umg-oT-Dv1" firstAttribute="top" secondItem="bxJ-ep-Qc5" secondAttribute="bottom" constant="8" symbolic="YES" id="1EZ-mV-u15"/>
|
||||
<constraint firstItem="HW3-rr-Akw" firstAttribute="width" secondItem="kh9-bI-dsS" secondAttribute="width" multiplier="1:3" id="4dr-09-65z"/>
|
||||
<constraint firstItem="Umg-oT-Dv1" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="A0X-DN-AiI"/>
|
||||
<constraint firstItem="bxJ-ep-Qc5" firstAttribute="top" secondItem="HW3-rr-Akw" secondAttribute="bottom" constant="20" id="Cmt-gg-FUs"/>
|
||||
<constraint firstItem="P6d-eP-pjF" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="LUZ-rw-3h9"/>
|
||||
<constraint firstItem="bxJ-ep-Qc5" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="NEM-nh-Nf9"/>
|
||||
<constraint firstItem="HW3-rr-Akw" firstAttribute="centerY" secondItem="kh9-bI-dsS" secondAttribute="centerY" id="c5R-S9-N1n"/>
|
||||
<constraint firstItem="HW3-rr-Akw" firstAttribute="centerX" secondItem="kh9-bI-dsS" secondAttribute="centerX" id="lAp-IZ-ygd"/>
|
||||
<constraint firstItem="P6d-eP-pjF" firstAttribute="top" secondItem="Umg-oT-Dv1" secondAttribute="bottom" constant="8" id="xcT-AQ-2QR"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="durationSlider" destination="BCa-2B-PxA" id="zNN-IT-kOe"/>
|
||||
<outlet property="spinnerView" destination="HW3-rr-Akw" id="mkj-d2-eQE"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="571.875" y="438.90845070422534"/>
|
||||
<point key="canvasLocation" x="571" y="438"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
|
||||
#import "MMViewController.h"
|
||||
|
||||
#import <MMMaterialDesignSpinner.h>
|
||||
#import "MMMaterialDesignSpinner.h"
|
||||
|
||||
@interface MMViewController ()
|
||||
@property (nonatomic, strong) IBOutlet MMMaterialDesignSpinner *spinnerView;
|
||||
@property (weak, nonatomic) IBOutlet UISlider *durationSlider;
|
||||
@end
|
||||
|
||||
@implementation MMViewController
|
||||
@@ -33,6 +34,12 @@
|
||||
if (self.spinnerView.lineWidth == 0) self.spinnerView.lineWidth = 0.1f;
|
||||
}
|
||||
|
||||
- (IBAction)durationSliderValueUpdated:(id)sender {
|
||||
[self.spinnerView stopAnimating];
|
||||
self.spinnerView.duration = self.durationSlider.value;
|
||||
[self.spinnerView startAnimating];
|
||||
}
|
||||
|
||||
#pragma mark Helper methods
|
||||
|
||||
+ (UIColor *)randomColor {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
PODS:
|
||||
- MMMaterialDesignSpinner (0.2.1)
|
||||
|
||||
DEPENDENCIES:
|
||||
- MMMaterialDesignSpinner (from `../`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
MMMaterialDesignSpinner:
|
||||
:path: ../
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
MMMaterialDesignSpinner: 7559fb1f9cf22d88ab7b3716f6170e51b51ae8b8
|
||||
|
||||
COCOAPODS: 0.39.0
|
||||
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
||||
#
|
||||
|
||||
s.name = "MMMaterialDesignSpinner"
|
||||
s.version = "0.2.2"
|
||||
s.version = "0.2.3"
|
||||
s.summary = "An iOS activity spinner modeled after Google's Material Design spinner"
|
||||
|
||||
# This description is used to generate tags and improve search results.
|
||||
@@ -84,7 +84,7 @@ Pod::Spec.new do |s|
|
||||
# Supports git, hg, bzr, svn and HTTP.
|
||||
#
|
||||
|
||||
s.source = { :git => "https://github.com/misterwell/MMMaterialDesignSpinner.git", :tag => "0.2.2" }
|
||||
s.source = { :git => "https://github.com/misterwell/MMMaterialDesignSpinner.git", :tag => "0.2.3" }
|
||||
|
||||
|
||||
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
|
||||
@@ -134,4 +134,4 @@ Pod::Spec.new do |s|
|
||||
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
|
||||
# s.dependency "JSONKit", "~> 1.4"
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
@@ -238,6 +238,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
@@ -254,6 +255,7 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
APPLICATION_EXTENSION_API_ONLY = YES;
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
DEFINES_MODULE = YES;
|
||||
DYLIB_COMPATIBILITY_VERSION = 1;
|
||||
DYLIB_CURRENT_VERSION = 1;
|
||||
|
||||
@@ -33,6 +33,9 @@ FOUNDATION_EXPORT const unsigned char MMMaterialDesignSpinnerVersionString[];
|
||||
/** Property indicating whether the view is currently animating. */
|
||||
@property (nonatomic, readonly) BOOL isAnimating;
|
||||
|
||||
/** Property indicating the duration of the animation, default is 1.5s. Should be set prior to -[startAnimating] */
|
||||
@property (nonatomic, readwrite) NSTimeInterval duration;
|
||||
|
||||
/**
|
||||
* Convenience function for starting & stopping animation with a boolean variable instead of explicit
|
||||
* method calls.
|
||||
|
||||
@@ -40,6 +40,7 @@ static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotatio
|
||||
}
|
||||
|
||||
- (void)initialize {
|
||||
self.duration = 1.5f;
|
||||
_timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
|
||||
|
||||
[self.layer addSublayer:self.progressLayer];
|
||||
@@ -78,13 +79,15 @@ static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotatio
|
||||
(animate ? [self startAnimating] : [self stopAnimating]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (void)startAnimating {
|
||||
if (self.isAnimating)
|
||||
return;
|
||||
|
||||
CABasicAnimation *animation = [CABasicAnimation animation];
|
||||
animation.keyPath = @"transform.rotation";
|
||||
animation.duration = 4.f;
|
||||
animation.duration = self.duration / 0.375f;
|
||||
animation.fromValue = @(0.f);
|
||||
animation.toValue = @(2 * M_PI);
|
||||
animation.repeatCount = INFINITY;
|
||||
@@ -93,14 +96,14 @@ static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotatio
|
||||
|
||||
CABasicAnimation *headAnimation = [CABasicAnimation animation];
|
||||
headAnimation.keyPath = @"strokeStart";
|
||||
headAnimation.duration = 1.f;
|
||||
headAnimation.duration = self.duration / 1.5f;
|
||||
headAnimation.fromValue = @(0.f);
|
||||
headAnimation.toValue = @(0.25f);
|
||||
headAnimation.timingFunction = self.timingFunction;
|
||||
|
||||
CABasicAnimation *tailAnimation = [CABasicAnimation animation];
|
||||
tailAnimation.keyPath = @"strokeEnd";
|
||||
tailAnimation.duration = 1.f;
|
||||
tailAnimation.duration = self.duration / 1.5f;
|
||||
tailAnimation.fromValue = @(0.f);
|
||||
tailAnimation.toValue = @(1.f);
|
||||
tailAnimation.timingFunction = self.timingFunction;
|
||||
@@ -108,22 +111,22 @@ static NSString *kMMRingRotationAnimationKey = @"mmmaterialdesignspinner.rotatio
|
||||
|
||||
CABasicAnimation *endHeadAnimation = [CABasicAnimation animation];
|
||||
endHeadAnimation.keyPath = @"strokeStart";
|
||||
endHeadAnimation.beginTime = 1.f;
|
||||
endHeadAnimation.duration = 0.5f;
|
||||
endHeadAnimation.beginTime = self.duration / 1.5f;
|
||||
endHeadAnimation.duration = self.duration / 3.0f;
|
||||
endHeadAnimation.fromValue = @(0.25f);
|
||||
endHeadAnimation.toValue = @(1.f);
|
||||
endHeadAnimation.timingFunction = self.timingFunction;
|
||||
|
||||
CABasicAnimation *endTailAnimation = [CABasicAnimation animation];
|
||||
endTailAnimation.keyPath = @"strokeEnd";
|
||||
endTailAnimation.beginTime = 1.f;
|
||||
endTailAnimation.duration = 0.5f;
|
||||
endTailAnimation.beginTime = self.duration / 1.5f;
|
||||
endTailAnimation.duration = self.duration / 3.0f;
|
||||
endTailAnimation.fromValue = @(1.f);
|
||||
endTailAnimation.toValue = @(1.f);
|
||||
endTailAnimation.timingFunction = self.timingFunction;
|
||||
|
||||
CAAnimationGroup *animations = [CAAnimationGroup animation];
|
||||
[animations setDuration:1.5f];
|
||||
[animations setDuration:self.duration];
|
||||
[animations setAnimations:@[headAnimation, tailAnimation, endHeadAnimation, endTailAnimation]];
|
||||
animations.repeatCount = INFINITY;
|
||||
animations.removedOnCompletion = NO;
|
||||
|
||||
Reference in New Issue
Block a user