Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
MobileVet committed Aug 11, 2014
2 parents d672a2e + ac4b0cc commit 9da3f20
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5053" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="5056" systemVersion="13C64" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
Expand All @@ -23,19 +23,6 @@
<view contentMode="scaleToFill" id="25" customClass="FXBlurView">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="bottom" buttonType="roundedRect" lineBreakMode="middleTruncation" id="PFp-pe-cux">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<inset key="contentEdgeInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="20"/>
<state key="normal" title="Tap to Blur / Unblur">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleBlur" destination="-1" eventType="touchUpInside" id="M6S-fW-1Zx"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="string" keyPath="blurRadius" value="0"/>
Expand All @@ -45,6 +32,17 @@
<userDefinedRuntimeAttribute type="boolean" keyPath="dynamic" value="NO"/>
</userDefinedRuntimeAttributes>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="bottom" buttonType="roundedRect" lineBreakMode="middleTruncation" id="PFp-pe-cux">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<inset key="contentEdgeInsets" minX="0.0" minY="0.0" maxX="0.0" maxY="20"/>
<state key="normal" title="Tap to Blur / Unblur">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="toggleBlur" destination="-1" eventType="touchUpInside" id="M6S-fW-1Zx"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.75" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<simulatedStatusBarMetrics key="simulatedStatusBarMetrics"/>
Expand Down
14 changes: 0 additions & 14 deletions FXBlurView.podspec

This file was deleted.

23 changes: 23 additions & 0 deletions FXBlurView.podspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "FXBlurView",
"version": "1.6.2",
"license": "zlib",
"summary": "UIView subclass that replicates the iOS 7 realtime background blur effect, but works on iOS 5 and above.",
"authors": {
"Nick Lockwood": "http://charcoaldesign.co.uk/"
},
"source": {
"git": "https://github.com/nicklockwood/FXBlurView.git",
"tag": "1.6.2"
},
"homepage": "http://github.com/nicklockwood/FXBlurView",
"platforms": {
"ios": "4.3"
},
"source_files": "FXBlurView",
"frameworks": [
"Accelerate",
"QuartzCore"
],
"requires_arc": true
}
3 changes: 1 addition & 2 deletions FXBlurView/FXBlurView.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FXBlurView.h
//
// Version 1.6
// Version 1.6.2
//
// Created by Nick Lockwood on 25/08/2013.
// Copyright (c) 2013 Charcoal Design
Expand Down Expand Up @@ -32,7 +32,6 @@


#import <UIKit/UIKit.h>
#import <Accelerate/Accelerate.h>


#pragma GCC diagnostic push
Expand Down
19 changes: 16 additions & 3 deletions FXBlurView/FXBlurView.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FXBlurView.m
//
// Version 1.6
// Version 1.6.2
//
// Created by Nick Lockwood on 25/08/2013.
// Copyright (c) 2013 Charcoal Design
Expand Down Expand Up @@ -35,6 +35,7 @@
#import <objc/runtime.h>
#import <objc/message.h>
#import <QuartzCore/QuartzCore.h>
#import <Accelerate/Accelerate.h>


#pragma GCC diagnostic ignored "-Wobjc-missing-property-synthesis"
Expand Down Expand Up @@ -502,14 +503,26 @@ - (void)displayLayer:(__unused CALayer *)layer
if ([key isEqualToString:@"blurRadius"])
{
//animations are enabled
CAAnimation *action = (CAAnimation *)[super actionForLayer:layer forKey:@"bounds"];
CAAnimation *action = (CAAnimation *)[super actionForLayer:layer forKey:@"backgroundColor"];
if ((NSNull *)action != [NSNull null])
{
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:key];
animation.fromValue = [layer.presentationLayer valueForKey:key];

//CAMediatiming attributes
animation.beginTime = action.beginTime;
animation.duration = action.duration;
animation.timingFunction = action.timingFunction;
animation.speed = action.speed;
animation.timeOffset = action.timeOffset;
animation.repeatCount = action.repeatCount;
animation.repeatDuration = action.repeatDuration;
animation.autoreverses = action.autoreverses;
animation.fillMode = action.fillMode;

//CAAnimation attributes
animation.timingFunction = action.timingFunction;
animation.delegate = action.delegate;

return animation;
}
}
Expand Down
2 changes: 1 addition & 1 deletion LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FXBlurView

Version 1.6, March 25th, 2014
Version 1.6.2, July 17th, 2014

Copyright (C) 2013 Charcoal Design

Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ FXBlurView is a UIView subclass that replicates the iOS 7 realtime background bl
Supported iOS & SDK Versions
-----------------------------

* Supported build target - iOS 7.1 (Xcode 5.1, Apple LLVM compiler 5.1)
* Earliest supported deployment target - iOS 5.0
* Supported build target - iOS 8.0 (Xcode 6.0, Apple LLVM compiler 6.0)
* Earliest supported deployment target - iOS 6.0
* Earliest compatible deployment target - iOS 4.3

NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this iOS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.
Expand Down Expand Up @@ -72,7 +72,7 @@ This property toggles blurring on and off for an individual FXBlurView instance.

@property (nonatomic, getter = isDynamic) BOOL dynamic;

This property controls whether the FXBlurView updates dynamically, or only once when the view is added to its superview. Defaults to YES. Note that is dynamic is set to NO, you can still force the view to update by calling `setNeedsDisplay` or `updateAsynchronously:completion:`. Dynamic blurring is extremely cpu-intensive, so you should always disable dynamic views immediately prior to performing an animation to avoid stuttering. However, if you have multiple FXBlurViews on screen then it is simpler to disable updates using the `setUpdatesDisabled` method rather than setting the `dynamic` property to NO.
This property controls whether the FXBlurView updates dynamically, or only once when the view is added to its superview. Defaults to YES. Note that if dynamic is set to NO, you can still force the view to update by calling `setNeedsDisplay` or `updateAsynchronously:completion:`. Dynamic blurring is extremely cpu-intensive, so you should always disable dynamic views immediately prior to performing an animation to avoid stuttering. However, if you have multiple FXBlurViews on screen then it is simpler to disable updates using the `setUpdatesDisabled` method rather than setting the `dynamic` property to NO.

@property (nonatomic, assign) NSUInteger iterations;

Expand Down Expand Up @@ -114,6 +114,15 @@ FAQ
Release Notes
-----------------

Version 1.6.2

- Fixed crash on iOS 8 when animating blur
- Fixed issue when using FXBlurView with Swift

Version 1.6.1

- Fixed issue with animation completion block not firing

Version 1.6

- It is now possible to animate blurRadius
Expand Down Expand Up @@ -210,4 +219,4 @@ Version 1.1

Version 1.0

- Initial release
- Initial release

0 comments on commit 9da3f20

Please sign in to comment.