Deleted duplicated `SamplePhotoApp` sample (#301)

This commit is contained in:
Mykyta Bondarenko 2018-11-15 12:29:24 -05:00 коммит произвёл Craig Dunn
Родитель 44a48d5a78
Коммит 2d57a8fb50
82 изменённых файлов: 0 добавлений и 3442 удалений

Просмотреть файл

@ -1,42 +0,0 @@
Sample code project: Example app using Photos framework
Version: 3.0
IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
this Apple software constitutes acceptance of these terms. If you do
not agree with these terms, please do not use, install, modify or
redistribute this Apple software.
In consideration of your agreement to abide by the following terms, and
subject to these terms, Apple grants you a personal, non-exclusive
license, under Apple's copyrights in this original Apple software (the
"Apple Software"), to use, reproduce, modify and redistribute the Apple
Software, with or without modifications, in source and/or binary forms;
provided that if you redistribute the Apple Software in its entirety and
without modifications, you must retain this notice and the following
text and disclaimers in all such redistributions of the Apple Software.
Neither the name, trademarks, service marks or logos of Apple Inc. may
be used to endorse or promote products derived from the Apple Software
without specific prior written permission from Apple. Except as
expressly stated in this notice, no other rights or licenses, express or
implied, are granted by Apple herein, including but not limited to any
patent rights that may be infringed by your derivative works or by other
works in which the Apple Software may be incorporated.
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 2015 Apple Inc. All Rights Reserved.

Просмотреть файл

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<SampleMetadata>
<ID>547c76f0-b990-400f-8c53-2d64fea59d3b</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginner</Level>
<Tags>User Interface, Platform Features, Media, iOS10</Tags>
<SupportedPlatforms>iOS, tvOS</SupportedPlatforms>
<LicenseRequirement>Starter</LicenseRequirement>
<Gallery>false</Gallery>
<Brief>DEPRECATED: see iOS 11 version of SamplePhotoApp.</Brief>
</SampleMetadata>

Просмотреть файл

@ -1,41 +0,0 @@
SamplePhotoApp (iOS 10)
==========
## See the updated iOS 11 version
A basic Photos-like app to demonstrate the Photos framework.
* Lists albums and built-in collections (Recently Added, Favorites, etc)
* Displays assets (all photos or those from a collection) in a thumbnail grid
* Displays a single photo, video, or Live Photo asset
* Allows the following actions:
* simple edit with canned filters (for still photos, Live Photos, and videos)
* creating an album and adding assets to it
* removing assets from an album
* deleting assets and albums
* favoriting an asset
Build Requirements
------------------
Xcode 8.0 (iOS 10.0 / tvOS 10.0 SDK) or later
Runtime Requirements
------------------
iOS 10.0, tvOS 10.0, or later
Useful links
------------
[Original sample](https://developer.apple.com/library/ios/samplecode/UsingPhotosFramework/Introduction/Intro.html)
Copyright
---------
Xamarin port changes are released under the MIT license
Author
------
Ported to Xamarin.iOS by Oleg Demchenko and Rustam Zaitov

Просмотреть файл

@ -1,35 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplePhotoApp.iOS", "SamplePhotoApp\SamplePhotoApp.iOS.csproj", "{F2483E34-332B-4C6B-B2C1-196BBF9068A1}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Shared", "Shared\Shared.shproj", "{FDCB59CD-E624-46E6-87D3-3A4B6D066F6A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamplePhotoApp.tvOS", "SamplePhotoApp.tvOS\SamplePhotoApp.tvOS.csproj", "{7E640A09-100A-42CA-8678-40F81A85928A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Debug|iPhone.ActiveCfg = Debug|iPhone
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Debug|iPhone.Build.0 = Debug|iPhone
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Release|iPhone.ActiveCfg = Release|iPhone
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Release|iPhone.Build.0 = Release|iPhone
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{F2483E34-332B-4C6B-B2C1-196BBF9068A1}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{7E640A09-100A-42CA-8678-40F81A85928A}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{7E640A09-100A-42CA-8678-40F81A85928A}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{7E640A09-100A-42CA-8678-40F81A85928A}.Release|iPhone.ActiveCfg = Release|iPhone
{7E640A09-100A-42CA-8678-40F81A85928A}.Release|iPhone.Build.0 = Release|iPhone
{7E640A09-100A-42CA-8678-40F81A85928A}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{7E640A09-100A-42CA-8678-40F81A85928A}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{7E640A09-100A-42CA-8678-40F81A85928A}.Debug|iPhone.ActiveCfg = Debug|iPhone
{7E640A09-100A-42CA-8678-40F81A85928A}.Debug|iPhone.Build.0 = Debug|iPhone
EndGlobalSection
EndGlobal

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,17 +0,0 @@
{
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,17 +0,0 @@
{
"layers" : [
{
"filename" : "Front.imagestacklayer"
},
{
"filename" : "Middle.imagestacklayer"
},
{
"filename" : "Back.imagestacklayer"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,32 +0,0 @@
{
"assets" : [
{
"size" : "1280x768",
"idiom" : "tv",
"filename" : "App Icon - Large.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "400x240",
"idiom" : "tv",
"filename" : "App Icon - Small.imagestack",
"role" : "primary-app-icon"
},
{
"size" : "2320x720",
"idiom" : "tv",
"filename" : "Top Shelf Image Wide.imageset",
"role" : "top-shelf-image-wide"
},
{
"size" : "1920x720",
"idiom" : "tv",
"filename" : "Top Shelf Image.imageset",
"role" : "top-shelf-image"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,54 +0,0 @@
{
"images": [
{
"idiom": "universal"
},
{
"scale": "1x",
"idiom": "universal"
},
{
"scale": "2x",
"idiom": "universal"
},
{
"scale": "3x",
"idiom": "universal"
},
{
"idiom": "iphone"
},
{
"scale": "1x",
"idiom": "iphone"
},
{
"scale": "2x",
"idiom": "iphone"
},
{
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"scale": "3x",
"idiom": "iphone"
},
{
"idiom": "ipad"
},
{
"scale": "1x",
"idiom": "ipad"
},
{
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,162 +0,0 @@
{
"images": [
{
"minimum-system-version": "8.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "414x736",
"subtype": "736h",
"scale": "3x",
"idiom": "iphone"
},
{
"minimum-system-version": "8.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "375x667",
"subtype": "667h",
"scale": "2x",
"idiom": "iphone"
},
{
"minimum-system-version": "8.0",
"orientation": "landscape",
"extent": "full-screen",
"size": "736x414",
"subtype": "736h",
"scale": "3x",
"idiom": "iphone"
},
{
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "320x480",
"scale": "2x",
"idiom": "iphone"
},
{
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "320x568",
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "768x1024",
"scale": "1x",
"idiom": "ipad"
},
{
"minimum-system-version": "7.0",
"orientation": "portrait",
"extent": "full-screen",
"size": "768x1024",
"scale": "2x",
"idiom": "ipad"
},
{
"minimum-system-version": "7.0",
"orientation": "landscape",
"extent": "full-screen",
"size": "1024x768",
"scale": "1x",
"idiom": "ipad"
},
{
"minimum-system-version": "7.0",
"orientation": "landscape",
"extent": "full-screen",
"size": "1024x768",
"scale": "2x",
"idiom": "ipad"
},
{
"orientation": "portrait",
"extent": "full-screen",
"size": "320x480",
"scale": "1x",
"idiom": "iphone"
},
{
"orientation": "portrait",
"extent": "full-screen",
"size": "320x480",
"scale": "2x",
"idiom": "iphone"
},
{
"orientation": "portrait",
"extent": "full-screen",
"size": "320x568",
"subtype": "retina4",
"scale": "2x",
"idiom": "iphone"
},
{
"orientation": "portrait",
"extent": "full-screen",
"size": "768x1024",
"scale": "1x",
"idiom": "ipad"
},
{
"orientation": "portrait",
"extent": "full-screen",
"size": "768x1024",
"scale": "2x",
"idiom": "ipad"
},
{
"orientation": "portrait",
"extent": "to-status-bar",
"size": "768x1004",
"scale": "1x",
"idiom": "ipad"
},
{
"orientation": "portrait",
"extent": "to-status-bar",
"size": "768x1004",
"scale": "2x",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "full-screen",
"size": "1024x768",
"scale": "1x",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "full-screen",
"size": "1024x768",
"scale": "2x",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "to-status-bar",
"size": "1024x748",
"scale": "1x",
"idiom": "ipad"
},
{
"orientation": "landscape",
"extent": "to-status-bar",
"size": "1024x748",
"scale": "2x",
"idiom": "ipad"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Просмотреть файл

@ -1,6 +0,0 @@
<?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>
</dict>
</plist>

Просмотреть файл

@ -1,36 +0,0 @@
<?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>CFBundleDisplayName</key>
<string>SamplePhotoApp.tvOS</string>
<key>CFBundleName</key>
<string>SamplePhotoApp.tvOS</string>
<key>CFBundleIdentifier</key>
<string>com.xamarin.samplephotoapp-tvos</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>10.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>3</integer>
</array>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UIUserInterfaceStyle</key>
<string>Automatic</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Displays and edits photos to demonstrate the Photos framework.</string>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/App Icon &amp; Top Shelf Image.brandassets</string>
<key>XSLaunchImageAssets</key>
<string>Assets.xcassets/LaunchImages.launchimage</string>
</dict>
</plist>

Просмотреть файл

@ -1,15 +0,0 @@
using UIKit;
namespace SamplePhotoApp.tvOS
{
public class Application
{
// This is the main entry point of the application.
static void Main (string [] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -1,258 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.AppleTV.Storyboard" version="3.0" toolsVersion="11129.3" systemVersion="15F34" targetRuntime="AppleTV" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="YyW-FY-ilL">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11103.2"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Asset Grid View Controller-->
<scene sceneID="1js-rZ-uoo">
<objects>
<collectionViewController id="uZN-iM-VWn" customClass="AssetGridViewController" sceneMemberID="viewController">
<collectionView key="view" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="GPf-Pl-xo6">
<rect key="frame" x="0.0" y="0.0" width="1285" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="30" minimumInteritemSpacing="30" id="SiP-rR-HIh">
<size key="itemSize" width="280" height="280"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="30" minY="0.0" maxX="30" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="GridViewCell" id="P1W-st-1B8" customClass="GridViewCell">
<frame key="frameInset" minX="30" minY="145" width="280" height="280"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="280" height="280"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" adjustsImageWhenAncestorFocused="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zju-ST-Rcb"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="HJJ-W8-i4Z">
<constraints>
<constraint firstAttribute="height" constant="32" id="1e7-td-G9q"/>
<constraint firstAttribute="width" constant="32" id="vYv-5Q-pSs"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</view>
<constraints>
<constraint firstItem="zju-ST-Rcb" firstAttribute="leading" secondItem="P1W-st-1B8" secondAttribute="leading" id="5Ld-hY-rGO"/>
<constraint firstItem="HJJ-W8-i4Z" firstAttribute="leading" secondItem="P1W-st-1B8" secondAttribute="leading" id="INW-KA-gRP"/>
<constraint firstItem="zju-ST-Rcb" firstAttribute="top" secondItem="P1W-st-1B8" secondAttribute="top" id="WKM-QN-aZd"/>
<constraint firstAttribute="trailing" secondItem="zju-ST-Rcb" secondAttribute="trailing" id="xkC-N5-FDL"/>
<constraint firstAttribute="bottom" secondItem="zju-ST-Rcb" secondAttribute="bottom" id="xtG-kf-0i5"/>
<constraint firstItem="HJJ-W8-i4Z" firstAttribute="top" secondItem="P1W-st-1B8" secondAttribute="top" id="zeW-JL-QfU"/>
</constraints>
<connections>
<outlet property="imageView" destination="zju-ST-Rcb" id="o4N-oo-IbL"/>
<outlet property="livePhotoBadgeImageView" destination="HJJ-W8-i4Z" id="HAI-iE-HYt"/>
<segue destination="bCd-wL-H8p" kind="show" identifier="showAsset" action="showDetailViewController:sender:" id="7FM-u3-Rfu"/>
</connections>
</collectionViewCell>
</cells>
<connections>
<outlet property="dataSource" destination="uZN-iM-VWn" id="EJf-40-2SK"/>
<outlet property="delegate" destination="uZN-iM-VWn" id="6bh-xI-qYf"/>
</connections>
</collectionView>
<navigationItem key="navigationItem" id="YYJ-cl-BUI"/>
<connections>
<outlet property="addButtonItem" destination="1oI-Z1-ujj" id="K51-8L-feH"/>
</connections>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="JPu-Zl-zKS" userLabel="First Responder" sceneMemberID="firstResponder"/>
<barButtonItem systemItem="add" id="1oI-Z1-ujj">
<connections>
<action selector="addAsset:" destination="uZN-iM-VWn" id="cCs-1A-zEQ"/>
</connections>
</barButtonItem>
</objects>
<point key="canvasLocation" x="49" y="3562"/>
</scene>
<!--Asset View Controller-->
<scene sceneID="az8-GC-4Sk">
<objects>
<viewController id="bCd-wL-H8p" customClass="AssetViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="6ri-2e-T1u"/>
<viewControllerLayoutGuide type="bottom" id="AOS-Mc-JYH"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Uk4-X8-vlf">
<rect key="frame" x="0.0" y="0.0" width="1285" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" fixedFrame="YES" progress="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="JJB-9e-QzR">
<frame key="frameInset" minX="45" minY="535" width="1194" height="10"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</progressView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Sgg-Mw-sxc"/>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="Sgg-Mw-sxc" secondAttribute="trailing" id="DUl-An-3ma"/>
<constraint firstItem="Sgg-Mw-sxc" firstAttribute="leading" secondItem="Uk4-X8-vlf" secondAttribute="leading" id="R7R-m4-0h9"/>
<constraint firstAttribute="bottom" secondItem="Sgg-Mw-sxc" secondAttribute="bottom" id="WEo-T4-fCP"/>
<constraint firstItem="Sgg-Mw-sxc" firstAttribute="top" secondItem="Uk4-X8-vlf" secondAttribute="top" constant="145" id="fOh-ai-Bbj"/>
</constraints>
</view>
<toolbarItems>
<barButtonItem systemItem="trash" id="230-Hp-jWK">
<connections>
<action selector="removeAsset:" destination="bCd-wL-H8p" id="4yB-XT-HOe"/>
</connections>
</barButtonItem>
<barButtonItem title="Item" id="Byt-B4-2Cc" userLabel="Favorite">
<connections>
<action selector="toggleFavorite:" destination="bCd-wL-H8p" id="hkP-Tf-kpX"/>
</connections>
</barButtonItem>
<barButtonItem systemItem="play" id="sRh-Lm-hsr">
<connections>
<action selector="play:" destination="bCd-wL-H8p" id="UzY-2T-oSM"/>
</connections>
</barButtonItem>
<barButtonItem id="W1X-a7-bW7"/>
</toolbarItems>
<navigationItem key="navigationItem" id="HS1-jw-edF">
<barButtonItem key="rightBarButtonItem" title="Edit" id="n9I-UT-e7E">
<connections>
<action selector="editAsset:" destination="bCd-wL-H8p" id="cer-dP-5oV"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="editButton" destination="n9I-UT-e7E" id="QsN-0t-W5m"/>
<outlet property="favoriteButton" destination="Byt-B4-2Cc" id="TSG-pD-kzW"/>
<outlet property="imageView" destination="Sgg-Mw-sxc" id="uB7-xJ-Qas"/>
<outlet property="playButton" destination="sRh-Lm-hsr" id="V0W-In-c3G"/>
<outlet property="progressView" destination="JJB-9e-QzR" id="ToP-tq-28C"/>
<outlet property="space" destination="W1X-a7-bW7" id="1Xs-9S-2Oe"/>
<outlet property="trashButton" destination="230-Hp-jWK" id="OCH-OE-wwk"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="91w-yt-Yke" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2272" y="3562"/>
</scene>
<!--Photos-->
<scene sceneID="he0-o0-ZkF">
<objects>
<tableViewController clearsSelectionOnViewWillAppear="NO" id="rjh-Es-5bR" customClass="MasterViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="66" sectionHeaderHeight="40" sectionFooterHeight="40" id="Ktr-pj-pIF">
<rect key="frame" x="0.0" y="0.0" width="634" height="1080"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="allPhotos" textLabel="IAQ-pK-Ek6" style="IBUITableViewCellStyleDefault" id="R4c-1u-qra">
<frame key="frameInset" minY="199" width="634" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="R4c-1u-qra" id="o1Q-8L-jQQ">
<frame key="frameInset" width="618" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="IAQ-pK-Ek6">
<frame key="frameInset" minX="20" width="578" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="38"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="AqZ-RF-JG4" kind="showDetail" identifier="showAllPhotos" id="hqc-hK-aLY"/>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="collection" textLabel="kS8-tq-WcS" style="IBUITableViewCellStyleDefault" id="NZP-NC-HmX">
<frame key="frameInset" minY="279" width="634" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="NZP-NC-HmX" id="bji-Q3-kOT">
<frame key="frameInset" width="618" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="kS8-tq-WcS">
<frame key="frameInset" minX="20" width="578" height="66"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="38"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="AqZ-RF-JG4" kind="showDetail" identifier="showCollection" id="uva-be-2hc"/>
</connections>
</tableViewCell>
</prototypes>
<connections>
<outlet property="dataSource" destination="rjh-Es-5bR" id="Ftr-O4-sQn"/>
<outlet property="delegate" destination="rjh-Es-5bR" id="KsN-Dl-eP4"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Photos" id="coV-ZA-BEa"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="2vL-3a-Bhx" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2272" y="1573"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="T4l-8s-4Ae">
<objects>
<navigationController id="5o7-R4-v7l" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="eZn-FG-CfB">
<rect key="frame" x="0.0" y="0.0" width="1920" height="145"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="rjh-Es-5bR" kind="relationship" relationship="rootViewController" id="KSh-7o-fdr"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="zm1-Hh-Hcv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="49" y="1573"/>
</scene>
<!--Split View Controller-->
<scene sceneID="TCs-5M-m33">
<objects>
<splitViewController id="YyW-FY-ilL" sceneMemberID="viewController">
<connections>
<segue destination="5o7-R4-v7l" kind="relationship" relationship="masterViewController" id="nNU-m3-7Ot"/>
<segue destination="AqZ-RF-JG4" kind="relationship" relationship="detailViewController" id="WmA-V8-U3r"/>
</connections>
</splitViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ulN-Wq-Nms" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2171" y="1573"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="g8L-oe-ZdH">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="AqZ-RF-JG4" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" id="LoG-VL-lpn">
<rect key="frame" x="0.0" y="0.0" width="1920" height="145"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="96b-7U-gNF">
<rect key="frame" x="0.0" y="1036" width="1285" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</toolbar>
<connections>
<segue destination="uZN-iM-VWn" kind="relationship" relationship="rootViewController" id="svz-54-iyh"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Z72-7v-eaF" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-2171" y="3562"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<nil key="statusBar"/>
<simulatedOrientationMetrics key="orientation" orientation="landscapeRight"/>
<simulatedScreenMetrics key="destination" type="appleTV.light"/>
</simulatedMetricsContainer>
<inferredMetricsTieBreakers>
<segue reference="uva-be-2hc"/>
</inferredMetricsTieBreakers>
</document>

Просмотреть файл

@ -1,137 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectGuid>{7E640A09-100A-42CA-8678-40F81A85928A}</ProjectGuid>
<ProjectTypeGuids>{06FA79CB-D6CD-4721-BB4B-1BD202089C55};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>SamplePhotoApp.tvOS</RootNamespace>
<AssemblyName>SamplePhotoApp.tvOS</AssemblyName>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__TVOS__;DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchDebug>true</MtouchDebug>
<MtouchFastDev>true</MtouchFastDev>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
<DeviceSpecificBuild>false</DeviceSpecificBuild>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType></DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__TVOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseLlvm>true</MtouchUseLlvm>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<MtouchEnableBitcode>true</MtouchEnableBitcode>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType></DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__TVOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>None</MtouchLink>
<MtouchArch>x86_64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__TVOS__;DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchFastDev>true</MtouchFastDev>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchFloat32>true</MtouchFloat32>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchLink>SdkOnly</MtouchLink>
<MtouchArch>ARM64</MtouchArch>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
<MtouchTlsProvider>Default</MtouchTlsProvider>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.TVOS" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Back.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Back.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Front.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Front.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Middle.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Large.imagestack\Middle.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Back.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Back.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Front.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Front.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Middle.imagestacklayer\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\App Icon - Small.imagestack\Middle.imagestacklayer\Content.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\Top Shelf Image Wide.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\App Icon &amp; Top Shelf Image.brandassets\Top Shelf Image.imageset\Contents.json" />
<ImageAsset Include="Assets.xcassets\LaunchImages.launchimage\Contents.json" />
<ImageAsset Include="Assets.xcassets\Contents.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="ViewController.cs" />
<Compile Include="ViewController.designer.cs">
<DependentUpon>ViewController.cs</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Main.storyboard" />
</ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\TVOS\Xamarin.TVOS.CSharp.targets" />
</Project>

Просмотреть файл

@ -1,26 +0,0 @@
using System;
using Foundation;
using UIKit;
namespace SamplePhotoApp.tvOS
{
public partial class ViewController : UIViewController
{
public ViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
// Perform any additional setup after loading the view, typically from a nib.
}
public override void DidReceiveMemoryWarning ()
{
base.DidReceiveMemoryWarning ();
// Release any cached data, images, etc that aren't in use.
}
}
}

Просмотреть файл

@ -1,17 +0,0 @@
//
// This file has been generated automatically by MonoDevelop to store outlets and
// actions made in the Xcode designer. If it is removed, they will be lost.
// Manual changes to this file may not be handled correctly.
//
using Foundation;
namespace SamplePhotoApp.tvOS
{
[Register ("ViewController")]
partial class ViewController
{
void ReleaseDesignerOutlets ()
{
}
}
}

Просмотреть файл

@ -1,6 +0,0 @@
<?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>
</dict>
</plist>

Просмотреть файл

@ -1,51 +0,0 @@
<?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>CFBundleName</key>
<string>SamplePhotoApp</string>
<key>CFBundleIdentifier</key>
<string>com.xamarin.SamplePhotosApp</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>9.1</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
<integer>2</integer>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Storyboard</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</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>
<key>XSAppIconAssets</key>
<string>Resources/Images.xcassets/AppIcons.appiconset</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Sample App using the Photo Library</string>
</dict>
</plist>

Просмотреть файл

@ -1,12 +0,0 @@
using UIKit;
namespace SamplePhotoApp
{
public class Application
{
static void Main (string[] args)
{
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -1,190 +0,0 @@
{
"images": [
{
"filename": "icon-spotlight-29.png",
"size": "29x29",
"scale": "1x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-29@2x.png",
"size": "29x29",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-29@3x.png",
"size": "29x29",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-40@2x.png",
"size": "40x40",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-40@3x.png",
"size": "40x40",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-app-57.png",
"size": "57x57",
"scale": "1x",
"idiom": "iphone"
},
{
"filename": "icon-spp-57@2x.png",
"size": "57x57",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "icon-app-60@2x.png",
"size": "60x60",
"scale": "2x",
"idiom": "iphone"
},
{
"filename": "Icon-app-60@3x.png",
"size": "60x60",
"scale": "3x",
"idiom": "iphone"
},
{
"filename": "icon-spotlight-29.png",
"size": "29x29",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-29@2x.png",
"size": "29x29",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-40.png",
"size": "40x40",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-40@2x.png",
"size": "40x40",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-50.png",
"size": "50x50",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-spotlight-50@2x.png",
"size": "50x50",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-app-72.png",
"size": "72x72",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-app-72@2x.png",
"size": "72x72",
"scale": "2x",
"idiom": "ipad"
},
{
"filename": "icon-app-76.png",
"size": "76x76",
"scale": "1x",
"idiom": "ipad"
},
{
"filename": "icon-app-76@2x.png",
"size": "76x76",
"scale": "2x",
"idiom": "ipad"
},
{
"role": "notificationCenter",
"filename": "icon-watch-48.png",
"size": "24x24",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "notificationCenter",
"filename": "icon-watch-55.png",
"size": "27.5x27.5",
"subtype": "42mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "companionSettings",
"filename": "icon-watch-29@2x.png",
"size": "29x29",
"scale": "2x",
"idiom": "watch"
},
{
"role": "companionSettings",
"filename": "icon-watch-29@3x.png",
"size": "29x29",
"scale": "3x",
"idiom": "watch"
},
{
"role": "appLauncher",
"filename": "icon-watch-40@2x.png",
"size": "40x40",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "longLook",
"filename": "icon-watch-44@2x.png",
"size": "44x44",
"subtype": "42mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "quickLook",
"filename": "icon-watch-172.png",
"size": "86x86",
"subtype": "38mm",
"scale": "2x",
"idiom": "watch"
},
{
"role": "quickLook",
"filename": "icon-watch-196.png",
"size": "98x98",
"subtype": "42mm",
"scale": "2x",
"idiom": "watch"
},
{
"filename": "icon-carplay-120.png",
"size": "120x120",
"scale": "1x",
"idiom": "car"
}
],
"info": {
"version": 1,
"author": "xcode"
}
}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 4.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 900 B

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.8 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 3.1 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.0 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 5.5 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.6 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.1 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 2.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.2 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.5 KiB

Просмотреть файл

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Просмотреть файл

@ -1,23 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "splash-xamagon.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "splash-xamagon@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "splash-xamagon@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 6.3 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 16 KiB

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 29 KiB

Просмотреть файл

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8152.3" systemVersion="15A178w" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8124.4"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="LE5-Z4-Am4"/>
<viewControllerLayoutGuide type="bottom" id="mNk-pX-FNy"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="4AM-jj-fek">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="splash-xamagon" translatesAutoresizingMaskIntoConstraints="NO" id="e3X-hv-tO0">
<rect key="frame" x="236" y="236" width="128" height="128"/>
<animations/>
</imageView>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="e3X-hv-tO0" firstAttribute="centerY" secondItem="4AM-jj-fek" secondAttribute="centerY" id="KYd-0x-jga"/>
<constraint firstItem="e3X-hv-tO0" firstAttribute="centerX" secondItem="4AM-jj-fek" secondAttribute="centerX" id="bdz-0K-If4"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="splash-xamagon" width="128" height="128"/>
</resources>
</document>

Просмотреть файл

@ -1,280 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11129.3" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11103.2"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Navigation Controller-->
<scene sceneID="pY4-Hu-kfo">
<objects>
<navigationController id="RMx-3f-FxP" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="Pmd-2v-anx">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<connections>
<segue destination="7bK-jq-Zjz" kind="relationship" relationship="rootViewController" id="tsl-Nk-0bq"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8fS-aE-onr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-38" y="-630"/>
</scene>
<!--Split View Controller-->
<scene sceneID="Nki-YV-4Qg">
<objects>
<splitViewController id="H1p-Uh-vWS" sceneMemberID="viewController">
<toolbarItems/>
<connections>
<segue destination="RMx-3f-FxP" kind="relationship" relationship="masterViewController" id="BlO-5A-QYV"/>
<segue destination="vC3-pB-5Vb" kind="relationship" relationship="detailViewController" id="Tll-UG-LXB"/>
</connections>
</splitViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="cZU-Oi-B1e" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-856" y="-330"/>
</scene>
<!--Photos-->
<scene sceneID="smW-Zh-WAh">
<objects>
<tableViewController title="Photos" clearsSelectionOnViewWillAppear="NO" id="7bK-jq-Zjz" customClass="MasterViewController" sceneMemberID="viewController">
<tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="r7i-6Z-zg0">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="allPhotos" textLabel="Arm-wq-HPj" detailTextLabel="SHe-rx-Zgt" style="IBUITableViewCellStyleValue1" id="WCw-Qf-5nD">
<frame key="frameInset" minY="86" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
<frame key="frameInset" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">
<frame key="frameInset" minX="15" minY="12" width="33.5" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="SHe-rx-Zgt">
<frame key="frameInset" minX="316" minY="12" width="44" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<segue destination="vC3-pB-5Vb" kind="showDetail" identifier="showAllPhotos" id="a9Z-nh-I5x"/>
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="collection" textLabel="K6l-cR-29h" detailTextLabel="e2s-0C-bH8" style="IBUITableViewCellStyleValue1" id="ymh-1j-ojm">
<frame key="frameInset" minY="130" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ymh-1j-ojm" id="JdQ-yA-MZm">
<frame key="frameInset" width="375" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="Title" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="K6l-cR-29h">
<frame key="frameInset" minX="15" minY="12" width="33.5" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="e2s-0C-bH8">
<frame key="frameInset" minX="316" minY="12" width="44" height="20.5"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<connections>
<segue destination="vC3-pB-5Vb" kind="showDetail" identifier="showCollection" id="isy-3O-iv3"/>
</connections>
</tableViewCell>
</prototypes>
<sections/>
<connections>
<outlet property="dataSource" destination="7bK-jq-Zjz" id="Gho-Na-rnu"/>
<outlet property="delegate" destination="7bK-jq-Zjz" id="RA6-mI-bju"/>
</connections>
</tableView>
<navigationItem key="navigationItem" title="Photos" id="Zdf-7t-Un8"/>
</tableViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Rux-fX-hf1" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="709" y="-630"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="r7l-gg-dq7">
<objects>
<navigationController toolbarHidden="NO" id="vC3-pB-5Vb" sceneMemberID="viewController">
<navigationBar key="navigationBar" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" id="DjV-YW-jjY">
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<toolbar key="toolbar" opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="6fW-3P-Xnz">
<rect key="frame" x="0.0" y="623" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</toolbar>
<connections>
<segue destination="mEd-c0-4A5" kind="relationship" relationship="rootViewController" id="WN8-vB-Ad2"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="SLD-UC-DBI" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-45" y="129"/>
</scene>
<!--Asset View Controller-->
<scene sceneID="bu8-E5-AG6">
<objects>
<viewController id="Q4y-Ku-OQN" customClass="AssetViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="avy-i4-98V"/>
<viewControllerLayoutGuide type="bottom" id="Q7w-mX-dJY"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="QS7-aO-HHV">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="G0H-dS-NYh"/>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ofH-UU-rOE" customClass="PHLivePhotoView">
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="G0H-dS-NYh" secondAttribute="bottom" id="EBO-Jw-DWg"/>
<constraint firstItem="G0H-dS-NYh" firstAttribute="leading" secondItem="QS7-aO-HHV" secondAttribute="leading" id="SQm-L1-OLB"/>
<constraint firstItem="G0H-dS-NYh" firstAttribute="top" secondItem="QS7-aO-HHV" secondAttribute="top" id="bjZ-CL-aRn"/>
<constraint firstItem="Q7w-mX-dJY" firstAttribute="top" secondItem="ofH-UU-rOE" secondAttribute="bottom" id="gSi-Jk-0Uh"/>
<constraint firstItem="ofH-UU-rOE" firstAttribute="leading" secondItem="QS7-aO-HHV" secondAttribute="leading" id="ghq-TE-vYX"/>
<constraint firstAttribute="trailing" secondItem="ofH-UU-rOE" secondAttribute="trailing" id="mZ7-I4-rB7"/>
<constraint firstAttribute="trailing" secondItem="G0H-dS-NYh" secondAttribute="trailing" id="mvG-36-BxV"/>
<constraint firstItem="ofH-UU-rOE" firstAttribute="top" secondItem="avy-i4-98V" secondAttribute="bottom" id="ydA-en-xeN"/>
</constraints>
</view>
<toolbarItems/>
<navigationItem key="navigationItem" id="9TU-R7-B5W">
<nil key="title"/>
<progressView key="titleView" hidden="YES" opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progressViewStyle="bar" progress="0.5" id="qfn-hS-RWZ" userLabel="Progress View">
<rect key="frame" x="16" y="21" width="307" height="2.5"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</progressView>
<barButtonItem key="rightBarButtonItem" systemItem="edit" id="QMG-MP-PiU">
<connections>
<action selector="editAsset:" destination="Q4y-Ku-OQN" id="TIb-Vf-Xhp"/>
</connections>
</barButtonItem>
</navigationItem>
<simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
<simulatedToolbarMetrics key="simulatedBottomBarMetrics"/>
<connections>
<outlet property="editButton" destination="QMG-MP-PiU" id="ox2-Y5-LCf"/>
<outlet property="favoriteButton" destination="CDv-U5-I2s" id="BDg-Ml-EQt"/>
<outlet property="imageView" destination="G0H-dS-NYh" id="UbA-Gm-yEZ"/>
<outlet property="livePhotoView" destination="ofH-UU-rOE" id="Y6M-O2-ALQ"/>
<outlet property="playButton" destination="8y0-Go-kn7" id="1rd-XY-DMz"/>
<outlet property="progressView" destination="qfn-hS-RWZ" id="77I-Mb-5rM"/>
<outlet property="space" destination="FbF-A9-Ixl" id="Zsu-Bg-bZp"/>
<outlet property="trashButton" destination="Y0K-UE-MCp" id="EfO-GP-VQH"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9wA-9V-Ox2" userLabel="First Responder" sceneMemberID="firstResponder"/>
<barButtonItem systemItem="play" id="8y0-Go-kn7">
<connections>
<action selector="play:" destination="Q4y-Ku-OQN" id="dqU-Kz-obT"/>
</connections>
</barButtonItem>
<barButtonItem style="plain" systemItem="flexibleSpace" id="FbF-A9-Ixl"/>
<barButtonItem systemItem="trash" id="Y0K-UE-MCp">
<connections>
<action selector="removeAsset:" destination="Q4y-Ku-OQN" id="qiC-oE-ZfN"/>
</connections>
</barButtonItem>
<barButtonItem title="♡" id="CDv-U5-I2s">
<connections>
<action selector="toggleFavorite:" destination="Q4y-Ku-OQN" id="ekZ-uz-vzz"/>
</connections>
</barButtonItem>
</objects>
<point key="canvasLocation" x="1509" y="128"/>
</scene>
<!--Asset Grid View Controller-->
<scene sceneID="AG0-cu-bpp">
<objects>
<collectionViewController id="mEd-c0-4A5" customClass="AssetGridViewController" sceneMemberID="viewController">
<collectionView key="view" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="bIC-Zl-0JL">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="DJA-Lb-Xgj">
<size key="itemSize" width="80" height="80"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="GridViewCell" id="cUE-R9-xrz" customClass="GridViewCell">
<frame key="frameInset" minY="64" width="80" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="80" height="80"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="2Hr-HS-oNO"/>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EVd-RX-S0n">
<constraints>
<constraint firstAttribute="height" constant="28" placeholder="YES" id="4TK-Cf-cYb"/>
<constraint firstAttribute="width" constant="28" placeholder="YES" id="7HB-sg-DaU"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<constraints>
<constraint firstAttribute="bottom" secondItem="2Hr-HS-oNO" secondAttribute="bottom" id="5vU-gV-LKM"/>
<constraint firstItem="2Hr-HS-oNO" firstAttribute="leading" secondItem="cUE-R9-xrz" secondAttribute="leading" id="Jms-ht-lIG"/>
<constraint firstItem="2Hr-HS-oNO" firstAttribute="top" secondItem="cUE-R9-xrz" secondAttribute="top" id="nHN-gk-Mkq"/>
<constraint firstAttribute="trailing" secondItem="2Hr-HS-oNO" secondAttribute="trailing" id="wIQ-ec-TXk"/>
<constraint firstItem="EVd-RX-S0n" firstAttribute="top" secondItem="cUE-R9-xrz" secondAttribute="top" id="yD5-nc-7cH"/>
<constraint firstItem="EVd-RX-S0n" firstAttribute="leading" secondItem="cUE-R9-xrz" secondAttribute="leading" id="zFF-tW-3Kz"/>
</constraints>
<connections>
<outlet property="imageView" destination="2Hr-HS-oNO" id="65f-Fw-8hK"/>
<outlet property="livePhotoBadgeImageView" destination="EVd-RX-S0n" id="AVi-Zf-Zvr"/>
<segue destination="Q4y-Ku-OQN" kind="showDetail" id="OXs-Hc-Pjw"/>
</connections>
</collectionViewCell>
</cells>
<connections>
<outlet property="dataSource" destination="mEd-c0-4A5" id="Eb8-bN-PvQ"/>
<outlet property="delegate" destination="mEd-c0-4A5" id="ATN-SF-2Ph"/>
</connections>
</collectionView>
<navigationItem key="navigationItem" id="7Fh-Zb-LGx"/>
<connections>
<outlet property="addButtonItem" destination="haJ-ZN-72v" id="V4J-Wr-qeE"/>
</connections>
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="sNK-oD-waS" userLabel="First Responder" sceneMemberID="firstResponder"/>
<barButtonItem systemItem="add" id="haJ-ZN-72v">
<connections>
<action selector="addAsset:" destination="mEd-c0-4A5" id="9Y8-kC-iK0"/>
</connections>
</barButtonItem>
</objects>
<point key="canvasLocation" x="708" y="128"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
<segue reference="a9Z-nh-I5x"/>
</inferredMetricsTieBreakers>
</document>

Просмотреть файл

@ -1,139 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{F2483E34-332B-4C6B-B2C1-196BBF9068A1}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>SamplePhotoApp</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>SamplePhotoApp</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>__IOS__;DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchFastDev>true</MtouchFastDev>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType></DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<DefineConstants>__IOS__</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARM64</MtouchArch>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
<MtouchUseSGen>true</MtouchUseSGen>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType></DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<DefineConstants>__IOS__</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>x86_64</MtouchArch>
<MtouchLink>None</MtouchLink>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<CodesignKey>iPhone Developer</CodesignKey>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>__UNIFIED__;__MOBILE__;__IOS__;DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchArch>ARM64</MtouchArch>
<MtouchLink>None</MtouchLink>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchFloat32>true</MtouchFloat32>
<CodesignKey>iPhone Developer</CodesignKey>
<DeviceSpecificBuild>true</DeviceSpecificBuild>
<MtouchDebug>true</MtouchDebug>
<MtouchFastDev>true</MtouchFastDev>
<MtouchUseRefCounting>true</MtouchUseRefCounting>
<MtouchUseSGen>true</MtouchUseSGen>
<MtouchHttpClientHandler>NSUrlSessionHandler</MtouchHttpClientHandler>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.iOS" />
</ItemGroup>
<ItemGroup>
<InterfaceDefinition Include="Resources\Main.storyboard" />
<InterfaceDefinition Include="Resources\LaunchScreen.storyboard" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
</ItemGroup>
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
<Folder Include="Resources\" />
<Folder Include="Resources\Images.xcassets\" />
</ItemGroup>
<ItemGroup>
<ImageAsset Include="Resources\Images.xcassets\Contents.json" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Contents.json" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\Icon-app-60%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-57.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-60%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-72.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-72%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-76.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-app-76%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-carplay-120.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-29.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-29%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-29%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-40.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-40%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-40%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-50.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spotlight-50%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-spp-57%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-172.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-196.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-29%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-29%403x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-40%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-44%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-48.png" />
<ImageAsset Include="Resources\Images.xcassets\AppIcons.appiconset\icon-watch-55.png" />
<ImageAsset Include="Resources\Images.xcassets\splash-xamagon.imageset\Contents.json" />
<ImageAsset Include="Resources\Images.xcassets\splash-xamagon.imageset\splash-xamagon.png" />
<ImageAsset Include="Resources\Images.xcassets\splash-xamagon.imageset\splash-xamagon%402x.png" />
<ImageAsset Include="Resources\Images.xcassets\splash-xamagon.imageset\splash-xamagon%403x.png" />
</ItemGroup>
</Project>

Двоичные данные
ios10/SamplePhotoApp/Screenshots/0.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 60 KiB

Двоичные данные
ios10/SamplePhotoApp/Screenshots/1.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 1.1 MiB

Двоичные данные
ios10/SamplePhotoApp/Screenshots/2.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 736 KiB

Двоичные данные
ios10/SamplePhotoApp/Screenshots/3.PNG

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 782 KiB

Просмотреть файл

@ -1,59 +0,0 @@
using System.Linq;
using Foundation;
using UIKit;
namespace SamplePhotoApp
{
[Register ("AppDelegate")]
public class AppDelegate : UIApplicationDelegate, IUISplitViewControllerDelegate
{
public override UIWindow Window { get; set; }
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
var splitViewController = Window.RootViewController as UISplitViewController;
#if __IOS__
var navigationController = (UINavigationController)splitViewController.ViewControllers.Last ();
navigationController.TopViewController.NavigationItem.LeftBarButtonItem = splitViewController.DisplayModeButtonItem;
#endif
splitViewController.Delegate = this;
return true;
}
[Export ("splitViewController:collapseSecondaryViewController:ontoPrimaryViewController:")]
public bool CollapseSecondViewController (UISplitViewController splitViewController, UIViewController secondaryViewController, UIViewController primaryViewController)
{
var secondaryAsNavController = secondaryViewController as UINavigationController;
if (secondaryAsNavController == null)
return false;
var topAsDetailController = secondaryAsNavController.TopViewController as AssetGridViewController;
if (topAsDetailController == null)
return false;
// Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return topAsDetailController.FetchResult == null;
}
[Export ("splitViewController:showDetailViewController:sender:")]
public bool EventShowDetailViewController (UISplitViewController splitViewController, UIViewController vc, NSObject sender)
{
// Let the storyboard handle the segue for every case except going from detail:assetgrid to detail:asset.
if (splitViewController.Collapsed)
return false;
if (vc is UINavigationController)
return false;
var detailNavController = splitViewController.ViewControllers.Last () as UINavigationController;
if (detailNavController == null || detailNavController.ViewControllers.Length == 1)
return false;
detailNavController.PushViewController (vc, true);
return true;
}
}
}

Просмотреть файл

@ -1,328 +0,0 @@
using System;
using System.Linq;
using System.Collections.Generic;
using UIKit;
using Foundation;
using CoreFoundation;
using CoreGraphics;
using Photos;
#if __IOS__ && !__TVOS__
using PhotosUI;
#endif
namespace SamplePhotoApp
{
public class Rects
{
public IEnumerable<CGRect> Added { get; set; }
public IEnumerable<CGRect> Removed { get; set; }
}
public partial class AssetGridViewController : UICollectionViewController, IPHPhotoLibraryChangeObserver
{
const string cellReuseIdentifier = "GridViewCell";
public PHFetchResult FetchResult { get; set; }
public PHAssetCollection AssetCollection { get; set; }
static CGSize thumbnailSize;
readonly PHCachingImageManager imageManager = new PHCachingImageManager ();
CGRect previousPreheatRect;
[Export ("initWithCoder:")]
public AssetGridViewController (NSCoder coder)
: base (coder)
{
}
public AssetGridViewController (IntPtr handle)
: base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
ResetCachedAssets ();
PHPhotoLibrary.SharedPhotoLibrary.RegisterChangeObserver (this);
// If we get here without a segue, it's because we're visible at app launch,
// so match the behavior of segue from the default "All Photos" view.
if (FetchResult == null) {
var allPhotosOptions = new PHFetchOptions {
SortDescriptors = new NSSortDescriptor [] { new NSSortDescriptor ("creationDate", true) }
};
FetchResult = PHAsset.FetchAssets (allPhotosOptions);
}
}
protected override void Dispose (bool disposing)
{
PHPhotoLibrary.SharedPhotoLibrary.UnregisterChangeObserver (this);
base.Dispose (disposing);
}
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
// Determine the size of the thumbnails to request from the PHCachingImageManager
nfloat scale = UIScreen.MainScreen.Scale;
CGSize cellSize = ((UICollectionViewFlowLayout)CollectionView.CollectionViewLayout).ItemSize;
thumbnailSize = new CGSize (cellSize.Width * scale, cellSize.Height * scale);
// Add button to the navigation bar if the asset collection supports adding content.
if (AssetCollection == null || AssetCollection.CanPerformEditOperation (PHCollectionEditOperation.AddContent))
NavigationItem.RightBarButtonItem = AddButtonItem;
else
NavigationItem.RightBarButtonItem = null;
}
public override void ViewDidAppear (bool animated)
{
base.ViewDidAppear (animated);
UpdateCachedAssets ();
}
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender)
{
// Configure the destination AssetViewController.
var assetViewController = segue.DestinationViewController as AssetViewController;
if (assetViewController == null)
throw new InvalidProgramException ("unexpected view controller for segue");
var indexPath = CollectionView.IndexPathForCell ((UICollectionViewCell)sender);
assetViewController.Asset = (PHAsset)FetchResult [indexPath.Item];
assetViewController.AssetCollection = AssetCollection;
}
#region UICollectionView
public override nint GetItemsCount (UICollectionView collectionView, nint section)
{
return FetchResult.Count;
}
public override UICollectionViewCell GetCell (UICollectionView collectionView, NSIndexPath indexPath)
{
var asset = (PHAsset)FetchResult [indexPath.Item];
// Dequeue an GridViewCell.
var cell = (GridViewCell)collectionView.DequeueReusableCell (cellReuseIdentifier, indexPath);
#if __IOS__ && !__TVOS__
// Add a badge to the cell if the PHAsset represents a Live Photo.
// Add Badge Image to the cell to denote that the asset is a Live Photo.
if (asset.MediaSubtypes.HasFlag (PHAssetMediaSubtype.PhotoLive))
cell.LivePhotoBadgeImage = PHLivePhotoView.GetLivePhotoBadgeImage (PHLivePhotoBadgeOptions.OverContent);
#endif
// Request an image for the asset from the PHCachingImageManager.
cell.RepresentedAssetIdentifier = asset.LocalIdentifier;
imageManager.RequestImageForAsset (asset, thumbnailSize, PHImageContentMode.AspectFill, null, (image, info) => {
// Set the cell's thumbnail image if it's still showing the same asset.
if (cell.RepresentedAssetIdentifier == asset.LocalIdentifier)
cell.ThumbnailImage = image;
});
return cell;
}
#endregion
#region UIScrollView
#if __IOS__ && !__TVOS__
public override void Scrolled (UIScrollView scrollView)
#elif __TVOS__
[Export ("scrollViewDidScroll:")]
public void Scrolled (UIScrollView scrollView)
#endif
{
UpdateCachedAssets ();
}
#endregion
#region Asset Caching
void ResetCachedAssets ()
{
imageManager.StopCaching ();
previousPreheatRect = CGRect.Empty;
}
void UpdateCachedAssets ()
{
bool isViewVisible = IsViewLoaded && View.Window != null;
if (!isViewVisible)
return;
// The preheat window is twice the height of the visible rect.
CGRect preheatRect = CollectionView.Bounds;
preheatRect = preheatRect.Inset (0, -preheatRect.Height / 2);
// Update only if the visible area is significantly different from the last preheated area.
nfloat delta = NMath.Abs (preheatRect.GetMidY () - previousPreheatRect.GetMidY ());
if (delta <= CollectionView.Bounds.Height / 3)
return;
// Compute the assets to start caching and to stop caching.
var rects = ComputeDifferenceBetweenRect (previousPreheatRect, preheatRect);
var addedAssets = rects.Added
.SelectMany (rect => CollectionView.GetIndexPaths (rect))
.Select (indexPath => FetchResult.ObjectAt (indexPath.Item))
.Cast<PHAsset> ()
.ToArray ();
var removedAssets = rects.Removed
.SelectMany (rect => CollectionView.GetIndexPaths (rect))
.Select (indexPath => FetchResult.ObjectAt (indexPath.Item))
.Cast<PHAsset> ()
.ToArray ();
// Update the assets the PHCachingImageManager is caching.
imageManager.StartCaching (addedAssets, thumbnailSize, PHImageContentMode.AspectFill, null);
imageManager.StopCaching (removedAssets, thumbnailSize, PHImageContentMode.AspectFill, null);
// Store the preheat rect to compare against in the future.
previousPreheatRect = preheatRect;
}
static Rects ComputeDifferenceBetweenRect (CGRect oldRect, CGRect newRect)
{
if (!oldRect.IntersectsWith (newRect)) {
return new Rects {
Added = new CGRect [] { newRect },
Removed = new CGRect [] { oldRect }
};
}
var oldMaxY = oldRect.GetMaxY ();
var oldMinY = oldRect.GetMinY ();
var newMaxY = newRect.GetMaxY ();
var newMinY = newRect.GetMinY ();
var added = new List<CGRect> ();
var removed = new List<CGRect> ();
if (newMaxY > oldMaxY)
added.Add (new CGRect (newRect.X, oldMaxY, newRect.Width, newMaxY - oldMaxY));
if (oldMinY > newMinY)
added.Add (new CGRect (newRect.X, newMinY, newRect.Width, oldMinY - newMinY));
if (newMaxY < oldMaxY)
removed.Add (new CGRect (newRect.X, newMaxY, newRect.Width, oldMaxY - newMaxY));
if (oldMinY < newMinY)
removed.Add (new CGRect (newRect.X, oldMinY, newRect.Width, newMinY - oldMinY));
return new Rects {
Added = added,
Removed = removed
};
}
#endregion
#region UI Actions
partial void AddAsset (NSObject sender)
{
var rnd = new Random ();
// Create a random dummy image.
var size = (rnd.Next (0, 2) == 0)
? new CGSize (400f, 300f)
: new CGSize (300f, 400f);
var renderer = new UIGraphicsImageRenderer (size);
var image = renderer.CreateImage (context => {
UIColor.FromHSBA ((float)rnd.NextDouble (), 1, 1, 1).SetFill ();
context.FillRect (context.Format.Bounds);
});
// Add it to the photo library
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
PHAssetChangeRequest creationRequest = PHAssetChangeRequest.FromImage (image);
if (AssetCollection != null) {
var addAssetRequest = PHAssetCollectionChangeRequest.ChangeRequest (AssetCollection);
addAssetRequest.AddAssets (new PHObject [] {
creationRequest.PlaceholderForCreatedAsset
});
}
}, (success, error) => {
if (!success)
Console.WriteLine (error.LocalizedDescription);
});
}
#endregion
#region IPHPhotoLibraryChangeObserver
public void PhotoLibraryDidChange (PHChange changeInstance)
{
var changes = changeInstance.GetFetchResultChangeDetails (FetchResult);
if (changes == null)
return;
DispatchQueue.MainQueue.DispatchSync (() => {
// Hang on to the new fetch result.
FetchResult = changes.FetchResultAfterChanges;
if (changes.HasIncrementalChanges) {
// If we have incremental diffs, animate them in the collection view.
CollectionView.PerformBatchUpdates (() => {
// For indexes to make sense, updates must be in this order:
// delete, insert, reload, move
var removed = changes.RemovedIndexes;
if (removed != null && removed.Count > 0)
CollectionView.DeleteItems (ToNSIndexPaths (removed));
var inserted = changes.InsertedIndexes;
if (inserted != null && inserted.Count > 0)
CollectionView.InsertItems (ToNSIndexPaths (inserted));
var changed = changes.ChangedIndexes;
if (changed != null && changed.Count > 0)
CollectionView.ReloadItems (ToNSIndexPaths (changed));
changes.EnumerateMoves ((fromIndex, toIndex) => {
var start = NSIndexPath.FromItemSection ((nint)fromIndex, 0);
var end = NSIndexPath.FromItemSection ((nint)toIndex, 0);
CollectionView.MoveItem (start, end);
});
}, null);
} else {
// Reload the collection view if incremental diffs are not available.
CollectionView.ReloadData ();
}
ResetCachedAssets ();
});
}
static NSIndexPath [] ToNSIndexPaths (NSIndexSet indexSet)
{
var cnt = indexSet.Count;
var result = new NSIndexPath [(int)cnt];
int i = 0;
indexSet.EnumerateIndexes ((nuint idx, ref bool stop) => {
stop = false;
result [i++] = NSIndexPath.FromItemSection ((nint)idx, 0);
});
return result;
}
#endregion
}
}

Просмотреть файл

@ -1,23 +0,0 @@
using UIKit;
using Foundation;
namespace SamplePhotoApp
{
[Register ("AssetGridViewController")]
partial class AssetGridViewController
{
[Outlet("addButtonItem")]
UIBarButtonItem AddButtonItem { get; set; }
[Action ("addAsset:")]
partial void AddAsset (NSObject sender);
void ReleaseDesignerOutlets ()
{
if (AddButtonItem != null) {
AddButtonItem.Dispose ();
AddButtonItem = null;
}
}
}
}

Просмотреть файл

@ -1,499 +0,0 @@
using System;
using UIKit;
using Foundation;
using AVFoundation;
using CoreFoundation;
using CoreGraphics;
using CoreImage;
using Photos;
using System.Runtime.InteropServices;
using ObjCRuntime;
#if __IOS__ && !__TVOS__
using PhotosUI;
#endif
namespace SamplePhotoApp
{
#if __IOS__ && !__TVOS__
public partial class AssetViewController : UIViewController, IPHPhotoLibraryChangeObserver, IPHLivePhotoViewDelegate
#else
public partial class AssetViewController : UIViewController, IPHPhotoLibraryChangeObserver
#endif
{
AVPlayerLayer playerLayer;
#if __IOS__ && !__TVOS__
bool playingHint;
#endif
readonly string formatIdentifier = NSBundle.MainBundle.BundleIdentifier;
readonly string formatVersion = "1.0";
readonly CIContext ciContext = CIContext.Create ();
public PHAsset Asset { get; set; }
public PHAssetCollection AssetCollection { get; set; }
CGSize TargetSize {
get {
nfloat scale = UIScreen.MainScreen.Scale;
var targetSize = new CGSize (ImageView.Bounds.Width * scale, ImageView.Bounds.Height * scale);
return targetSize;
}
}
[Export ("initWithCoder:")]
public AssetViewController (NSCoder coder)
: base (coder)
{
}
public AssetViewController (IntPtr handle)
: base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
#if __IOS__ && !__TVOS__
LivePhotoView.Delegate = this;
#endif
PHPhotoLibrary.SharedPhotoLibrary.RegisterChangeObserver (this);
}
protected override void Dispose (bool disposing)
{
PHPhotoLibrary.SharedPhotoLibrary.UnregisterChangeObserver (this);
base.Dispose (disposing);
}
public override void ViewWillAppear (bool animated)
{
base.ViewWillAppear (animated);
// Set the appropriate toolbarItems based on the mediaType of the asset.
if (Asset.MediaType == PHAssetMediaType.Video) {
#if __IOS__ && !__TVOS__
ToolbarItems = new UIBarButtonItem [] { FavoriteButton, Space, PlayButton, Space, TrashButton };
if (NavigationController != null)
NavigationController.ToolbarHidden = false;
#elif __TVOS__
NavigationItem.LeftBarButtonItems = new UIBarButtonItem [] { PlayButton, FavoriteButton, TrashButton };
#endif
} else {
// Live Photos have their own playback UI, so present them like regular photos, just like Photos app
#if __IOS__ && !__TVOS__
ToolbarItems = new UIBarButtonItem [] { FavoriteButton, Space, TrashButton };
if (NavigationController != null)
NavigationController.ToolbarHidden = false;
#elif __TVOS__
NavigationItem.LeftBarButtonItems = new UIBarButtonItem [] { FavoriteButton, TrashButton };
#endif
}
// Enable editing buttons if the asset can be edited.
EditButton.Enabled = Asset.CanPerformEditOperation (PHAssetEditOperation.Content);
FavoriteButton.Enabled = Asset.CanPerformEditOperation (PHAssetEditOperation.Properties);
FavoriteButton.Title = Asset.Favorite ? "♥︎" : "♡";
// Enable the trash button if the asset can be deleted.
if (AssetCollection != null)
TrashButton.Enabled = AssetCollection.CanPerformEditOperation (PHCollectionEditOperation.RemoveContent);
else
TrashButton.Enabled = Asset.CanPerformEditOperation (PHAssetEditOperation.Delete);
// Make sure the view layout happens before requesting an image sized to fit the view.
View.LayoutIfNeeded ();
UpdateImage ();
}
#region UI Actions
partial void EditAsset (UIBarButtonItem sender)
{
// Use a UIAlertController to display editing options to the user.
var alertController = UIAlertController.Create (null, null, UIAlertControllerStyle.ActionSheet);
#if __IOS__ && !__TVOS__
alertController.ModalPresentationStyle = UIModalPresentationStyle.Popover;
var popoverController = alertController.PopoverPresentationController;
if (popoverController != null) {
popoverController.BarButtonItem = sender;
popoverController.PermittedArrowDirections = UIPopoverArrowDirection.Up;
}
#endif
// Add a Cancel action to dismiss the alert without doing anything.
alertController.AddAction (UIAlertAction.Create ("Cancel", UIAlertActionStyle.Cancel, null));
// Allow editing only if the PHAsset supports edit operations.
if (Asset.CanPerformEditOperation (PHAssetEditOperation.Content)) {
// Add actions for some canned filters.
alertController.AddAction (UIAlertAction.Create ("Sepia Tone", UIAlertActionStyle.Default, _ => {
ApplyFilter (new CISepiaTone ());
}));
alertController.AddAction (UIAlertAction.Create ("Chrome", UIAlertActionStyle.Default, _ => {
ApplyFilter (new CIPhotoEffectChrome ());
}));
// Add actions to revert any edits that have been made to the PHAsset.
alertController.AddAction (UIAlertAction.Create ("Revert", UIAlertActionStyle.Default, RevertAsset));
}
// Present the UIAlertController.
PresentViewController (alertController, true, null);
}
#endregion
public void PhotoLibraryDidChange (PHChange changeInstance)
{
// Call might come on any background queue. Re-dispatch to the main queue to handle it.
DispatchQueue.MainQueue.DispatchAsync (() => {
// Check if there are changes to the asset we're displaying.
PHObjectChangeDetails changeDetails = changeInstance.GetObjectChangeDetails (Asset);
if (changeDetails == null)
return;
// Get the updated asset.
// TODO: check return type. Catch! ObjectAfterChanges should be PHObject instead of NSObject https://bugzilla.xamarin.com/show_bug.cgi?id=35540
Asset = (PHAsset)changeDetails.ObjectAfterChanges;
if(Asset != null)
FavoriteButton.Title = Asset.Favorite ? "♥︎" : "♡";
// If the asset's content changed, update the image and stop any video playback.
if (changeDetails.AssetContentChanged) {
UpdateImage ();
playerLayer?.RemoveFromSuperLayer ();
playerLayer = null;
}
});
}
partial void Play (NSObject sender)
{
// An AVPlayerLayer has already been created for this asset; just play it.
if (playerLayer != null) {
playerLayer.Player.Play ();
} else {
// Request an AVAsset for the displayed PHAsset and set up a layer for playing it.
PHImageManager.DefaultManager.RequestAvAsset (Asset, null, (avAsset, audioMix, info) => {
DispatchQueue.MainQueue.DispatchSync (() => {
if (playerLayer != null)
return;
// Create an AVPlayerItem for the AVAsset.
var playerItem = new AVPlayerItem (avAsset);
playerItem.AudioMix = audioMix;
// Create an AVPlayer with the AVPlayerItem.
var player = new AVPlayer (playerItem);
// Create an AVPlayerLayer with the AVPlayer.
var layer = AVPlayerLayer.FromPlayer (player);
layer.VideoGravity = AVLayerVideoGravity.ResizeAspect;
layer.Frame = View.Layer.Bounds;
View.Layer.AddSublayer (layer);
player.Play ();
// Refer to the player layer so we can remove it later.
playerLayer = layer;
});
});
}
}
partial void RemoveAsset (NSObject sender)
{
Action<bool, NSError> completion = (success, error) => {
if (success) {
PHPhotoLibrary.SharedPhotoLibrary.UnregisterChangeObserver (this);
DispatchQueue.MainQueue.DispatchSync (() => NavigationController.PopViewController (true));
} else {
Console.WriteLine ($"can't remove asset: {error.LocalizedDescription}");
}
};
if (AssetCollection != null) {
// Remove asset from album
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
var request = PHAssetCollectionChangeRequest.ChangeRequest (AssetCollection);
request.RemoveAssets (new PHObject [] { Asset });
}, completion);
} else {
// Delete asset from library
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() =>
PHAssetChangeRequest.DeleteAssets (new [] { Asset }), completion);
}
}
partial void ToggleFavorite (UIBarButtonItem sender)
{
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
var request = PHAssetChangeRequest.ChangeRequest (Asset);
request.Favorite = !Asset.Favorite;
}, (success, error) => {
// Original sample updates FavoriteButton.Title here
// but this doesn't work, because you have to wait PhotoLibraryDidChange notification.
// At this point you just know is there any issue or everthing is ok.
if (!success)
Console.WriteLine ($"can't set favorite: {error.LocalizedDescription}");
});
}
#region Image display
void UpdateImage ()
{
#if __IOS__ && !__TVOS__
// Check the asset's MediaSubtypes to determine if this is a live photo or not.
if (Asset.MediaSubtypes.HasFlag (PHAssetMediaSubtype.PhotoLive))
UpdateLivePhoto ();
else
UpdateStaticImage ();
#else
UpdateStaticImage ();
#endif
}
#if __IOS__ && !__TVOS__
void UpdateLivePhoto ()
{
// Prepare the options to pass when fetching the live photo.
var options = new PHLivePhotoRequestOptions {
DeliveryMode = PHImageRequestOptionsDeliveryMode.HighQualityFormat,
NetworkAccessAllowed = true,
ProgressHandler = (double progress, NSError error, out bool stop, NSDictionary dictionary) => {
stop = false;
// Handler might not be called on the main queue, so re-dispatch for UI work.
DispatchQueue.MainQueue.DispatchSync (() => ProgressView.Progress = (float)progress);
}
};
// Request the live photo for the asset from the default PHImageManager.
PHImageManager.DefaultManager.RequestLivePhoto (Asset, TargetSize, PHImageContentMode.AspectFit, options, (livePhoto, info) => {
// Hide the progress view now the request has completed.
ProgressView.Hidden = true;
// If successful, show the live photo view and display the live photo.
if (livePhoto == null)
return;
// Now that we have the Live Photo, show it.
ImageView.Hidden = true;
LivePhotoView.Hidden = false;
LivePhotoView.LivePhoto = livePhoto;
if (info == null)
return;
// TODO: strong typed API https://bugzilla.xamarin.com/show_bug.cgi?id=44424
var degraded = ((NSNumber)info [PHImageKeys.ResultIsDegraded]).BoolValue;
// Playback a short section of the live photo; similar to the Photos share sheet.
if (degraded && playingHint)
LivePhotoView.StartPlayback (PHLivePhotoViewPlaybackStyle.Hint);
});
}
#endif
void UpdateStaticImage ()
{
// Prepare the options to pass when fetching the (photo, or video preview) image.
var options = new PHImageRequestOptions {
DeliveryMode = PHImageRequestOptionsDeliveryMode.HighQualityFormat,
NetworkAccessAllowed = true,
ProgressHandler = (double progress, NSError error, out bool stop, NSDictionary info) => {
stop = false;
// Handler might not be called on the main queue, so re-dispatch for UI work.
DispatchQueue.MainQueue.DispatchSync (() => {
ProgressView.Progress = (float)progress;
});
}
};
PHImageManager.DefaultManager.RequestImageForAsset (Asset, TargetSize, PHImageContentMode.AspectFit, options, (image, info) => {
// Hide the progress view now the request has completed.
ProgressView.Hidden = true;
// If successful, show the image view and display the image.
if (image == null)
return;
// Now that we have the image, show it.
#if __IOS__ && !__TVOS__
LivePhotoView.Hidden = true;
#endif
ImageView.Hidden = false;
ImageView.Image = image;
});
}
#endregion
#region Asset editing
void RevertAsset (UIAlertAction action)
{
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
var request = PHAssetChangeRequest.ChangeRequest (Asset);
request.RevertAssetContentToOriginal ();
}, (success, error) => {
if (!success)
Console.WriteLine ($"can't revert asset: {error.LocalizedDescription}");
});
}
#endregion
void ApplyFilter (CIFilter filter)
{
// Set up a handler to make sure we can handle prior edits.
var options = new PHContentEditingInputRequestOptions ();
options.CanHandleAdjustmentData = (adjustmentData => {
return adjustmentData.FormatIdentifier == formatIdentifier && adjustmentData.FormatVersion == formatVersion;
});
// Prepare for editing.
Asset.RequestContentEditingInput (options, (input, requestStatusInfo) => {
if (input == null)
throw new InvalidProgramException ($"can't get content editing input: {requestStatusInfo}");
// This handler gets called on the main thread; dispatch to a background queue for processing.
DispatchQueue.GetGlobalQueue (DispatchQueuePriority.Default).DispatchAsync (() => {
// Create a PHAdjustmentData object that describes the filter that was applied.
var adjustmentData = new PHAdjustmentData (
formatIdentifier,
formatVersion,
NSData.FromString (filter.Name, NSStringEncoding.UTF8));
// NOTE:
// This app's filter UI is fire-and-forget. That is, the user picks a filter,
// and the app applies it and outputs the saved asset immediately. There's
// no UI state for having chosen but not yet committed an edit. This means
// there's no role for reading adjustment data -- you do that to resume
// in-progress edits, and this sample app has no notion of "in-progress".
//
// However, it's still good to write adjustment data so that potential future
// versions of the app (or other apps that understand our adjustement data
// format) could make use of it.
// Create content editing output, write the adjustment data.
var output = new PHContentEditingOutput (input) {
AdjustmentData = adjustmentData
};
// Select a filtering function for the asset's media type.
Action<CIFilter, PHContentEditingInput, PHContentEditingOutput, Action> applyFunc;
if (Asset.MediaSubtypes.HasFlag (PHAssetMediaSubtype.PhotoLive))
applyFunc = ApplyLivePhotoFilter;
else if (Asset.MediaType == PHAssetMediaType.Image)
applyFunc = ApplyPhotoFilter;
else
applyFunc = ApplyVideoFilter;
// Apply the filter.
applyFunc (filter, input, output, () => {
// When rendering is done, commit the edit to the Photos library.
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
var request = PHAssetChangeRequest.ChangeRequest (Asset);
request.ContentEditingOutput = output;
}, (success, error) => {
if (!success)
Console.WriteLine ($"can't edit asset: {error.LocalizedDescription}");
});
});
});
});
}
void ApplyPhotoFilter (CIFilter filter, PHContentEditingInput input, PHContentEditingOutput output, Action completion)
{
// Load the full size image.
var inputImage = new CIImage (input.FullSizeImageUrl);
// Apply the filter.
filter.Image = inputImage.CreateWithOrientation (input.FullSizeImageOrientation);
var outputImage = filter.OutputImage;
// Write the edited image as a JPEG.
// TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=44503
NSError error;
if (!ciContext.WriteJpegRepresentation (outputImage, output.RenderedContentUrl, inputImage.ColorSpace (), new NSDictionary(), out error))
throw new InvalidProgramException ($"can't apply filter to image: {error.LocalizedDescription}");
completion ();
}
void ApplyLivePhotoFilter (CIFilter filter, PHContentEditingInput input, PHContentEditingOutput output, Action completion)
{
// This app filters assets only for output. In an app that previews
// filters while editing, create a livePhotoContext early and reuse it
// to render both for previewing and for final output.
var livePhotoContext = new PHLivePhotoEditingContext (input);
livePhotoContext.FrameProcessor2 = (IPHLivePhotoFrame frame, ref NSError _) => {
filter.Image = frame.Image;
return filter.OutputImage;
};
PHLivePhotoEditingOption option = null;
livePhotoContext.SaveLivePhoto (output, option, (success, error) => {
if (success)
completion ();
else
Console.WriteLine ("can't output live photo");
});
}
void ApplyVideoFilter (CIFilter filter, PHContentEditingInput input, PHContentEditingOutput output, Action completion)
{
// Load AVAsset to process from input.
var avAsset = input.AudiovisualAsset;
if (avAsset == null)
throw new InvalidProgramException ("can't get AV asset to edit");
// Set up a video composition to apply the filter.
var composition = AVVideoComposition.CreateVideoComposition (avAsset, request => {
filter.Image = request.SourceImage;
var filtered = filter.OutputImage;
request.Finish (filtered, null);
});
// Export the video composition to the output URL.
// TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=44443
var export = new AVAssetExportSession (avAsset, AVAssetExportSession.PresetHighestQuality) {
OutputFileType = AVFileType.QuickTimeMovie,
OutputUrl = output.RenderedContentUrl,
VideoComposition = composition
};
export.ExportAsynchronously (completion);
}
#if __IOS__ && !__TVOS__
[Export ("livePhotoView:didEndPlaybackWithStyle:")]
public virtual void DidEndPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
{
playingHint = (playbackStyle == PHLivePhotoViewPlaybackStyle.Hint);
}
[Export ("livePhotoView:willBeginPlaybackWithStyle:")]
public virtual void WillBeginPlayback (PHLivePhotoView livePhotoView, PHLivePhotoViewPlaybackStyle playbackStyle)
{
playingHint = (playbackStyle == PHLivePhotoViewPlaybackStyle.Hint);
}
#endif
}
public static class Bindings
{
[DllImport ("/usr/lib/libobjc.dylib", EntryPoint = "objc_msgSend")]
public static extern IntPtr IntPtr_objc_msgSend (IntPtr receiver, IntPtr selector);
//TODO: https://bugzilla.xamarin.com/show_bug.cgi?id=44438
public static CGColorSpace ColorSpace (this CIImage img)
{
var colorSpacePtr = IntPtr_objc_msgSend (img.Handle, new Selector ("colorSpace").Handle);
return new CGColorSpace (colorSpacePtr);
}
}
}

Просмотреть файл

@ -1,92 +0,0 @@
using System.CodeDom.Compiler;
using UIKit;
using Foundation;
#if __IOS__
using PhotosUI;
#endif
namespace SamplePhotoApp
{
[Register ("AssetViewController")]
partial class AssetViewController
{
[Outlet ("imageView")]
UIImageView ImageView { get; set; }
#if __IOS__
[Outlet ("livePhotoView")]
PHLivePhotoView LivePhotoView { get; set; }
#endif
[Outlet ("editButton")]
UIBarButtonItem EditButton { get; set; }
[Outlet ("progressView")]
UIProgressView ProgressView { get; set; }
[Outlet ("playButton")]
UIBarButtonItem PlayButton { get; set; }
[Outlet ("space")]
UIBarButtonItem Space { get; set; }
[Outlet ("trashButton")]
UIBarButtonItem TrashButton { get; set; }
[Outlet ("favoriteButton")]
UIBarButtonItem FavoriteButton { get; set; }
[Action ("editAsset:")]
partial void EditAsset (UIBarButtonItem sender);
[Action ("removeAsset:")]
partial void RemoveAsset (NSObject sender);
[Action ("play:")]
partial void Play (NSObject sender);
[Action ("toggleFavorite:")]
partial void ToggleFavorite (UIBarButtonItem sender);
void ReleaseDesignerOutlets ()
{
#if __IOS__
if (LivePhotoView != null) {
LivePhotoView.Dispose ();
LivePhotoView = null;
}
#endif
if (ImageView != null) {
ImageView.Dispose ();
ImageView = null;
}
if (Space != null) {
Space.Dispose ();
Space = null;
}
if (TrashButton != null) {
TrashButton.Dispose ();
TrashButton = null;
}
if (PlayButton != null) {
PlayButton.Dispose ();
PlayButton = null;
}
if (EditButton != null) {
EditButton.Dispose ();
EditButton = null;
}
if (ProgressView != null) {
ProgressView.Dispose ();
ProgressView = null;
}
}
}
}

Просмотреть файл

@ -1,52 +0,0 @@
using System;
using Foundation;
using UIKit;
namespace SamplePhotoApp
{
public partial class GridViewCell : UICollectionViewCell
{
UIImage thumbnailImage;
public UIImage ThumbnailImage {
get {
return thumbnailImage;
}
set {
thumbnailImage = value;
ImageView.Image = thumbnailImage;
}
}
UIImage livePhotoBadgeImage;
public UIImage LivePhotoBadgeImage {
get {
return livePhotoBadgeImage;
}
set {
livePhotoBadgeImage = value;
LivePhotoBadgeImageView.Image = livePhotoBadgeImage;
}
}
public string RepresentedAssetIdentifier { get; set; }
[Export ("initWithCoder:")]
public GridViewCell (NSCoder coder)
: base (coder)
{
}
public GridViewCell (IntPtr handle)
: base (handle)
{
}
public override void PrepareForReuse ()
{
base.PrepareForReuse ();
ImageView.Image = null;
LivePhotoBadgeImageView.Image = null;
}
}
}

29
ios10/SamplePhotoApp/Shared/GridViewCell.designer.cs сгенерированный
Просмотреть файл

@ -1,29 +0,0 @@
using Foundation;
using UIKit;
namespace SamplePhotoApp
{
[Register ("GridViewCell")]
partial class GridViewCell
{
[Outlet]
UIImageView ImageView { get; set; }
[Outlet]
UIImageView LivePhotoBadgeImageView { get; set; }
void ReleaseDesignerOutlets ()
{
if (ImageView != null) {
ImageView.Dispose ();
ImageView = null;
}
if (LivePhotoBadgeImageView != null) {
LivePhotoBadgeImageView.Dispose ();
LivePhotoBadgeImageView = null;
}
}
}
}

Просмотреть файл

@ -1,228 +0,0 @@
using System;
using UIKit;
using Photos;
using Foundation;
using CoreFoundation;
namespace SamplePhotoApp
{
public enum Section
{
AllPhotos,
SmartAlbums,
UserCollections
}
[Register ("MasterViewController")]
public class MasterViewController : UITableViewController, IPHPhotoLibraryChangeObserver
{
const string allPhotosIdentifier = "allPhotos";
const string collectionIdentifier = "collection";
const string showAllPhotos = "showAllPhotos";
const string showCollection = "showCollection";
// MARK: Properties
PHFetchResult allPhotos;
PHFetchResult smartAlbums;
PHFetchResult userCollections;
readonly string [] sectionLocalizedTitles = { "", "Smart Albums", "Albums" };
public MasterViewController (IntPtr handle)
: base (handle)
{
}
[Export ("initWithCoder:")]
public MasterViewController (NSCoder coder)
: base (coder)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Add, AddAlbum);
// Create a PHFetchResult object for each section in the table view.
var allPhotosOptions = new PHFetchOptions {
SortDescriptors = new NSSortDescriptor [] { new NSSortDescriptor("creationDate", true) },
};
allPhotos = PHAsset.FetchAssets (allPhotosOptions);
smartAlbums = PHAssetCollection.FetchAssetCollections (PHAssetCollectionType.SmartAlbum, PHAssetCollectionSubtype.AlbumRegular, null);
userCollections = PHCollection.FetchTopLevelUserCollections (null);
PHPhotoLibrary.SharedPhotoLibrary.RegisterChangeObserver(this);
}
protected override void Dispose (bool disposing)
{
PHPhotoLibrary.SharedPhotoLibrary.UnregisterChangeObserver (this);
base.Dispose (disposing);
}
public override void ViewWillAppear (bool animated)
{
ClearsSelectionOnViewWillAppear = SplitViewController.Collapsed;
base.ViewWillAppear (animated);
}
void AddAlbum (object sender, EventArgs args)
{
var alertController = UIAlertController.Create ("New Album", null, UIAlertControllerStyle.Alert);
alertController.AddTextField (textField => {
textField.Placeholder = "Album Name";
});
alertController.AddAction (UIAlertAction.Create ("Create", UIAlertActionStyle.Default, action => {
var textField = alertController.TextFields [0];
var title = textField.Text;
if (!string.IsNullOrEmpty (title)) {
// Create a new album with the title entered.
PHPhotoLibrary.SharedPhotoLibrary.PerformChanges (() => {
PHAssetCollectionChangeRequest.CreateAssetCollection (title);
}, (success, error) => {
if (!success)
Console.WriteLine ($"error creating album: {error}");
});
}
}));
PresentViewController (alertController, true, null);
}
#region Segues
public override void PrepareForSegue (UIStoryboardSegue segue, NSObject sender)
{
var destination = (segue.DestinationViewController as UINavigationController)?.TopViewController as AssetGridViewController;
if (destination == null)
throw new InvalidProgramException ("unexpected view controller for segue");
var cell = (UITableViewCell)sender;
destination.Title = cell.TextLabel.Text;
switch (segue.Identifier) {
case showAllPhotos:
destination.FetchResult = allPhotos;
break;
case showCollection:
// get the asset collection for the selected row
var indexPath = TableView.IndexPathForCell (cell);
NSObject collection = null;
switch ((Section)indexPath.Section) {
case Section.SmartAlbums:
collection = smartAlbums.ObjectAt (indexPath.Row);
break;
case Section.UserCollections:
collection = userCollections.ObjectAt (indexPath.Row);
break;
}
// configure the view controller with the asset collection
var assetCollection = collection as PHAssetCollection;
if (assetCollection == null)
throw new InvalidProgramException ("expected asset collection");
destination.FetchResult = PHAsset.FetchAssets (assetCollection, null);
destination.AssetCollection = assetCollection;
break;
}
}
#endregion
#region Table View
public override nint NumberOfSections (UITableView tableView)
{
return Enum.GetValues (typeof (Section)).Length;
}
public override nint RowsInSection (UITableView tableView, nint section)
{
switch ((Section)(int)section) {
case Section.AllPhotos:
return 1;
case Section.SmartAlbums:
return smartAlbums.Count;
case Section.UserCollections:
return userCollections.Count;
}
throw new InvalidProgramException ();
}
public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
{
switch ((Section)indexPath.Section) {
case Section.AllPhotos: {
var cell = tableView.DequeueReusableCell (allPhotosIdentifier, indexPath);
cell.TextLabel.Text = "All Photos";
return cell;
}
case Section.SmartAlbums: {
var cell = tableView.DequeueReusableCell (collectionIdentifier, indexPath);
var collection = (PHCollection)smartAlbums.ObjectAt (indexPath.Row);
cell.TextLabel.Text = collection.LocalizedTitle;
return cell;
}
case Section.UserCollections: {
var cell = tableView.DequeueReusableCell (collectionIdentifier, indexPath);
var collection = (PHCollection)userCollections.ObjectAt (indexPath.Row);
cell.TextLabel.Text = collection.LocalizedTitle;
return cell;
}
}
throw new InvalidProgramException ();
}
public override string TitleForHeader (UITableView tableView, nint section)
{
return sectionLocalizedTitles [(int)section];
}
#endregion
#region IPHPhotoLibraryChangeObserver
public void PhotoLibraryDidChange (PHChange changeInstance)
{
// Change notifications may be made on a background queue. Re-dispatch to the
// main queue before acting on the change as we'll be updating the UI.
DispatchQueue.MainQueue.DispatchSync (() => {
// Check each of the three top-level fetches for changes.
// Update the cached fetch result.
var changeDetails = changeInstance.GetFetchResultChangeDetails (allPhotos);
if (changeDetails != null) {
allPhotos = changeDetails.FetchResultAfterChanges;
// (The table row for this one doesn't need updating, it always says "All Photos".)
}
// Update the cached fetch results, and reload the table sections to match.
changeDetails = changeInstance.GetFetchResultChangeDetails (smartAlbums);
if (changeDetails != null) {
smartAlbums = changeDetails.FetchResultAfterChanges;
TableView.ReloadSections (NSIndexSet.FromIndex ((int)Section.SmartAlbums), UITableViewRowAnimation.Automatic);
}
changeDetails = changeInstance.GetFetchResultChangeDetails (userCollections);
if (changeDetails != null) {
userCollections = changeDetails.FetchResultAfterChanges;
TableView.ReloadSections (NSIndexSet.FromIndex ((int)Section.UserCollections), UITableViewRowAnimation.Automatic);
}
});
}
#endregion
}
}

Просмотреть файл

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<HasSharedItems>true</HasSharedItems>
<SharedGUID>{FDCB59CD-E624-46E6-87D3-3A4B6D066F6A}</SharedGUID>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<Import_RootNamespace>Shared</Import_RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)AppDelegate.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AssetGridViewController.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AssetGridViewController.designer.cs">
<DependentUpon>AssetGridViewController.cs</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)GridViewCell.cs" />
<Compile Include="$(MSBuildThisFileDirectory)GridViewCell.designer.cs">
<DependentUpon>GridViewCell.cs</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)AssetViewController.cs" />
<Compile Include="$(MSBuildThisFileDirectory)AssetViewController.designer.cs">
<DependentUpon>AssetViewController.cs</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)MasterViewController.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UICollectionViewExtensions.cs" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ProjectGuid>{FDCB59CD-E624-46E6-87D3-3A4B6D066F6A}</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
<Import Project="Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
</Project>

Просмотреть файл

@ -1,20 +0,0 @@
using System.Linq;
using System.Collections.Generic;
using UIKit;
using Foundation;
using CoreGraphics;
namespace SamplePhotoApp
{
public static class UICollectionViewExtensions
{
public static IEnumerable<NSIndexPath> GetIndexPaths (this UICollectionView collectionView, CGRect rect)
{
return collectionView.CollectionViewLayout
.LayoutAttributesForElementsInRect (rect)
.Select (attr => attr.IndexPath);
}
}
}