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
let label = UILabel() | |
label.text = "Swift is a modern, intuitive programming language crafted for all Apple platforms." | |
label.setValue(true, forKey: "marqueeEnabled") | |
label.setValue(true, forKey: "marqueeRunning") | |
label.setValue(0, forKey: "marqueeRepeatCount") |
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
// Example | |
// Custom extension to add a blur effect style with raw value 1100 | |
extension UIBlurEffect.Style { | |
static var systemChromeBackground: UIBlurEffect.Style { | |
return UIBlurEffect.Style(rawValue: 1100) ?? .dark | |
} | |
} |
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 SwiftUI | |
struct ContentView: View { | |
@State var maxNumber: Int = 50 | |
var body: some View { | |
Text(verbatim: "Bounce-BasedOnSize") | |
Slider(value: Binding( | |
get: { Double(maxNumber) }, | |
set: { maxNumber = Int($0) } | |
), in: 1...50, step: 1) |
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 SwiftUI | |
//自作パッケージの切り出しなので変数名がめちゃくちゃです | |
//詳しくはこれの実装を見てください https://github.com/Chronos2500/CustomNavigationTitle | |
struct ContentView: View { | |
var body: some View { | |
NavigationStack{ | |
ScrollView { | |
Color.blue.frame(height: 200) |
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 SwiftUI | |
struct ContentView: View { | |
@State private var ignoreSafeArea = false | |
var body: some View { | |
ZStack { | |
Color.blue | |
.ignoresSafeArea(edges: ignoreSafeArea ? .all : []) |