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
// | |
// WaveformView.swift | |
// WaveformSwiftUI | |
// | |
// Created by Adam Bell on 9/4/19. | |
// Copyright © 2019 Adam Bell. All rights reserved. | |
// | |
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
struct ADSRSliderView: View { | |
fileprivate struct DragGestureState { | |
var previousTranslationY: CGFloat? | |
var deltaPercentY: CGFloat = 0.0 | |
} | |
let color: Color | |
@State var percent: CGFloat = 1.0 |
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
// | |
// BlurryVibrantView.swift | |
// | |
// | |
// Created by Adam Bell on 11/9/19. | |
// Copyright © 2019 Adam Bell. All rights reserved. | |
// | |
import SwiftUI | |
import UIKit |
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
seconds/ops for each iterations (10, 20, ..., 100) | |
------------------------------------- | |
Auto Layout 0.011051890614268544 0.016263917569191225 0.021760782469873844 0.02719013433198671 0.032661064978568785 0.03816674815283881 0.04359974031863005 0.04912022749582926 0.05463409423828125 0.060078123036552876 | |
FlexLayout 1.3 0.003242011594926655 0.004680090418485838 0.006086660876418605 0.0075119084386683225 0.00897496725831713 0.010386990517685093 0.011813020706176758 0.013280785397479409 0.014661566070888353 0.016095952382163395 | |
LayoutKit 10.0 0.0035990386558093614 0.004994573877818549 0.0064350542349693104 0.007844003848731518 0.009258856467150767 0.010668569422782735 0.01216747530971665 0.013521265339207006 0.014950280758871962 0.016407939254260453 | |
Manual Layout 0.0029670758360236353 0.004297056934864225 0.005602365099517993 0.006929166563625994 0.008248548038670273 0.009564927646092005 0.010879647472630377 0.012188566736428135 0.013496214548746745 0.014810740947723389 |
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
//: A UIKit based Playground for presenting user interface | |
import SwiftUI | |
import UIKit | |
import PlaygroundSupport | |
class Model: ObservableObject { | |
@Published var on: Bool = false | |
} |
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
//: A UIKit based Playground for presenting user interface | |
import SwiftUI | |
import UIKit | |
import PlaygroundSupport | |
public struct ObservedObjectWrapperView<Content: View, Model: ObservableObject>: View { | |
@ObservedObject public var model: Model |
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 | |
import UIKit | |
import PlaygroundSupport | |
struct GestureSwitch: View { | |
@GestureState var offsetY: CGFloat? = nil | |
var body: some View { | |
ZStack { |
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 Accelerate | |
import XCTest | |
@testable import accelerateperftest | |
class AcceleratePerfTests: XCTestCase { | |
let values = Array<Float>(repeating: 0.25, count: 5000000) | |
override func setUpWithError() throws { | |
// Put setup code here. This method is called before the invocation of each test method in the class. |
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
//: A Cocoa based Playground to present user interface | |
import AppKit | |
import PlaygroundSupport | |
let nibFile = NSNib.Name("MyView") | |
var topLevelObjects : NSArray? | |
Bundle.main.loadNibNamed(nibFile, owner:nil, topLevelObjects: &topLevelObjects) | |
let views = (topLevelObjects as! Array<Any>).filter { $0 is NSView } |
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 Foundation | |
protocol UnpackedProtocol { | |
associatedtype ObjectType | |
associatedtype PointType | |
var points: [PointType] { get set } | |
} |