Skip to content

Commit

Permalink
Merge pull request #3 from Raizlabs/feature/ateliercw/tests_and_struc…
Browse files Browse the repository at this point in the history
…ture

Feature/ateliercw/tests and structure
  • Loading branch information
Michael Skiba authored Jul 14, 2016
2 parents 02e9dc9 + b102d45 commit 5e27c80
Show file tree
Hide file tree
Showing 27 changed files with 754 additions and 267 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# RIGImageGallery

[![Version](https://img.shields.io/cocoapods/v/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery)
[![License](https://img.shields.io/cocoapods/l/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery)
[![Platform](https://img.shields.io/cocoapods/p/RIGImageGallery.svg?style=flat)](http://cocoapods.org/pods/RIGImageGallery)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

RIGImageGallery is an image gallery for iOS written in Swift.

The goal is to offer sensible defaults that takes care of most of building an image gallery automatically, and offer easy block based customization..

## Installation with CocoaPods

RIGImageGallery is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'RIGImageGallery'
```

## Installation with Carthage

RIGImageGallery is also compatible with [Carthage](https://github.com/Carthage/Carthage). To install it, simply add the following line to your Cartfile:

```ogdl
github "Raizlabs/RIGImageGallery"
```

## Author

Michael Skiba, mike.skiba@raizlabs.com

## License

RIGImageGallery is available under the MIT license. See the LICENSE file for more info.
14 changes: 7 additions & 7 deletions RIGImageGallery.podspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
Pod::Spec.new do |s|
s.name = "RIGImageGallery"
s.version = "0.0.1"
s.version = "0.1.0"
s.summary = "An image gallery view controller designed to work with the Raizlabs Interface Guidelines for iOS."

s.description = <<-DESC
An image gallery view controller designed to work with the Raizlabs Interface Guidelines for iOS.
RIGImageGallery is an image gallery for iOS written in Swift.
Includes pinch to zoom, swiping between images, and tap to hide scrollbars.
The goal is to offer sensible defaults that takes care of most of building an image gallery automatically, and offer easy block based customization.
DESC

s.homepage = "https://github.com/raizlabs/RIGImageGallery"
s.license = 'MIT'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Michael Skiba" => "mike.skiba@raizlabs.com" }
s.source = { :git => "https://github.com/raizlabs/RIGImageGallery.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/ateliercw'

s.platform = :ios, '9.0'
s.requires_arc = true
s.ios.deployment_target = '9.0'

s.source_files = 'RIGImageGallery', 'RIGImageGallery/**/*'

s.frameworks = ["Foundation", "UIKit"]
s.frameworks = 'Foundation', 'UIKit'

end
161 changes: 138 additions & 23 deletions RIGImageGallery.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,29 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "72060F4F1D2FFA6C001281E0"
BuildableName = "RIGImageGalleryTests.xctest"
BlueprintName = "RIGImageGalleryTests"
ReferencedContainer = "container:RIGImageGallery.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "72BA26511C6B985900F1FE22"
BuildableName = "RIGImageGallery.framework"
BlueprintName = "RIGImageGallery"
ReferencedContainer = "container:RIGImageGallery.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
Expand Down
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>1.0</string>
<string>0.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions RIGImageGallery/RIGAutoCenteringScrollView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class RIGAutoCenteringScrollView: UIScrollView {

extension RIGAutoCenteringScrollView {

func toggleZoom() {
func toggleZoom(animated animated: Bool = true) {
if zoomScale != minimumZoomScale {
setZoomScale(minimumZoomScale, animated: true)
setZoomScale(minimumZoomScale, animated: animated)
}
else {
setZoomScale(maximumZoomScale, animated: true)
setZoomScale(maximumZoomScale, animated: animated)
}
}

Expand Down
22 changes: 14 additions & 8 deletions RIGImageGallery/RIGImageGalleryItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@

import UIKit

public class RIGImageGalleryItem: NSObject {
/**
* RIGImageGalleryItem stores an image, placeholder Image, and title to associate with each image
*/
public struct RIGImageGalleryItem: Equatable {

public let image: UIImage?
public let placeholderImage: UIImage?
public let title: String?

public func updateImage(image: UIImage?) -> RIGImageGalleryItem {
return RIGImageGalleryItem(image: image, placeholderImage: placeholderImage, title: title)
}
/// The image to display
public var image: UIImage?
/// A placeholder image to display if the display image is nil or becomes nil
public var placeholderImage: UIImage?
/// The title of the image
public var title: String?

public init(image: UIImage? = nil, placeholderImage: UIImage? = nil, title: String? = nil) {
self.image = image
Expand All @@ -25,3 +27,7 @@ public class RIGImageGalleryItem: NSObject {
}

}

public func == (lhs: RIGImageGalleryItem, rhs: RIGImageGalleryItem) -> Bool {
return lhs.image === rhs.image && lhs.placeholderImage === rhs.placeholderImage && lhs.title == rhs.title
}
Loading

0 comments on commit 5e27c80

Please sign in to comment.