forked from nytimes/NYTPhotoViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request nytimes#127 from NYTimes/develop
Merge develop into master for 1.0.0
- Loading branch information
Showing
265 changed files
with
7,675 additions
and
5,483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: objective-c | ||
podfile: Example/Podfile | ||
|
||
xcode_workspace: Example/NYTPhotoViewer.xcworkspace | ||
xcode_scheme: NYTPhotoViewer | ||
xcode_sdk: iphonesimulator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## [1.0.0](https://github.com/NYTimes/NYTPhotoViewer/releases/tag/1.0.0) | ||
|
||
Changes for users of the library in 1.0.0: | ||
|
||
- **The library now supports iOS 8.0 and newer.** ([#82](https://github.com/NYTimes/NYTPhotoViewer/pull/82), [#84](https://github.com/NYTimes/NYTPhotoViewer/pull/84), [#107](https://github.com/NYTimes/NYTPhotoViewer/pull/107)) | ||
- Support programmatic view controller dismissal via `dismissViewControllerAnimated:completion:` ([#121](https://github.com/NYTimes/NYTPhotoViewer/pull/121), [#122](https://github.com/NYTimes/NYTPhotoViewer/pull/122)) | ||
- Use scrolling UITextView for captions ([#88](https://github.com/NYTimes/NYTPhotoViewer/pull/88)) | ||
- Fix a bug when presenting NYTPhotoViewer from a subview of `UIStackView` ([#104](https://github.com/NYTimes/NYTPhotoViewer/pull/104)) | ||
- Update overlay information after `displayPhoto:` call ([#100](https://github.com/NYTimes/NYTPhotoViewer/pull/100)) | ||
- Implements animated GIF support ([#71](https://github.com/NYTimes/NYTPhotoViewer/pull/71), [#94](https://github.com/NYTimes/NYTPhotoViewer/pull/94), [#106](https://github.com/NYTimes/NYTPhotoViewer/pull/106), [#111](https://github.com/NYTimes/NYTPhotoViewer/pull/111)) | ||
- Fix misplacing view position while zoom transition ([#89](https://github.com/NYTimes/NYTPhotoViewer/pull/89)) | ||
- Adopt CocoaPods `resource_bundles` and fix resource image loading ([#80](https://github.com/NYTimes/NYTPhotoViewer/pull/80), [#113](https://github.com/NYTimes/NYTPhotoViewer/pull/113), [#123](https://github.com/NYTimes/NYTPhotoViewer/pull/123)) | ||
- Use iOS 8 `UIActivityViewController.completionWithItemsHandler` API ([#82](https://github.com/NYTimes/NYTPhotoViewer/pull/82)) | ||
- Nullability and lightweight generics annotations on important public API ([#83](https://github.com/NYTimes/NYTPhotoViewer/pull/83), [#98](https://github.com/NYTimes/NYTPhotoViewer/pull/98)) | ||
- Fix circular reference of `NYTPhotosViewController` ([#79](https://github.com/NYTimes/NYTPhotoViewer/pull/79)) | ||
- Set `barButtonItem` on popover `UIActivityViewController`s ([#65](https://github.com/NYTimes/NYTPhotoViewer/pull/65/)) | ||
- Accept Xcode 7 build settings and fix Xcode 7 warnings ([#76](https://github.com/NYTimes/NYTPhotoViewer/pull/76)) | ||
- Ensure our nav bar will always be translucent with no tint color ([#57](https://github.com/NYTimes/NYTPhotoViewer/pull/57)) | ||
- Fix crash on tapping Share button on iPad ([#52](https://github.com/NYTimes/NYTPhotoViewer/pull/52)) | ||
- Allow customizing maximum photo zoom scale([#51](https://github.com/NYTimes/NYTPhotoViewer/pull/51)) | ||
- Rename `…didDisplayPhoto…` delegate method to `…didNavigateToPhoto…` ([#47](https://github.com/NYTimes/NYTPhotoViewer/pull/47)) | ||
- Adds support for setting `rightBarButtonItems` and `leftBarButtonItems` on `NYTPhotosViewController` ([#49](https://github.com/NYTimes/NYTPhotoViewer/pull/49)) | ||
|
||
## [0.1.2](https://github.com/NYTimes/NYTPhotoViewer/releases/tag/0.1.2) | ||
|
||
Initial open-source release. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
26 changes: 26 additions & 0 deletions
26
Example/Images.xcassets/NYTimesBuilding.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "NYTimesBuilding.jpg", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,20 @@ | |
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x", | ||
"filename" : "[email protected]" | ||
"filename" : "[email protected]", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x", | ||
"filename" : "[email protected]" | ||
"filename" : "[email protected]", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
}, | ||
"properties" : { | ||
"template-rendering-intent" : "original" | ||
} | ||
} |
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// AppDelegate.swift | ||
// NYTPhotoViewer-Swift | ||
// | ||
// Created by Mark Keefe on 3/20/15. | ||
// Copyright (c) 2015 The New York Times. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
@UIApplicationMain | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { | ||
return true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7525" systemVersion="14D105g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7516"/> | ||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> | ||
</dependencies> | ||
<objects> | ||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> | ||
<view contentMode="scaleToFill" id="iN0-l3-epB"> | ||
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 The New York Times. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye"> | ||
<rect key="frame" x="20" y="439" width="441" height="21"/> | ||
<fontDescription key="fontDescription" type="system" pointSize="17"/> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="NYTPhotoViewer-Swift" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> | ||
<rect key="frame" x="20" y="140" width="441" height="43"/> | ||
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> | ||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/> | ||
<nil key="highlightedColor"/> | ||
</label> | ||
</subviews> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstItem="kId-c2-rCX" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="bottom" multiplier="1/3" constant="1" id="5cJ-9S-tgC"/> | ||
<constraint firstAttribute="centerX" secondItem="kId-c2-rCX" secondAttribute="centerX" id="Koa-jz-hwk"/> | ||
<constraint firstAttribute="bottom" secondItem="8ie-xW-0ye" secondAttribute="bottom" constant="20" id="Kzo-t9-V3l"/> | ||
<constraint firstItem="8ie-xW-0ye" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="MfP-vx-nX0"/> | ||
<constraint firstAttribute="centerX" secondItem="8ie-xW-0ye" secondAttribute="centerX" id="ZEH-qu-HZ9"/> | ||
<constraint firstItem="kId-c2-rCX" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="20" symbolic="YES" id="fvb-Df-36g"/> | ||
</constraints> | ||
<nil key="simulatedStatusBarMetrics"/> | ||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/> | ||
<point key="canvasLocation" x="548" y="455"/> | ||
</view> | ||
</objects> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6751" systemVersion="14D113c" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6736"/> | ||
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="tne-QT-ifu"> | ||
<objects> | ||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="NYTPhotoViewer_Swift" customModuleProvider="target" sceneMemberID="viewController"> | ||
<layoutGuides> | ||
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> | ||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> | ||
</layoutGuides> | ||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> | ||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<subviews> | ||
<button opaque="NO" contentMode="scaleAspectFit" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="dUA-jQ-lJo" userLabel="ImageButton"> | ||
<rect key="frame" x="225" y="244.5" width="150" height="111"/> | ||
<constraints> | ||
<constraint firstAttribute="width" secondItem="dUA-jQ-lJo" secondAttribute="height" multiplier="206:153" id="nv8-mc-Fyx"/> | ||
<constraint firstAttribute="width" constant="150" id="xHG-Rw-76G"/> | ||
</constraints> | ||
<state key="normal"> | ||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/> | ||
</state> | ||
<connections> | ||
<action selector="buttonTapped:" destination="BYZ-38-t0r" eventType="touchUpInside" id="A1d-ke-XW6"/> | ||
</connections> | ||
</button> | ||
</subviews> | ||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> | ||
<constraints> | ||
<constraint firstItem="dUA-jQ-lJo" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="fgZ-it-klo"/> | ||
<constraint firstItem="dUA-jQ-lJo" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="oUF-4v-H26"/> | ||
<constraint firstItem="dUA-jQ-lJo" firstAttribute="width" secondItem="dUA-jQ-lJo" secondAttribute="height" multiplier="206:153" id="uuy-lM-U5c"/> | ||
</constraints> | ||
</view> | ||
<connections> | ||
<outlet property="imageButton" destination="dUA-jQ-lJo" id="Emb-oO-PgB"/> | ||
</connections> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> | ||
</objects> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// ExamplePhoto.swift | ||
// NYTPhotoViewer | ||
// | ||
// Created by Mark Keefe on 3/20/15. | ||
// Copyright (c) 2015 The New York Times. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
class ExamplePhoto: NSObject, NYTPhoto { | ||
|
||
var image: UIImage? | ||
var imageData: NSData? | ||
var placeholderImage: UIImage? | ||
let attributedCaptionTitle: NSAttributedString? | ||
let attributedCaptionSummary: NSAttributedString? = NSAttributedString(string: "summary string", attributes: [NSForegroundColorAttributeName: UIColor.grayColor()]) | ||
let attributedCaptionCredit: NSAttributedString? = NSAttributedString(string: "credit", attributes: [NSForegroundColorAttributeName: UIColor.darkGrayColor()]) | ||
|
||
init(image: UIImage? = nil, imageData: NSData? = nil, attributedCaptionTitle: NSAttributedString) { | ||
self.image = image | ||
self.imageData = imageData | ||
self.attributedCaptionTitle = attributedCaptionTitle | ||
super.init() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CFBundleDevelopmentRegion</key> | ||
<string>en</string> | ||
<key>CFBundleExecutable</key> | ||
<string>$(EXECUTABLE_NAME)</string> | ||
<key>CFBundleIdentifier</key> | ||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> | ||
<key>CFBundleInfoDictionaryVersion</key> | ||
<string>6.0</string> | ||
<key>CFBundleName</key> | ||
<string>$(PRODUCT_NAME)</string> | ||
<key>CFBundlePackageType</key> | ||
<string>APPL</string> | ||
<key>CFBundleShortVersionString</key> | ||
<string>1.0</string> | ||
<key>CFBundleSignature</key> | ||
<string>????</string> | ||
<key>CFBundleVersion</key> | ||
<string>1</string> | ||
<key>LSRequiresIPhoneOS</key> | ||
<true/> | ||
<key>UILaunchStoryboardName</key> | ||
<string>LaunchScreen</string> | ||
<key>UIMainStoryboardFile</key> | ||
<string>Main</string> | ||
<key>UIRequiredDeviceCapabilities</key> | ||
<array> | ||
<string>armv7</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
<key>UISupportedInterfaceOrientations~ipad</key> | ||
<array> | ||
<string>UIInterfaceOrientationPortrait</string> | ||
<string>UIInterfaceOrientationPortraitUpsideDown</string> | ||
<string>UIInterfaceOrientationLandscapeLeft</string> | ||
<string>UIInterfaceOrientationLandscapeRight</string> | ||
</array> | ||
</dict> | ||
</plist> |
14 changes: 14 additions & 0 deletions
14
Example/NYTPhotoViewer-Swift/NYTPhotoViewer-Swift-Bridging-Header.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
#import <NYTPhotoViewer/NYTPhoto.h> | ||
#import <NYTPhotoViewer/NYTPhotosViewController.h> | ||
|
||
// For Unit Tests | ||
#import <NYTPhotoViewer/NYTPhotoViewController.h> | ||
#import <NYTPhotoViewer/NYTPhotosDataSource.h> | ||
#import <NYTPhotoViewer/NYTScalingImageView.h> | ||
#import <NYTPhotoViewer/NYTPhotoCaptionView.h> | ||
#import <NYTPhotoViewer/NYTPhotosOverlayView.h> | ||
#import <NYTPhotoViewer/NYTPhotoTransitionAnimator.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// PhotosProvider.swift | ||
// NYTPhotoViewer | ||
// | ||
// Created by Mark Keefe on 3/20/15. | ||
// Copyright (c) 2015 The New York Times. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
/** | ||
* In Swift 1.2, the following file level constants can be moved inside the class for better encapsulation | ||
*/ | ||
let CustomEverythingPhotoIndex = 1, DefaultLoadingSpinnerPhotoIndex = 3, NoReferenceViewPhotoIndex = 4 | ||
let PrimaryImageName = "NYTimesBuilding" | ||
let PlaceholderImageName = "NYTimesBuildingPlaceholder" | ||
|
||
class PhotosProvider: NSObject { | ||
|
||
let photos: [ExamplePhoto] = { | ||
|
||
var mutablePhotos: [ExamplePhoto] = [] | ||
var image = UIImage(named: PrimaryImageName) | ||
let NumberOfPhotos = 5 | ||
|
||
func shouldSetImageOnIndex(photoIndex: Int) -> Bool { | ||
return photoIndex != CustomEverythingPhotoIndex && photoIndex != DefaultLoadingSpinnerPhotoIndex | ||
} | ||
|
||
for photoIndex in 0 ..< NumberOfPhotos { | ||
let title = NSAttributedString(string: "\(photoIndex + 1)", attributes: [NSForegroundColorAttributeName: UIColor.whiteColor()]) | ||
|
||
let photo = shouldSetImageOnIndex(photoIndex) ? ExamplePhoto(image: image, attributedCaptionTitle: title) : ExamplePhoto(attributedCaptionTitle: title) | ||
|
||
if photoIndex == CustomEverythingPhotoIndex { | ||
photo.placeholderImage = UIImage(named: PlaceholderImageName) | ||
} | ||
|
||
mutablePhotos.append(photo) | ||
} | ||
|
||
return mutablePhotos | ||
}() | ||
} |
Oops, something went wrong.