Skip to content

Commit

Permalink
Merge pull request #151 from nohana/release/0.9.13
Browse files Browse the repository at this point in the history
0.9.13
  • Loading branch information
tyokujin authored Aug 23, 2022
2 parents 2aa47db + b3e0281 commit cfc0c64
Show file tree
Hide file tree
Showing 13 changed files with 486 additions and 23 deletions.
26 changes: 25 additions & 1 deletion Demo/DemoListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import UIKit
import NohanaImagePicker
import Photos
import PhotosUI

struct Cell {
let title: String
Expand Down Expand Up @@ -72,7 +73,13 @@ class DemoListViewController: UITableViewController, NohanaImagePickerController
// MARK: - Photos

func checkIfAuthorizedToAccessPhotos(_ handler: @escaping (_ isAuthorized: Bool) -> Void) {
switch PHPhotoLibrary.authorizationStatus() {
let status: PHAuthorizationStatus
if #available(iOS 14, *) {
status = PHPhotoLibrary.authorizationStatus(for: .readWrite)
} else {
status = PHPhotoLibrary.authorizationStatus()
}
switch status {
case .notDetermined:
PHPhotoLibrary.requestAuthorization { status in
DispatchQueue.main.async {
Expand Down Expand Up @@ -238,4 +245,21 @@ class DemoListViewController: UITableViewController, NohanaImagePickerController
func nohanaImagePicker(_ picker: NohanaImagePickerController, assetDetailListViewController: UICollectionViewController, didChangeAssetDetailPage indexPath: IndexPath, photoKitAsset: PHAsset) {
print("🐷\(#function)\n\tindexPath = \(indexPath)")
}

func nohanaImagePickerDidTapAddPhotoButton(_ picker: NohanaImagePickerController) {
print("🐷\(#function)")
if #available(iOS 14, *) {
PHPhotoLibrary.shared().presentLimitedLibraryPicker(from: picker)
}
}

func nohanaImagePickerDidTapAuthorizeAllPhotoButton(_ picker: NohanaImagePickerController) {
print("🐷\(#function)")
guard let url = URL(string: UIApplication.openSettingsURLString),
UIApplication.shared.canOpenURL(url) else {
assertionFailure("Not able to open App privacy settings")
return
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
}
2 changes: 2 additions & 0 deletions Demo/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
</array>
<key>NSPhotoLibraryUsageDescription</key>
<string>To pick some photos.</string>
<key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
<true/>
</dict>
</plist>
8 changes: 8 additions & 0 deletions NohanaImagePicker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
6AD1607C27700F0C00A8B066 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD1607B27700F0C00A8B066 /* RootViewController.swift */; };
6AD1607F2770B23D00A8B066 /* UIApplication+Ex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD1607E2770B23D00A8B066 /* UIApplication+Ex.swift */; };
F117F732273B6A2600E11BC7 /* AssetDateSectionCreater.swift in Sources */ = {isa = PBXBuildFile; fileRef = F117F731273B6A2600E11BC7 /* AssetDateSectionCreater.swift */; };
F145C5E22890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F145C5E02890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.swift */; };
F145C5E32890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F145C5E12890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.xib */; };
F181095026A5361A001C2BDE /* MomentDetailListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F181094F26A5361A001C2BDE /* MomentDetailListViewController.swift */; };
F1A26CCD2738DE6A00433E9F /* AssetListSelectableDateSection.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F1A26CCC2738DE6A00433E9F /* AssetListSelectableDateSection.storyboard */; };
F1A26CCF2738E7E400433E9F /* AssetListSelectableDateSectionController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A26CCE2738E7E400433E9F /* AssetListSelectableDateSectionController.swift */; };
Expand Down Expand Up @@ -99,6 +101,8 @@
6AD1607B27700F0C00A8B066 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
6AD1607E2770B23D00A8B066 /* UIApplication+Ex.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Ex.swift"; sourceTree = "<group>"; };
F117F731273B6A2600E11BC7 /* AssetDateSectionCreater.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetDateSectionCreater.swift; sourceTree = "<group>"; };
F145C5E02890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoAuthorizationLimitedCell.swift; sourceTree = "<group>"; };
F145C5E12890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = PhotoAuthorizationLimitedCell.xib; sourceTree = "<group>"; };
F181094F26A5361A001C2BDE /* MomentDetailListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MomentDetailListViewController.swift; sourceTree = "<group>"; };
F1A26CCC2738DE6A00433E9F /* AssetListSelectableDateSection.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AssetListSelectableDateSection.storyboard; sourceTree = "<group>"; };
F1A26CCE2738E7E400433E9F /* AssetListSelectableDateSectionController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetListSelectableDateSectionController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -233,6 +237,8 @@
F1A26CCC2738DE6A00433E9F /* AssetListSelectableDateSection.storyboard */,
F27029CD1C71C43A001647AB /* NohanaImagePicker.strings */,
F237249A1C6DCF96005D1E8A /* NohanaImagePicker.xcassets */,
F145C5E02890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.swift */,
F145C5E12890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.xib */,
);
name = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -439,6 +445,7 @@
F237249B1C6DCF96005D1E8A /* NohanaImagePicker.xcassets in Resources */,
6A8047FF276C3D77000F3B28 /* AlbumList.storyboard in Resources */,
F1A26CCD2738DE6A00433E9F /* AssetListSelectableDateSection.storyboard in Resources */,
F145C5E32890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -479,6 +486,7 @@
F2131F431C79615700797887 /* SwipeInteractionController.swift in Sources */,
F2DF3B2D1C6D780100C1C0E4 /* AssetDetailCell.swift in Sources */,
F25C69901CA27311005935D6 /* EmptyIndicatable.swift in Sources */,
F145C5E22890F8DC0070A4E2 /* PhotoAuthorizationLimitedCell.swift in Sources */,
F117F732273B6A2600E11BC7 /* AssetDateSectionCreater.swift in Sources */,
F2DA29771C7749D600B0A8E3 /* NotificationInfo.swift in Sources */,
F1A26CCF2738E7E400433E9F /* AssetListSelectableDateSectionController.swift in Sources */,
Expand Down
13 changes: 7 additions & 6 deletions NohanaImagePicker/AssetListSelectableDateSection.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19455" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Y8D-wX-eXv">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Y8D-wX-eXv">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19454"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -73,8 +73,8 @@
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Date" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zez-RG-eKO">
<rect key="frame" x="12" y="13.666666666666664" width="255" height="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zez-RG-eKO">
<rect key="frame" x="12" y="0.0" width="255" height="44"/>
<constraints>
<constraint firstAttribute="height" relation="greaterThanOrEqual" constant="21" id="aZE-cw-Q5P"/>
</constraints>
Expand All @@ -99,13 +99,14 @@
</button>
</subviews>
<constraints>
<constraint firstItem="zez-RG-eKO" firstAttribute="centerY" secondItem="XXe-ul-EPT" secondAttribute="centerY" id="LuP-NY-gzM"/>
<constraint firstItem="zez-RG-eKO" firstAttribute="leading" secondItem="XXe-ul-EPT" secondAttribute="leadingMargin" id="N3P-bG-NqX"/>
<constraint firstItem="3Za-Il-RY8" firstAttribute="leading" secondItem="zez-RG-eKO" secondAttribute="trailing" constant="8" id="PAM-Fp-Mvv"/>
<constraint firstAttribute="trailing" secondItem="3Za-Il-RY8" secondAttribute="trailing" constant="17" id="Qeo-BS-VpK"/>
<constraint firstItem="3Za-Il-RY8" firstAttribute="centerY" secondItem="XXe-ul-EPT" secondAttribute="centerY" id="W69-Gg-fMe"/>
<constraint firstItem="zez-RG-eKO" firstAttribute="centerY" secondItem="XXe-ul-EPT" secondAttribute="centerY" id="eKF-zk-Lja"/>
<constraint firstAttribute="bottom" secondItem="zez-RG-eKO" secondAttribute="bottom" id="jsw-Ve-KxN"/>
<constraint firstItem="zez-RG-eKO" firstAttribute="leading" secondItem="XXe-ul-EPT" secondAttribute="leadingMargin" constant="4" id="r97-8Y-s4a"/>
<constraint firstItem="zez-RG-eKO" firstAttribute="top" secondItem="XXe-ul-EPT" secondAttribute="top" id="sa7-LF-zzM"/>
</constraints>
<variation key="default">
<mask key="constraints">
Expand Down Expand Up @@ -135,7 +136,7 @@
</collectionViewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="gV9-4e-BRv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="142" y="738"/>
<point key="canvasLocation" x="140.57971014492756" y="737.94642857142856"/>
</scene>
<!--Asset Detail List View Controller-->
<scene sceneID="Bzc-Dg-VdR">
Expand Down
Loading

0 comments on commit cfc0c64

Please sign in to comment.