Skip to content

Commit

Permalink
Bump base SDK to macOS 12 + fixes for macOS 12
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimillian committed Jul 30, 2021
1 parent 856a56c commit 4c2bf62
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 44 deletions.
12 changes: 6 additions & 6 deletions RedditOs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 19052021;
CURRENT_PROJECT_VERSION = 30072021;
DEVELOPMENT_ASSET_PATHS = "\"RedditOs/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -688,8 +688,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.5.4;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.5.5;
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.curiosity;
PRODUCT_NAME = Curiosity;
SWIFT_VERSION = 5.0;
Expand All @@ -705,7 +705,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 19052021;
CURRENT_PROJECT_VERSION = 30072021;
DEVELOPMENT_ASSET_PATHS = "\"RedditOs/Preview Content\"";
DEVELOPMENT_TEAM = Z6P74P6T99;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -715,8 +715,8 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 11.0;
MARKETING_VERSION = 0.5.4;
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 0.5.5;
PRODUCT_BUNDLE_IDENTIFIER = com.thomasricouard.curiosity;
PRODUCT_NAME = Curiosity;
SWIFT_VERSION = 5.0;
Expand Down
21 changes: 4 additions & 17 deletions RedditOs/Features/Post/PostDetailToolbar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,14 @@ struct PostDetailToolbar: ToolbarContent {
}

struct SearchView: View {
@State private var isExpanded = false
@EnvironmentObject private var uiState: UIState

var body: some View {
if uiState.displayToolbarSearchBar {
if !isExpanded {
Button {
isExpanded.toggle()
} label: {
Image(systemName: "magnifyingglass")
}
} else {
QuickSearchBar(showSuggestionPopover: true,
onCommit: {},
onCancel: {
self.isExpanded = false
})
.frame(width: 300)
.transition(.slide)
.animation(.easeInOut)
}
QuickSearchBar(showSuggestionPopover: true,
onCommit: {},
onCancel: {})
.frame(width: 250)
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions RedditOs/Features/Search/Quick/QuickSearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ struct QuickSearchBar: View {
} onCancel: {
onCancel()
}
.keyboardShortcut("f", modifiers: .command)
.animation(.easeInOut)
.popover(isPresented: $isPopoverPresented) {
ScrollView {
VStack(alignment: .leading) {
Expand Down
2 changes: 1 addition & 1 deletion RedditOs/Features/Search/Quick/QuickSearchResultRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct QuickSearchResultRow: View {
.whenHovered({ hovered in
isHovered = hovered
})
.animation(.interactiveSpring())
.animation(.interactiveSpring(), value: isHovered)
}
}

Expand Down
2 changes: 1 addition & 1 deletion RedditOs/Features/Search/Shared/SearchBarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct SearchBarView: View {
} onCommit: {
onCommit()
}
.keyboardShortcut("f", modifiers: .command)
.padding(8)
.background(RoundedRectangle(cornerRadius: 8)
.stroke(isFocused ? Color.accentColor : Color.clear)
Expand All @@ -39,7 +40,6 @@ struct SearchBarView: View {
.font(.title2)
}
.buttonStyle(BorderlessButtonStyle())
.animation(.easeInOut)
.transition(.move(edge: .trailing))
}
}
Expand Down
11 changes: 5 additions & 6 deletions RedditOs/Features/Sidebar/SidebarView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ struct SidebarView: View {
subscriptionSection
multiSection
}
.listStyle(SidebarListStyle())
.frame(minWidth: 200, idealWidth: 200, maxWidth: 200, maxHeight: .infinity)
.listStyle(.sidebar)
.whenHovered({ hovered in
isHovered = hovered
})
Expand Down Expand Up @@ -100,7 +99,7 @@ struct SidebarView: View {
.equatable()) {
Label(LocalizedStringKey(item.rawValue.capitalized), systemImage: item.icon())
}.tag(item.rawValue)
}.animation(nil)
}.animation(nil, value: isHovered)
}
}

Expand Down Expand Up @@ -143,10 +142,10 @@ struct SidebarView: View {
.buttonStyle(BorderlessButtonStyle())
}
}
}.animation(nil)
}.animation(nil, value: isHovered)
}
.listItemTint(.redditGold)
.animation(.easeInOut)
.animation(.easeInOut, value: isHovered)
}

private var recentlyVisitedSection: some View {
Expand Down Expand Up @@ -184,7 +183,7 @@ struct SidebarView: View {
.buttonStyle(BorderlessButtonStyle())
}
}
}.animation(nil)
}.animation(nil, value: isHovered)
}.listItemTint(.redditBlue)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct SubredditAboutPopoverView: View {
}, label: {
Image(systemName: isFavorite ? "star.fill" : "star")
.resizable()
.imageScale(.large)
.frame(width: 16, height: 16)
.foregroundColor(isFavorite ? .redditGold : nil)
}).buttonStyle(BorderlessButtonStyle())
}
Expand Down
2 changes: 0 additions & 2 deletions RedditOs/Features/Subreddit/SubredditPostRow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ struct SubredditPostRow: View, Equatable {
Text(url.host ?? url.absoluteString)
.lineLimit(1)
.truncationMode(.tail)
.frame(maxWidth: 250)
}
}
}
Expand All @@ -89,7 +88,6 @@ struct SubredditPostRow: View, Equatable {
Spacer()
}
}
.frame(width: 470)
.padding(.vertical, 8)
.contextMenu {
Button {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct SubredditPostThumbnailView: View {
.padding(.leading, 6)
.padding(.top, -2)
.transition(.move(edge: .top))
.animation(.interactiveSpring())
.animation(.interactiveSpring(), value: post.saved)
}
}.padding(4)
}
Expand Down
2 changes: 0 additions & 2 deletions RedditOs/Features/Subreddit/SubredditPostsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ struct SubredditPostsListView: View, Equatable {
} onCancel: {

}
.keyboardShortcut("f", modifiers: .command)
.padding(.bottom, 8)
}
},
Expand All @@ -85,7 +84,6 @@ struct SubredditPostsListView: View, Equatable {
viewModel.fetchListings(after: viewModel.listings?.last?.id)
}
}
.equatable()
.toolbar {
ToolbarItem(placement: .navigation) {
Group {
Expand Down
5 changes: 2 additions & 3 deletions RedditOs/Features/Subreddit/SubredditViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ class SubredditViewModel: ObservableObject {
self.localData = localData

$searchText
.subscribe(on: DispatchQueue.global())
.debounce(for: .milliseconds(500), scheduler: DispatchQueue.main)
.debounce(for: .milliseconds(500), scheduler: RunLoop.main)
.removeDuplicates()
.receive(on: DispatchQueue.main)
.compactMap{ $0 }
.sink(receiveValue: { [weak self] text in
if text.isEmpty {
self?.isSearchLoading = false
Expand Down
4 changes: 2 additions & 2 deletions RedditOs/Shared/PostsListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ struct PostsListView<Header: View>: View, Equatable {
}
}
}
.listStyle(InsetListStyle())
.frame(width: 500)
.listStyle(.inset)
.frame(minWidth: 400, idealWidth: 500, maxWidth: 700)
}
}

Expand Down

0 comments on commit 4c2bf62

Please sign in to comment.