Skip to content

Commit

Permalink
AFNetworking 2 —> 3
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyLB committed May 28, 2017
1 parent 7d64708 commit 8538d43
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
36 changes: 18 additions & 18 deletions piwigo/EditImageDetails.storyboard
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F67a" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina3_5" orientation="portrait">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F71b" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="ipad9_7" orientation="landscape">
<adaptation id="fullscreen"/>
</device>
<dependencies>
Expand All @@ -19,22 +19,22 @@
<viewControllerLayoutGuide type="bottom" id="uVf-G5-mw5"/>
</layoutGuides>
<view key="view" clipsSubviews="YES" contentMode="scaleToFill" id="wiZ-et-8Je">
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="768"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="grouped" separatorStyle="default" rowHeight="44" sectionHeaderHeight="1" sectionFooterHeight="1" translatesAutoresizingMaskIntoConstraints="NO" id="T0l-Ou-dhs">
<rect key="frame" x="0.0" y="20" width="320" height="460"/>
<rect key="frame" x="0.0" y="20" width="1024" height="748"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
<prototypes>
<tableViewCell contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" reuseIdentifier="textField" id="GhX-cy-KIv" customClass="EditImageTextFieldTableViewCell">
<rect key="frame" x="0.0" y="55.5" width="320" height="44"/>
<rect key="frame" x="0.0" y="55.5" width="1024" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="GhX-cy-KIv" id="hOn-QS-kFy">
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Afl-1t-r1a">
<rect key="frame" x="96" y="7" width="216" height="30"/>
<rect key="frame" x="96" y="7" width="920" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits"/>
</textField>
Expand Down Expand Up @@ -62,21 +62,21 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="label" rowHeight="68" id="Nua-fo-VbO" customClass="EditImageLabelTableViewCell">
<rect key="frame" x="0.0" y="99.5" width="320" height="68"/>
<rect key="frame" x="0.0" y="99.5" width="1024" height="68"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Nua-fo-VbO" id="i7D-VI-1cA">
<rect key="frame" x="0.0" y="0.0" width="287" height="67.5"/>
<rect key="frame" x="0.0" y="0.0" width="830" height="67.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="top" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Who can see this photo?" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="tP3-bz-PWE">
<rect key="frame" x="8" y="8" width="279" height="21"/>
<rect key="frame" x="8" y="8" width="983" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
<size key="shadowOffset" width="0.0" height="0.0"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Selected Privacy Level" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="6MZ-9m-u1O">
<rect key="frame" x="12" y="37" width="275" height="21"/>
<rect key="frame" x="12" y="37" width="979" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
Expand All @@ -96,20 +96,20 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="tags" rowHeight="68" id="daW-18-zRl" customClass="TagsTableViewCell">
<rect key="frame" x="0.0" y="167.5" width="320" height="68"/>
<rect key="frame" x="0.0" y="167.5" width="1024" height="68"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="daW-18-zRl" id="v9N-hs-qE9">
<rect key="frame" x="0.0" y="0.0" width="287" height="67.5"/>
<rect key="frame" x="0.0" y="0.0" width="830" height="67.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tags:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="Isv-kh-FD3">
<rect key="frame" x="8" y="8" width="279" height="21"/>
<rect key="frame" x="8" y="8" width="983" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Selected Tags" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="14" translatesAutoresizingMaskIntoConstraints="NO" id="AAB-5e-YaO">
<rect key="frame" x="12" y="37" width="275" height="21"/>
<rect key="frame" x="12" y="37" width="979" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
Expand All @@ -130,14 +130,14 @@
</connections>
</tableViewCell>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="textArea" rowHeight="100" id="Bpu-ru-Cr7" customClass="EditImageTextViewTableViewCell">
<rect key="frame" x="0.0" y="235.5" width="320" height="100"/>
<rect key="frame" x="0.0" y="235.5" width="1024" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Bpu-ru-Cr7" id="IBt-8g-0eO">
<rect key="frame" x="0.0" y="0.0" width="320" height="99.5"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="99.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zMu-VQ-mu0" customClass="UIPlaceHolderTextView">
<rect key="frame" x="8" y="8" width="304" height="83"/>
<rect key="frame" x="8" y="8" width="1008" height="83"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences" autocorrectionType="yes" spellCheckingType="yes"/>
Expand Down
10 changes: 5 additions & 5 deletions piwigo/EditImageDetailsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ -(void)setIsEdit:(BOOL)isEdit
{
_isEdit = isEdit;
[ImageService getImageInfoById:self.imageDetails.imageId
ListOnCompletion:^(AFHTTPRequestOperation *operation, PiwigoImageData *imageData) {
ListOnCompletion:^(NSURLSessionTask *task, PiwigoImageData *imageData) {
self.imageDetails = [[ImageUpload alloc] initWithImageData:imageData];
[self.editImageDetailsTableView reloadData];
} onFailure:^(AFHTTPRequestOperation *operation, NSError *error) {
} onFailure:^(NSURLSessionTask *task, NSError *error) {
[UIAlertView showWithTitle:NSLocalizedString(@"imageDetailsFetchError_title", @"Image Details Fetch Failed")
message:NSLocalizedString(@"imageDetailsFetchError_retryMessage", @"Fetching the image data failed\nTry again?")
cancelButtonTitle:NSLocalizedString(@"alertNoButton", @"No")
Expand Down Expand Up @@ -125,13 +125,13 @@ -(void)doneEdit
[loading showLoadingWithLabel:@"Setting Image Information" andProgressLabel:nil];

[UploadService updateImageInfo:self.imageDetails
onProgress:^(NSUInteger bytesRead, long long totalBytesRead, long long totalBytesExpectedToRead) {
onProgress:^(NSProgress *progress) {
// progress
} OnCompletion:^(AFHTTPRequestOperation *operation, NSDictionary *response) {
} OnCompletion:^(NSURLSessionTask *task, NSDictionary *response) {
// complete
[loading hideLoadingWithLabel:@"Saved" showCheckMark:YES withDelay:0.3];
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
} onFailure:^(AFHTTPRequestOperation *operation, NSError *error) {
} onFailure:^(NSURLSessionTask *task, NSError *error) {
[loading hideLoadingWithLabel:@"Failed" showCheckMark:NO withDelay:0.0];
[UIAlertView showWithTitle:@"Failed to Update"
message:@"Failed to update your changes with your server\nTry again?"
Expand Down

0 comments on commit 8538d43

Please sign in to comment.