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
http://devstreaming.apple.com/videos/wwdc/2013/710xfx3xn8197k4i9s2rvyb/710/710-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/202xdx2x47ezp1wein/202/202-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/200xdx2x35e1pxiinm/200/200-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/413xdx5x97itb5ek4yex3r7/413/413-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/612xax4xx65z1ervy5np1qb/612/612-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/221xex4xxohbllf4hblyngt/221/221-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/220xbx4xipaxfd1tggxuoib/220/220-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/711xcx4x8yuutk8sady6t9f/711/711-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/404xbx2xvp1eaaqonr8zokm/404/404-HD.mov?dl=1 | |
http://devstreaming.apple.com/videos/wwdc/2013/505xbx4xrgmhwby4oiwkrpp/505/505-HD.mov?dl=1 |
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
// MARK: - String Extension | |
private extension String { | |
/** | |
replace characters from the original text to some image | |
- parameter character: the character that will be used to be replaced by image | |
- parameter image: image name that will replace the character | |
*/ | |
func replace(char character: String, image: String) -> NSAttributedString { | |
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
// An (useless) example of Swift 4.2 @dynamicMemberLookup attributes. | |
// let color1 = HexColor().cbcbcb | |
// let color2 = HexColor().000000 // This can also be built. Will be treat as "000000" | |
import Foundation | |
@dynamicMemberLookup | |
struct HexColor { | |
subscript(dynamicMember member: String) -> UIColor? { | |
do { |
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 ViewControllerHolder { | |
weak var value: UIViewController? | |
init(_ value: UIViewController?) { | |
self.value = value | |
} | |
} | |
struct ViewControllerKey: EnvironmentKey { | |
static var defaultValue: ViewControllerHolder { return ViewControllerHolder(UIApplication.shared.windows.first?.rootViewController ) } |
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
/** | |
* MacEditorTextView | |
* Copyright (c) Thiago Holanda 2020-2021 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import Combine | |
import SwiftUI |
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
// | |
// ContentView.swift | |
// TryGeometryReader | |
// | |
// Created by satoutakeshi on 2019/12/07. | |
// Copyright © 2019 satoutakeshi. Licensed under MIT. | |
// | |
import SwiftUI |
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 makePNG(_ size: NSSize, by drawing: (CGContext) -> ()) -> Data? { | |
guard let bitmapImageRep = NSBitmapImageRep(bitmapDataPlanes: nil, | |
pixelsWide: Int(size.width), | |
pixelsHigh: Int(size.height), | |
bitsPerSample: 8, | |
samplesPerPixel: 4, | |
hasAlpha: true, | |
isPlanar: false, | |
colorSpaceName: NSColorSpaceName.deviceRGB, | |
bytesPerRow: 0, bitsPerPixel: 0) else { |
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 SwiftUI | |
struct AnimalView: View { | |
var model: Animal | |
var body: some View { | |
VStack { | |
Image(systemName: model.systemImageName) | |
.resizable() | |
.scaledToFit() |
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 SwiftUI | |
struct ContentView: View { | |
@State var gradient = [ | |
Color.red, .orange, .yellow, .green, .blue, .purple, Color.red, .orange, .yellow, .green, .blue, .purple, | |
] | |
@State var startPoint = UnitPoint(x: 0, y: -1) | |
@State var endPoint = UnitPoint(x: 0, y: 1) |
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
/** | |
* PreviewDevice+ListOfPads.swift | |
* Copyright (c) Thiago Holanda 2020 | |
* https://twitter.com/tholanda | |
* | |
* MIT license | |
*/ | |
import SwiftUI |
OlderNewer