Please comment with your own questions below!
This file contains hidden or 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 UIKit | |
/// Represents a view that will send messages, e.g. button presses. | |
final class SenderView: UIView { | |
private let myButton: UIButton | |
@MainActor | |
init() { | |
self.myButton = .init() |
This file contains hidden or 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 UIKit | |
protocol MessageDelegate: AnyObject { | |
func didPressButton() -> Void | |
} | |
/// Represents a view that will send messages, e.g. button presses. | |
final class SenderView: UIView { | |
private let myButton: UIButton |
This file contains hidden or 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 UIKit | |
protocol MessageDelegate: AnyObject { | |
func didPressButton() -> Void | |
} | |
/// Represents a view that will send messages, e.g. button presses. | |
final class SenderView<MyMessageDelegate: MessageDelegate>: UIView { | |
private let myButton: UIButton |
This file contains hidden or 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 UIKit | |
import Combine | |
final class MessageConduit { | |
public let messageSubject = PassthroughSubject<Void, Never>() | |
} | |
/// Represents a view that will send messages, e.g. button presses. | |
final class SenderView: UIView { | |
This file contains hidden or 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 ContentView: View { | |
@State var pictureExpanded = false | |
var body: some View { | |
VStack(alignment: .leading, spacing: 0) { | |
Text("Once upon a time there was a turtle named George who made friends with a giraffe at the local water park and then they went on lots of adventures together.") | |
Button { | |
withAnimation { | |
pictureExpanded.toggle() |
OlderNewer