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
// The SwiftUI Lab | |
// Website: https://swiftui-lab.com | |
// Article: https://swiftui-lab.com/alignment-guides | |
import SwiftUI | |
class Model: ObservableObject { | |
@Published var minimumContainer = true | |
@Published var extendedTouchBar = false | |
@Published var twoPhases = true |
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
// Authoer: The SwiftUI Lab | |
// Full article: https://swiftui-lab.com/scrollview-pull-to-refresh/ | |
import SwiftUI | |
struct ContentView: View { | |
@ObservedObject var model = MyModel() | |
@State private var alternate: Bool = true | |
let array = Array<String>(repeating: "Hello", count: 100) |
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
import Darwin | |
/** | |
Returns a lazy sequence that returns a String for every line of `file`. | |
Example 1: | |
// print all lines from a file | |
let file = fopen(NSBundle.mainBundle().pathForResource("Cartfile", ofType: nil)!,"r") | |
for line in lineGenerator(file) { print(line,separator: "", terminator: "") } | |
fclose(file) |