-
Notifications
You must be signed in to change notification settings - Fork 7
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 #1 from hryk224/v0.6.0
Added title and description
- Loading branch information
Showing
14 changed files
with
459 additions
and
36 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
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
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
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
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
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,66 @@ | ||
// | ||
// IPhoto.swift | ||
// IPhotoBrowser | ||
// | ||
// Created by hiroyuki yoshida on 2017/02/24. | ||
// | ||
// | ||
|
||
import UIKit | ||
import Photos | ||
|
||
public struct IPhoto { | ||
public let image: UIImage? | ||
public let imageUrl: URL? | ||
public let asset: PHAsset? | ||
public let title: String? | ||
public let description: String? | ||
var sourceType: IPhotoBrowserSourceType? { | ||
if image != nil { | ||
return .image | ||
} else if imageUrl != nil { | ||
return .imageUrl | ||
} else if asset != nil { | ||
return .asset | ||
} | ||
return nil | ||
} | ||
public init(image: UIImage, | ||
title: String? = nil, | ||
description: String? = nil) { | ||
self.init(image: image, | ||
imageUrl: nil, | ||
asset: nil, | ||
title: title, | ||
description: description) | ||
} | ||
public init(imageUrl: URL, | ||
title: String? = nil, | ||
description: String? = nil) { | ||
self.init(image: nil, | ||
imageUrl: imageUrl, | ||
asset: nil, | ||
title: title, | ||
description: description) | ||
} | ||
public init(asset: PHAsset, | ||
title: String? = nil, | ||
description: String? = nil) { | ||
self.init(image: nil, | ||
imageUrl: nil, | ||
asset: asset, | ||
title: title, | ||
description: description) | ||
} | ||
private init(image: UIImage?, | ||
imageUrl: URL?, | ||
asset: PHAsset?, | ||
title: String?, | ||
description: String?) { | ||
self.image = image | ||
self.imageUrl = imageUrl | ||
self.asset = asset | ||
self.title = title | ||
self.description = description | ||
} | ||
} |
Oops, something went wrong.