Skip to content

Commit

Permalink
Fixed sheet bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vknabel committed Sep 16, 2020
1 parent bb8dd03 commit b2db288
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
1 change: 1 addition & 0 deletions .xcode-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
12.0
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.0

* iOS 14 support

## 1.0.2

* Removed Instabug
Expand Down
5 changes: 4 additions & 1 deletion Puffery.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1160;
LastUpgradeCheck = 1140;
LastUpgradeCheck = 1200;
ORGANIZATIONNAME = "Valentin Knabel";
TargetAttributes = {
BA952508245EC51900FFC9E3 = {
Expand Down Expand Up @@ -568,6 +568,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -776,6 +777,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -838,6 +840,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
4 changes: 2 additions & 2 deletions Puffery.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@
"repositoryURL": "https://github.com/pointfreeco/swift-composable-architecture.git",
"state": {
"branch": null,
"revision": "b8c67d5d4f27ad3b2f772cf50f91c581fc94611c",
"version": "0.6.0"
"revision": "47a9d368d1f314a630bf91b71acfb5054420eeb3",
"version": "0.8.0"
}
},
{
Expand Down
4 changes: 2 additions & 2 deletions PufferyKit/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let package = Package(
.package(name: "Overture", url: "https://github.com/pointfreeco/swift-overture.git", from: "0.5.0"),
.package(name: "KeychainSwift", url: "https://github.com/evgenyneu/keychain-swift.git", from: "19.0.0"),
// .package(name: "AckeeTracker", url: "https://github.com/vknabel/AckeeTracker-Swift.git", from: "0.1.0"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "0.6.0"),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture.git", from: "0.8.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand Down Expand Up @@ -64,7 +64,7 @@ let package = Package(
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
]
),

.target(name: "DesignSystem", dependencies: [
"PlatformSupport",
"PufferyKit",
Expand Down
37 changes: 24 additions & 13 deletions PufferyKit/Sources/PufferyUI/ChannelListPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//

import Combine
import SwiftUI
import DesignSystem
import SwiftUI

enum ChannelSelection: Hashable {
case all
Expand All @@ -21,11 +21,11 @@ struct ChannelListPage: View {
@State var presentsSettings = false
@State var presentsChannelCreation = false
@State var presentsChannelSubscription = false
@State var shouldReload: PassthroughSubject<Void, FetchingError> = PassthroughSubject<Void, FetchingError>()
@State var shouldReload = PassthroughSubject<Void, FetchingError>()
@State var selection: ChannelSelection? = UIDevice.current.model == "iPad"
? .all
: nil

var isIpad: Bool { UIDevice.current.model == "iPad" }

var body: some View {
Expand All @@ -34,6 +34,11 @@ struct ChannelListPage: View {
Section {
NavigationLink(destination: ChannelDetailsPage(), tag: .all, selection: $selection) {
Text("ChannelList.All")
.sheet(isPresented: $presentsChannelCreation, onDismiss: shouldReload.send) {
NavigationView {
ChannelCreationPage()
}.navigationViewStyle(StackNavigationViewStyle())
}
}
}

Expand All @@ -54,6 +59,10 @@ struct ChannelListPage: View {
Text(channel.title)
}
}
}.sheet(isPresented: $presentsChannelSubscription, onDismiss: shouldReload.send) {
NavigationView {
ChannelSubscribingPage()
}.navigationViewStyle(StackNavigationViewStyle())
}
}
}.roundedListStyle(sidebar: false)
Expand All @@ -64,21 +73,23 @@ struct ChannelListPage: View {
}

func createChannelHeader() -> some View {
channelsHeader("ChannelList.OwnChannels.SectionTitle", actionText: "ChannelList.OwnChannels.New", action: { self.presentsChannelCreation.toggle() })
.sheet(isPresented: $presentsChannelCreation, onDismiss: shouldReload.send) {
NavigationView {
ChannelCreationPage()
}.navigationViewStyle(StackNavigationViewStyle())
HStack {
Text("ChannelList.OwnChannels.SectionTitle")
Spacer()

Button(action: { DispatchQueue.main.async {
self.presentsChannelCreation.toggle()
} }) {
HStack {
Text("ChannelList.OwnChannels.New")
Image(systemName: "plus.circle").font(.body)
}.foregroundColor(.accentColor)
}
}
}

func subscribeChannelHeader() -> some View {
channelsHeader("ChannelList.SubscribeChannels.SectionTitle", actionText: "ChannelList.SubscribeChannels.New", action: { self.presentsChannelSubscription.toggle() })
.sheet(isPresented: $presentsChannelSubscription, onDismiss: shouldReload.send) {
NavigationView {
ChannelSubscribingPage()
}.navigationViewStyle(StackNavigationViewStyle())
}
}

func channelsHeader(_ title: LocalizedStringKey, actionText: LocalizedStringKey, action: @escaping () -> Void) -> some View {
Expand Down

0 comments on commit b2db288

Please sign in to comment.