This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension DateFormatter { | |
static var exifDateFormatter: DateFormatter = { | |
let formatter = DateFormatter() | |
formatter.dateFormat = "yyyy':'MM':'dd' 'HH':'mm':'ss'.'SSS" | |
formatter.locale = Locale(identifier: "en_US_POSIX") | |
formatter.timeZone = TimeZone.current | |
return formatter | |
}() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() | |
Text("ScrollView Content") | |
.multilineTextAlignment(.center) | |
.foregroundColor(.white) | |
.background(Color.blue.brightness(0.2)) | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() | |
Text("ScrollView Content") | |
.multilineTextAlignment(.center) | |
.foregroundColor(.white) | |
.background(Color.blue.brightness(0.2)) | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct MainView: View { | |
/// Controls the amount of padding above the scroll view's | |
/// content. | |
@State var titleBarHeight: CGFloat = 123 | |
var body: some View { | |
ScrollView { | |
HStack { | |
Spacer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func layoutWatcher(_ proxy: GeometryProxy) -> some View { | |
/// This updates the height after each time the view | |
/// is updated. | |
DispatchQueue.main.async { | |
titleBarHeight = proxy.size.height | |
} | |
return Color.clear | |
.onAppear { | |
/// This updates the height when the view first | |
/// appears. |
OlderNewer