Tumgik
#int. valentine & jasper
hairpintvrns · 1 month
Text
STARTER FOR: @fromharbor LOCATION: blue harbor library !
Valentine wasn’t a reader by any means, but the silence in their apartment when their roommate was away working their typical 9 to 5 had left them slightly unmoored. Without their company, there was only absence: no foreground, no important contrapuntal material, no chordal accompaniment by which to view the world.
Instead, they’d taken to visiting the library during these working hours. The quietude of it was comforting—and it helped, of course, that Jasper was a constant presence through it all. A way of basking in their familiar company without too direct a contact.
They’d sat on a table adjacent to the shelves comprising the music section, parsing through the two volumes of a formal analysis of Bach’s cello suites that lay in front of them. They tapped their fingers along the wood as they made sense of the author’s analysis regarding the rhythmic aspects of its First Suite Allemande through its event icons. A deceptive cadence here, an elided cadence there. The author had begun talking about the suite’s lack of internal division and its lack of variety against the rest of the concert allemandes, which they found themselves agreeing, only the sentiment was cut short, as they flipped through the page page and found the volume already referring to the courantes—
“Wait. That can’t be right.” Their voice was measured, but amplified, amid the silence of the library. “Sorry,” they said to no one in particular—only to find their brother already as their unwitting audience. A small smile stretched over their features, then, as they held the book up for their brother to see. “Jas, I’m afraid to say there’s a misprint in this one. This volume’s missing at least twenty pages.”
Tumblr media
4 notes · View notes
arthurknopper · 4 years
Text
SwiftUI Pinned Views Tutorial
SwiftUI can provide a PinnedScrollableView inside a ScrollView. These pinned views act as a sticky view and can be applied to a header or a footer. In this Tutorial a pinned view will be used as header inside a LazyVStack. When the VStack is scrolled vertically the pinned view will “stick” to the top. This tutorial is build with Xcode 12 and iOS 14, which can be download at the Apple developer portal.
Open Xcode and either click Create a new Xcode project in Xcode’s startup window, or choose File > New > Project. In the template selector, select iOS as the platform, select App template in the Application section and then click Next.
Enter SwiftUIPinnedViewsTutorial as the Product Name, select SwiftUI as Interface, SwiftUI App as Life Cycle and Swift as Language. Deselect the Include Tests checkbox and click Next. Choose a location to save the project on your Mac.
In the canvas, click Resume to display the preview. If the canvas isn’t visible, select Editor > Editor and Canvas to show it.
In the Project navigator, click to select ContentView.swift. Change the code inside the ContentView struct to
struct ContentView: View { let teams = [ [ "Al Ferrin", "Valentin Diggins", "Odis Troutman", "Alexander Geise", "Tyrone Stringer", "Mitchel Grosso", "Aldo Catchings", "Xavier Tynes", "Michel Tripoli", "Spencer Courter", "Bradly Liner", "Rueben Touchette", "Rusty Castenada", "Rudolf Dorfman", "Colby Bhakta" ], [ "Jonathan Wyse", "Max Huber", "Sergio Greaney", "Lincoln Pazos", "Donovan Ringer", "Dominique Garbett", "Mickey Foltz", "Courtney Mcandrew", "Jasper Zwilling", "Nicholas Aquino", "Devin Tunney", "Dewitt Coover", "Clement Speelman", "Romeo Lindner", "Rodrick Threlkeld" ] ]
A team Array property is created each containing an array of team member.s Next add the body property
var body: some View { NavigationView { ScrollView { // 1. LazyVStack(spacing: 10, pinnedViews: [.sectionHeaders]) { ForEach(0 ..< teams.count) { index in // 2. Section(header: headerView(index)) { ForEach(0 ..< teams[index].count) { member in // 3. Text("\(teams[index][member])") .id(UUID()) .font(.title) } } } } } .navigationTitle("Pinned Views") } }
A LazyVStack is displayed inside a Scroll View with a pinned View property of type .sectionHeader
A custom HeaderView will be used to display the section header
The members of the team will be displayed as a Text View.
Next, implement the headerView(_:) method
private func headerView(_ index: Int) -> some View { Text("Team \(index + 1)") .padding() .foregroundColor(Color.white) .font(.largeTitle) .frame(maxWidth: .infinity) .background(Color.blue) }
The Team number is displayed with a white foreground color and a blue background color. Go to the Preview Pane and press the Live Preview Button. Scroll the Team members vertically. the header view will be pinned at the top.
The source code of the SwiftUIPinnedViewsTutorial can be downloaded at the ioscreator repository on Github.
0 notes