Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post list revamp #12087

Merged
merged 184 commits into from
Jul 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
6b7b63b
Remove unused cell references from InteractivePostViewDelegate
leandroalonso May 7, 2019
a0fd91c
Creates a PostActionSheet to show post options
leandroalonso May 7, 2019
4733272
Adds test to ensure drafted post options
leandroalonso May 7, 2019
44c4c42
Do not show Stats option for scheduled posts
leandroalonso May 8, 2019
ccdca84
Show "Delete permanently" for trashed posts
leandroalonso May 8, 2019
63e8dad
Internationalize strings
leandroalonso May 8, 2019
24d39f8
When "Stats" is tapped, call the delegate to show the stats
leandroalonso May 8, 2019
942b29e
When "Move to Draft" is tapped, call the delegate
leandroalonso May 8, 2019
d20572f
When "Delete Permanently" is tapped, call the delegate
leandroalonso May 8, 2019
f305ca9
When "Move to Trash" is tapped, call the delegate
leandroalonso May 8, 2019
edc4f01
Adds an property to give "More" button a action callback
leandroalonso May 8, 2019
1a5973d
Adds a post action sheet delegate setter in PostCardCell
leandroalonso May 8, 2019
8fa86c8
Show an action sheet when "More" is tapped in PostCard
leandroalonso May 8, 2019
f22b27f
Moves setActionSheetDelegate to PostCardTableViewCell header
leandroalonso May 8, 2019
0ff691f
Show "More" button if an action callback is set
leandroalonso May 8, 2019
4e03181
Do not show "Move to Draft" for a drafted post
leandroalonso May 8, 2019
6146ea0
Calls the delegate passing a reference to the button
leandroalonso May 9, 2019
810a6ec
Refactor PostActionSheet to simplify code
leandroalonso May 9, 2019
8dbcff4
Removes trailing semicolons
leandroalonso May 9, 2019
aca5f05
Remove tests that breaks in non-iPad simulator/device
leandroalonso May 9, 2019
81391aa
Rename OptionTitle to Titles
leandroalonso May 9, 2019
78b8d61
Move PostActionSheetDelegate to Swift
leandroalonso May 9, 2019
807f6d0
Rename draftPost to moveToDraft
leandroalonso May 9, 2019
78fe91e
Moves InteractivePostViewDelegate to Swift side of the force
leandroalonso May 10, 2019
6d417df
Removes trailing whitespace
leandroalonso May 10, 2019
4d6ada6
Move tap in UIAlertController to PostActionSheetTests
leandroalonso May 10, 2019
9fe8ef3
Creates a PostCell with the new layout arrangement
leandroalonso May 13, 2019
bf3085f
Shows featuredImage if available, otherwise hide the image placeholder
leandroalonso May 13, 2019
d5e4ec5
Apply post card styles and set up the borders
leandroalonso May 13, 2019
1ec3679
Configure post cell title
leandroalonso May 13, 2019
12297d9
Change top space accordingly with image availability
leandroalonso May 13, 2019
9c77a68
Show post's snippet
leandroalonso May 13, 2019
9f3983d
Display post date
leandroalonso May 13, 2019
e7fe116
Show post's author
leandroalonso May 14, 2019
d16617b
Show if post is sticky
leandroalonso May 14, 2019
36ead2e
Show if post is private
leandroalonso May 14, 2019
20d1556
Configure post status and separator if needed
leandroalonso May 14, 2019
223251e
Show status view with correct colors and proper separator logic
leandroalonso May 14, 2019
01778d9
Show progress bar
leandroalonso May 14, 2019
a11899c
Apply styles to status view labels
leandroalonso May 14, 2019
55259a1
Adds view and edit actions
leandroalonso May 14, 2019
7e3a899
Display action sheet when more is tapped
leandroalonso May 14, 2019
2e09433
Add retry action when post is failed
leandroalonso May 14, 2019
c332fa2
When using a filter to show only mine posts, hide author
leandroalonso May 14, 2019
1594e01
Do not display "last-modified" for post dates
leandroalonso May 14, 2019
d0ecfda
Change restore post design to match the new post cell
leandroalonso May 14, 2019
5e35db7
Adds button localization and do not show cell selection on margin
leandroalonso May 14, 2019
0ebb480
Do not accept taps on the margin
leandroalonso May 14, 2019
617dcb1
Apply styles when trait collection did change
leandroalonso May 14, 2019
c23e2d6
Adds placeholder constraint to avoid warnings
leandroalonso May 14, 2019
f92d1e7
Remove old PostCardTableViewCell references
leandroalonso May 14, 2019
54c09db
Small refactor to improve code readability
leandroalonso May 14, 2019
6d276c6
Fix a bug that was displaying top spacing when switching post types
leandroalonso May 15, 2019
554f073
Increase footer height
leandroalonso May 15, 2019
70c7fee
Change "Privately published" to "Private"
leandroalonso May 15, 2019
5a4e394
Do not show scheduled and trashed labels
leandroalonso May 15, 2019
5f05224
Do not show post snippet placeholder when snippet is empty
leandroalonso May 15, 2019
02650aa
Do not show sticky label alongside with uploading or failed status
leandroalonso May 15, 2019
a8651e3
Fix lint warnings
leandroalonso May 15, 2019
6daa9f5
Post title and snippet should have 24pt as line height
leandroalonso May 17, 2019
3e8eb1d
Fix some text margins
leandroalonso May 17, 2019
8c5d9e7
Only applies action bar style once
leandroalonso May 17, 2019
63fc543
Fixes on content margin
leandroalonso May 17, 2019
d3550b0
Increase image size on iPads
leandroalonso May 17, 2019
bf2e6fd
Adds UIView extension to change layout margin more easily
leandroalonso May 17, 2019
7cf9775
Margin and styles improvements
leandroalonso May 17, 2019
8e8e632
Call super traitCollectionDidChange to avoid issues
leandroalonso May 17, 2019
21893b2
Fix action bar height
leandroalonso May 20, 2019
e674660
Few renames for better readability
leandroalonso May 20, 2019
caf9c7f
Refactor to simplify some constants
leandroalonso May 20, 2019
0d89ae5
Adds a horizontal stack view for the upcoming compact mode
leandroalonso May 20, 2019
170bc37
Revert "Adds a horizontal stack view for the upcoming compact mode"
leandroalonso May 21, 2019
485542c
Moves some logics to the view model
leandroalonso May 21, 2019
7c7f53e
Adds back the last modified date for drafts and pending
leandroalonso May 23, 2019
a536362
Extract the separator into a constants enum
leandroalonso May 23, 2019
896011f
Move trash and scheduled changes to statusForDisplay
leandroalonso May 23, 2019
7394c00
Changes view model for better understanding
leandroalonso May 23, 2019
53ebde3
Ensure that borders has 1px of devices display resolution
leandroalonso May 23, 2019
892c020
Add a comment in hit test
leandroalonso May 23, 2019
b6305c6
Extract constants
leandroalonso May 23, 2019
81903cf
Fix issues with right-to-left direction and with images
leandroalonso May 23, 2019
60afe28
Rename setLayoutMargin to changeLayoutMargins
leandroalonso May 23, 2019
4410867
Remove unused xib
leandroalonso May 23, 2019
96c2c46
Fix typo
leandroalonso May 23, 2019
89c1157
Moves changeLayoutMargins to WordPressUI
leandroalonso May 24, 2019
249858c
Remove the space from the view model and added in the view itself
leandroalonso May 28, 2019
da7287d
Makes post and view model optional
leandroalonso May 28, 2019
5c117dc
Removes trailing whitespace
leandroalonso May 28, 2019
e1d57ab
Rename isAllPostsMine
leandroalonso May 28, 2019
bdac32d
Merge pull request #11705 from leandroalonso/update_post_card_design
nheagy May 28, 2019
0a32606
Remove old PostCardTableViewCell references
leandroalonso May 14, 2019
b5bcf24
Adds UIView extension to change layout margin more easily
leandroalonso May 17, 2019
1df61e0
Add a calback for when content sync starts
leandroalonso May 16, 2019
3014971
Add ghostOptions
leandroalonso May 16, 2019
5eddc5a
Configure ghost for post list
leandroalonso May 17, 2019
1389ff4
Configure post cell before ghost animation
leandroalonso May 17, 2019
544e1e5
Configure the post cell before showing it as a ghost
leandroalonso May 19, 2019
3e0b43f
Changes PostCell extension to conform to GhostableView
leandroalonso May 19, 2019
d1801e7
Fix snippet height when in ghost mode for iPads
leandroalonso May 19, 2019
b556bac
Fix a bug where ghosts cell were not disapearing without connectivity
leandroalonso May 19, 2019
04d86fb
Configure the post cell before showing it as a ghost
leandroalonso May 21, 2019
91d9b7e
Fixes merge issues
leandroalonso May 21, 2019
b87a542
Fix unit tests
leandroalonso May 22, 2019
b1e7084
Change ghost placeholder heights
leandroalonso May 23, 2019
6f3c2f9
Fix rebase issues
leandroalonso May 24, 2019
5e8e432
Rename configureItself to resetGhost
leandroalonso May 24, 2019
c3be3ad
Simplifies how ghost cell is shown
leandroalonso May 25, 2019
1526a91
Remove unused file
leandroalonso May 28, 2019
43bda5f
Merge pull request #11789 from leandroalonso/issue/11646_post_list_gh…
nheagy May 31, 2019
da83823
Configure post cell before ghost animation
leandroalonso May 17, 2019
4dfca05
Configure the post cell before showing it as a ghost
leandroalonso May 21, 2019
da8ff82
Fix rebase issues
leandroalonso May 24, 2019
2985a90
Points WordPressUI to a branch containing Ghost with flexible options
leandroalonso May 16, 2019
629c52e
Configure ghost for post list
leandroalonso May 17, 2019
776dee7
Configure the post cell before showing it as a ghost
leandroalonso May 21, 2019
97c5e03
Adds the new post compact cell and the logic for the alternancy
leandroalonso May 21, 2019
e64438c
Display compact cell with separator and correct height
leandroalonso May 21, 2019
6ed628f
Adds progress view
leandroalonso May 21, 2019
7467661
Show image when post has featured image
leandroalonso May 21, 2019
0335c0e
Show post title
leandroalonso May 21, 2019
b3d92e8
Show post timestamp
leandroalonso May 21, 2019
2c3007e
Holds a strong reference to the constraint
leandroalonso May 21, 2019
b62c40b
Configure more action for compact cell
leandroalonso May 21, 2019
e38111a
Show post status and badges
leandroalonso May 22, 2019
2552922
Show progress, status and badges in compact cells
leandroalonso May 22, 2019
a9966c4
Extract layout constants
leandroalonso May 22, 2019
60cf1fa
Fix some rebase issues
leandroalonso May 23, 2019
19a4564
Configure compact cells before showing them as ghost
leandroalonso May 23, 2019
77126a0
Show navigation icon to toggle between compact and comfortably mode
leandroalonso May 23, 2019
46919f6
Fix rebase issues
leandroalonso May 24, 2019
f777efd
Adds an option to always show the "View" post option
leandroalonso May 24, 2019
662cdff
Shows "View" option if in compact mode
leandroalonso May 24, 2019
e4369aa
Simplifies code and fix unit test
leandroalonso May 24, 2019
155af4d
Move RestorePostTableViewCell to Swift
leandroalonso May 24, 2019
78bed90
Change margin and borders when in compact mode
leandroalonso May 24, 2019
161e874
Render restore cell in compact or default mode
leandroalonso May 24, 2019
7f70960
Move refresh logic to its own method
leandroalonso May 24, 2019
c587534
Saves the user preference of what kind of cell to display
leandroalonso May 24, 2019
619cae9
Simplifies how ghost cell is shown
leandroalonso May 25, 2019
8ba8c60
Remove some unvalid tests
leandroalonso May 25, 2019
e879c00
Fix ghost compact cell height
leandroalonso May 28, 2019
510ebb7
Remove trailing whitespace
leandroalonso May 30, 2019
c3221cd
Makes cell height dynamic, to avoid issues with accessibility
leandroalonso May 31, 2019
3934d92
Removes unnecessary test
leandroalonso May 31, 2019
5d12ea5
Show the search without results and with a message
leandroalonso May 24, 2019
f78b0c3
Show the correct separator and "View" option when searching
leandroalonso May 24, 2019
2e78637
Sort the search results based on the post status
leandroalonso May 24, 2019
3a29c89
Fix image width in compact cell
leandroalonso May 31, 2019
25919ad
Change guard's return to follow project convention
leandroalonso May 31, 2019
275f794
Merge pull request #11816 from leandroalonso/issue/11646_post_list_co…
nheagy May 31, 2019
9c99d63
Change the header to use ActivityListSectionHeaderView and fixes the …
leandroalonso Jun 5, 2019
660f59c
Change labels for publish and draft posts in both Page and Blogs sect…
leandroalonso Jun 6, 2019
f5c1b8d
Tracks when user toggles between compact and card view
leandroalonso Jun 6, 2019
5fc492e
Fix published and draft labels
leandroalonso Jun 6, 2019
6d28db4
Refresh table view when dismissing search controller to prevent wrong…
leandroalonso Jun 6, 2019
dd75572
Fixes an issue when typing the search right away
leandroalonso Jun 6, 2019
f44408e
Merge pull request #11830 from leandroalonso/issue/11646_post_list_ne…
nheagy Jun 17, 2019
f8c11cd
Remove force unwrapping
leandroalonso Jun 21, 2019
ab4612d
Remove force unwrapping
leandroalonso Jun 21, 2019
d047610
Remove force unwrapping
leandroalonso Jun 21, 2019
9d2d40e
Remove force unwrapping
leandroalonso Jun 21, 2019
674b91a
Change the post cell constant to 16 regardless of the device
leandroalonso Jun 21, 2019
3890072
Migrate some post styles to Swift
leandroalonso Jun 23, 2019
b15fcf1
Migrate nav bar and attributed string styles to Swift
leandroalonso Jun 23, 2019
84bc458
Remove unused styles
leandroalonso Jun 23, 2019
38b3698
Move Pages Styles to it's own file
leandroalonso Jun 23, 2019
2cf7e9f
Extract some styles to WPStyleGuide+Posts
leandroalonso Jun 23, 2019
01c771e
Rename PostCell to PostCardCell
leandroalonso Jun 23, 2019
24ca9d8
Removes trailing Whitespace
leandroalonso Jun 23, 2019
3065b8d
Rename applySelectedBackgroundView to insertSelectedBackgroundSubview
leandroalonso Jun 26, 2019
6d31c3a
Cleanup multiple isActive
leandroalonso Jun 26, 2019
923e862
Unwrap headerView
leandroalonso Jun 26, 2019
fbc69e8
Remove getter from the post style guide vars
leandroalonso Jun 26, 2019
78d6e19
Merge pull request #11974 from leandroalonso/issue/11646_post_list_re…
nheagy Jun 27, 2019
828d16c
Merge remote-tracking branch 'origin/develop' into issues/11646-post-…
nheagy Jul 9, 2019
6715f61
Fix build error in PostListViewController.swift
nheagy Jul 9, 2019
8921d9a
Add icon-post-view-card to Muriel assets
leandroalonso Jul 10, 2019
ff69fd9
Do not scroll up when view did appear
leandroalonso Jul 10, 2019
c142279
Removes unnecessary additional code
leandroalonso Jul 10, 2019
dba2e75
Merge pull request #12093 from leandroalonso/issue/11646_post_list_re…
nheagy Jul 10, 2019
5996521
Remove reference to deleted file
nheagy Jul 10, 2019
61872c5
Fix test failing because of outdated pod
nheagy Jul 10, 2019
33a86a8
Merge remote-tracking branch 'origin/develop' into issues/11646-post-…
nheagy Jul 10, 2019
c670c56
Update Podfile.lock
nheagy Jul 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ plugin 'cocoapods-repo-update'
##
def wordpress_shared
## for production:
pod 'WordPressShared', '~> 1.8.4'
# pod 'WordPressShared', '~> 1.8.4'

## for development:
# pod 'WordPressShared', :path => '../WordPress-iOS-Shared'

## while PR is in review:
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :branch => 'add/app-icon-analytics'
pod 'WordPressShared', :git => 'https://github.com/leandroalonso/WordPress-iOS-Shared.git', :branch => 'feature/wpios11646_post_list_toggle_events'
# pod 'WordPressShared', :git => 'https://github.com/wordpress-mobile/WordPress-iOS-Shared.git', :commit => ''
end

Expand All @@ -36,10 +36,11 @@ end
def wordpress_ui
## for production:
pod 'WordPressUI', '~> 1.3.4'

## for development:
## pod 'WordPressUI', :path => '../WordPressUI-iOS'
## while PR is in review:
## pod 'WordPressUI', :git => 'https://github.com/wordpress-mobile/WordPressUI-iOS.git', :commit => 'edd2908'
## pod 'WordPressUI', :git => 'https://github.com/wordpress-mobile/WordPressUI-iOS', :branch => 'change_layout_margins_uiview_helper'
end

def wordpress_kit
Expand All @@ -56,7 +57,7 @@ def shared_with_all_pods
pod 'NSObject-SafeExpectations', '0.0.3'
end

def shared_with_networking_pods
def shared_with_networking_pods
pod 'Alamofire', '4.7.3'
pod 'Reachability', '3.2'

Expand Down Expand Up @@ -249,7 +250,7 @@ end
##
target 'WordPressTodayWidget' do
project 'WordPress/WordPress.xcodeproj'

shared_with_all_pods
shared_with_networking_pods
end
Expand Down
11 changes: 8 additions & 3 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ DEPENDENCIES:
- WordPressAuthenticator (~> 1.6.0)
- WordPressKit (~> 4.2.0)
- WordPressMocks (~> 0.0.5)
- WordPressShared (~> 1.8.4)
- WordPressShared (from `https://github.com/leandroalonso/WordPress-iOS-Shared.git`, branch `feature/wpios11646_post_list_toggle_events`)
- WordPressUI (~> 1.3.4)
- WPMediaPicker (~> 1.4.2)
- yoga (from `https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.8.0/react-native-gutenberg-bridge/third-party-podspecs/yoga.podspec.json`)
Expand Down Expand Up @@ -303,7 +303,6 @@ SPEC REPOS:
- WordPressAuthenticator
- WordPressKit
- WordPressMocks
- WordPressShared
- WordPressUI
- WPMediaPicker
- wpxmlrpc
Expand Down Expand Up @@ -334,6 +333,9 @@ EXTERNAL SOURCES:
RNTAztecView:
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.8.0
WordPressShared:
:branch: feature/wpios11646_post_list_toggle_events
:git: https://github.com/leandroalonso/WordPress-iOS-Shared.git
yoga:
:podspec: https://raw.githubusercontent.com/wordpress-mobile/gutenberg-mobile/v1.8.0/react-native-gutenberg-bridge/third-party-podspecs/yoga.podspec.json

Expand All @@ -353,6 +355,9 @@ CHECKOUT OPTIONS:
RNTAztecView:
:git: http://github.com/wordpress-mobile/gutenberg-mobile/
:tag: v1.8.0
WordPressShared:
:commit: f5c10cda240dac3ec86526b1646ab8c2031adcdc
:git: https://github.com/leandroalonso/WordPress-iOS-Shared.git

SPEC CHECKSUMS:
1PasswordExtension: 0e95bdea64ec8ff2f4f693be5467a09fac42a83d
Expand Down Expand Up @@ -409,6 +414,6 @@ SPEC CHECKSUMS:
ZendeskSDK: cbd49d65efb2f2cdbdcaac84e618896ae87b861e
ZIPFoundation: 89df685c971926b0323087952320bdfee9f0b6ef

PODFILE CHECKSUM: 9500c157b4a0ffc32da7461e3a21e5c43271e50e
PODFILE CHECKSUM: 2a0ffdd371186f29bd5e0964e26a4f97e6d77dec

COCOAPODS: 1.6.1
6 changes: 2 additions & 4 deletions WordPress/Classes/Models/AbstractPost.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ + (NSString *)titleForStatus:(NSString *)status
return NSLocalizedString(@"Pending review", @"Name for the status of a post pending review.");

} else if ([status isEqualToString:PostStatusPrivate]) {
return NSLocalizedString(@"Privately published", @"Name for the status of a post that is marked private.");
return NSLocalizedString(@"Private", @"Name for the status of a post that is marked private.");

} else if ([status isEqualToString:PostStatusPublish]) {
return NSLocalizedString(@"Published", @"Name for the status of a published post.");
Expand Down Expand Up @@ -507,9 +507,7 @@ - (NSString *)contentPreviewForDisplay
- (NSString *)dateStringForDisplay
{
if ([self isDraft] || [self.status isEqualToString:PostStatusPending]) {
NSString *shortDate = [[self dateModified] mediumString];
NSString *lastModified = NSLocalizedString(@"last-modified",@"A label for a post's last-modified date.");
return [NSString stringWithFormat:@"%@ (%@)", shortDate, lastModified];
return [[self dateModified] mediumString];
} else if ([self isScheduled]) {
return [[self dateCreated] mediumStringWithTime];
} else if ([self shouldPublishImmediately]) {
Expand Down
6 changes: 4 additions & 2 deletions WordPress/Classes/Models/Post.swift
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,16 @@ class Post: AbstractPost {
override func statusForDisplay() -> String? {
var statusString: String?

if status != .publish && status != .draft {
if status == .trash || status == .scheduled {
statusString = ""
} else if status != .publish && status != .draft {
statusString = statusTitle as String?
}

if isRevision() {
let localOnly = NSLocalizedString("Local", comment: "A status label for a post that only exists on the user's iOS device, and has not yet been published to their blog.")

if let tempStatusString = statusString {
if let tempStatusString = statusString, !tempStatusString.isEmpty {
statusString = String(format: "%@, %@", tempStatusString, localOnly)
} else {
statusString = localOnly
Expand Down
6 changes: 1 addition & 5 deletions WordPress/Classes/System/WordPress-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@

#import "HockeyManager.h"

#import "InteractivePostView.h"
#import "InteractivePostViewDelegate.h"

#import "LocalCoreDataService.h"

#import "Media.h"
Expand All @@ -49,7 +46,6 @@
#import "PageListTableViewCell.h"
#import "PageSettingsViewController.h"
#import "PostContentProvider.h"
#import "PostCardTableViewCell.h"
#import "PostCategory.h"
#import "PostContentProvider.h"
#import "PostListFooterView.h"
Expand Down Expand Up @@ -109,7 +105,7 @@
#import "WPGUIConstants.h"
#import "WPImageViewController.h"
#import "WPScrollableViewController.h"
#import "WPStyleGuide+Posts.h"
#import "WPStyleGuide+Pages.h"
#import "WPStyleGuide+ReadableMargins.h"
#import "WPStyleGuide+WebView.h"
#import "WPTableImageSource.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,9 @@ + (TracksEventPair *)eventPairForStat:(WPAnalyticsStat)stat
eventName = @"post_list_button_pressed";
eventProperties = @{ TracksEventPropertyButtonKey : @"view" };
break;
case WPAnalyticsStatPostListToggleButtonPressed:
eventName = @"post_list_toggle_button_pressed";
break;
case WPAnalyticsStatPostRevisionsListViewed:
eventName = @"revisions_list_viewed";
break;
Expand Down
9 changes: 8 additions & 1 deletion WordPress/Classes/Utility/WPContentSyncHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import CocoaLumberjack
@objc protocol WPContentSyncHelperDelegate: NSObjectProtocol {
func syncHelper(_ syncHelper: WPContentSyncHelper, syncContentWithUserInteraction userInteraction: Bool, success: ((_ hasMore: Bool) -> Void)?, failure: ((_ error: NSError) -> Void)?)
func syncHelper(_ syncHelper: WPContentSyncHelper, syncMoreWithSuccess success: ((_ hasMore: Bool) -> Void)?, failure: ((_ error: NSError) -> Void)?)
@objc optional func syncContentStart(_ syncHelper: WPContentSyncHelper)
@objc optional func syncContentEnded(_ syncHelper: WPContentSyncHelper)
@objc optional func syncContentFailed(_ syncHelper: WPContentSyncHelper)
@objc optional func hasNoMoreContent(_ syncHelper: WPContentSyncHelper)
Expand All @@ -14,7 +15,13 @@ import CocoaLumberjack
class WPContentSyncHelper: NSObject {

@objc weak var delegate: WPContentSyncHelperDelegate?
@objc var isSyncing: Bool = false
@objc var isSyncing: Bool = false {
didSet {
if isSyncing {
delegate?.syncContentStart?(self)
}
}
}
@objc var isLoadingMore: Bool = false
@objc var hasMoreContent: Bool = true {
didSet {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "PageListSectionHeaderView.h"
#import "WPStyleGuide+Posts.h"
#import "WPStyleGuide+Pages.h"
#import <WordPressShared/WPDeviceIdentification.h>

@interface PageListSectionHeaderView()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "PageListTableViewCell.h"
#import "WPStyleGuide+Posts.h"
#import "WPStyleGuide+Pages.h"
#import "WordPress-Swift.h"

@import Gridicons;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,17 @@ class PageListViewController: AbstractPostListViewController, UIViewControllerRe
return Constant.Size.pageCellWithTagEstimatedRowHeight
}

func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView! {
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard _tableViewHandler.groupResults else {
return UIView(frame: .zero)
}

let sectionInfo = _tableViewHandler.resultsController.sections?[section]
let nibName = String(describing: PageListSectionHeaderView.self)
let headerView = Bundle.main.loadNibNamed(nibName, owner: nil, options: nil)![0] as! PageListSectionHeaderView
let headerView = Bundle.main.loadNibNamed(nibName, owner: nil, options: nil)?.first as? PageListSectionHeaderView

if let sectionInfo = sectionInfo {
headerView.setTitle(sectionInfo.name)
if let sectionInfo = sectionInfo, let headerView = headerView {
headerView.setTitle(PostSearchHeader.title(forStatus: sectionInfo.name))
}

return headerView
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "RestorePageTableViewCell.h"
#import "WPStyleGuide+Posts.h"
#import "WPStyleGuide+Pages.h"

@interface RestorePageTableViewCell()

Expand Down
Loading