Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
msaps committed Jan 5, 2018
2 parents 51f4fe3 + af5f159 commit 61df892
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
`Pageboy` adheres to [Semantic Versioning](http://semver.org/).

#### 2.x Releases
- `2.2.x` Releases - [2.3.0](#230)
- `2.2.x` Releases - [2.2.0](#220)
- `2.1.x` Releases - [2.1.0](#210)
- `2.0.x` Releases - [2.0.0](#200) | [2.0.1](#201) | [2.0.2](#202) | [2.0.3](#203) | [2.0.4](#204)
Expand All @@ -17,6 +18,15 @@ All notable changes to this project will be documented in this file.
#### 0.x Releases
- `0.4.x` Releases - [0.4.0](#040) | [0.4.1](#041) | [0.4.2](#042) | [0.4.3](#043) | [0.4.4](#044) | [0.4.5](#045) | [0.4.6](#046) | [0.4.7](#047) | [0.4.8](#048) | [0.4.9](#049) | [0.4.10](#0410) | [0.4.11](#0411) | [0.4.12](#0412)

---

## [2.3.0](https://github.com/uias/Pageboy/releases/tag/2.3.0)
Released on 2018-01-05

#### Updated
- [#131](https://github.com/uias/Pageboy/issues/131) Make Pageboy safe to use in extensions.
- by [msaps](https://github.com/msaps).

---

## [2.2.0](https://github.com/uias/Pageboy/releases/tag/2.2.0)
Expand Down
2 changes: 1 addition & 1 deletion Pageboy.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Pod::Spec.new do |s|

s.requires_arc = true

s.version = "2.2.0"
s.version = "2.3.0"
s.summary = "A simple, highly informative page view controller."
s.description = <<-DESC
A page view controller that provides simplified data source management, enhanced delegation and other useful features.
Expand Down
8 changes: 8 additions & 0 deletions Sources/Pageboy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
466A76C11FB38B32000B5C1C /* UIPageViewController+ScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67E6FE01F1E58FE0019AB74 /* UIPageViewController+ScrollView.swift */; };
466A76C21FB38B32000B5C1C /* IndexedMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67E6FE31F1E59160019AB74 /* IndexedMap.swift */; };
466A76C31FB38B32000B5C1C /* WeakWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = D67E6FE41F1E59160019AB74 /* WeakWrapper.swift */; };
4684CF711FFFCA4B001FECAA /* UIApplication+SafeShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4684CF701FFFCA4B001FECAA /* UIApplication+SafeShared.swift */; };
4684CF721FFFCA4B001FECAA /* UIApplication+SafeShared.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4684CF701FFFCA4B001FECAA /* UIApplication+SafeShared.swift */; };
D623B1C11E1D0C6B00527F3D /* Pageboy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D623B1B71E1D0C6A00527F3D /* Pageboy.framework */; };
D623B1C61E1D0C6B00527F3D /* PageboyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D623B1C51E1D0C6B00527F3D /* PageboyTests.swift */; };
D623B1C81E1D0C6B00527F3D /* Pageboy.h in Headers */ = {isa = PBXBuildFile; fileRef = D623B1BA1E1D0C6A00527F3D /* Pageboy.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -67,6 +69,7 @@
/* Begin PBXFileReference section */
4653DD541FC8333E00C4B758 /* PageboyViewControllerDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageboyViewControllerDataSource.swift; sourceTree = "<group>"; };
4653DD571FC8335F00C4B758 /* PageboyViewControllerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PageboyViewControllerDelegate.swift; sourceTree = "<group>"; };
4684CF701FFFCA4B001FECAA /* UIApplication+SafeShared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+SafeShared.swift"; sourceTree = "<group>"; };
D623B1B71E1D0C6A00527F3D /* Pageboy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pageboy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
D623B1BA1E1D0C6A00527F3D /* Pageboy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Pageboy.h; sourceTree = "<group>"; };
D623B1BB1E1D0C6A00527F3D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
Expand Down Expand Up @@ -256,6 +259,7 @@
D6ECCEC01E51AFDB00E9D5B3 /* Utilities */ = {
isa = PBXGroup;
children = (
4684CF701FFFCA4B001FECAA /* UIApplication+SafeShared.swift */,
D67E6FD61F1E58EE0019AB74 /* Transitioning */,
D67E6FD91F1E58EE0019AB74 /* ViewUtilities */,
D67E6FE21F1E59160019AB74 /* DataStructures */,
Expand Down Expand Up @@ -438,6 +442,7 @@
D67E6FDD1F1E58EE0019AB74 /* TransitionOperation.swift in Sources */,
D623B1D21E1D2DF200527F3D /* PageboyViewController.swift in Sources */,
D67E6FDE1F1E58EE0019AB74 /* UIView+AutoLayout.swift in Sources */,
4684CF711FFFCA4B001FECAA /* UIApplication+SafeShared.swift in Sources */,
4653DD581FC8335F00C4B758 /* PageboyViewControllerDelegate.swift in Sources */,
D67E6FDC1F1E58EE0019AB74 /* TransitionOperation+Action.swift in Sources */,
D67E6FE61F1E59160019AB74 /* WeakWrapper.swift in Sources */,
Expand Down Expand Up @@ -478,6 +483,7 @@
466A76C01FB38B32000B5C1C /* UIView+Localization.swift in Sources */,
466A76BC1FB38B32000B5C1C /* PageboyAutoScroller.swift in Sources */,
466A76B61FB38B32000B5C1C /* PageboyViewController.swift in Sources */,
4684CF721FFFCA4B001FECAA /* UIApplication+SafeShared.swift in Sources */,
4653DD591FC8335F00C4B758 /* PageboyViewControllerDelegate.swift in Sources */,
466A76BF1FB38B32000B5C1C /* UIView+AutoLayout.swift in Sources */,
466A76C31FB38B32000B5C1C /* WeakWrapper.swift in Sources */,
Expand Down Expand Up @@ -505,6 +511,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down Expand Up @@ -565,6 +572,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
APPLICATION_EXTENSION_API_ONLY = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pageboy/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.3.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down
25 changes: 25 additions & 0 deletions Sources/Pageboy/Utilities/UIApplication+SafeShared.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// UIApplication+SafeShared.swift
// Pageboy
//
// Created by Merrick Sapsford on 05/01/2018.
// Copyright © 2018 Merrick Sapsford. All rights reserved.
//

import Foundation

internal extension UIApplication {

static var safeShared: UIApplication? {
guard #available(iOSApplicationExtension 8, *) else {
return nil
}

guard UIApplication.responds(to: NSSelectorFromString("sharedApplication")),
let unmanagedSharedApplication = UIApplication.perform(NSSelectorFromString("sharedApplication")) else {
return nil
}

return unmanagedSharedApplication.takeRetainedValue() as? UIApplication
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extension UIView {
if #available(iOS 9.0, *) {
return UIView.userInterfaceLayoutDirection(for: self.semanticContentAttribute) == .rightToLeft
} else {
return UIApplication.shared.userInterfaceLayoutDirection == .rightToLeft
return UIApplication.safeShared?.userInterfaceLayoutDirection == .rightToLeft
}
}

Expand Down

0 comments on commit 61df892

Please sign in to comment.