<template>
<!--
When isLoading is true, the <div> is in the DOM, the <p> is not.
When isLoading is false, Vue will remove the <div> and add the <p> to the DOM,
at which point <MyComponent> will be created and passed the fetched data.
-->
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
| // | |
| // IAPHandler.swift | |
| // | |
| // Created by Dejan Atanasov on 13/07/2017. | |
| // Copyright © 2017 Dejan Atanasov. All rights reserved. | |
| // | |
| import UIKit | |
| import StoreKit |
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 Foundation | |
| import UIKit | |
| struct ViewStyle<T> { | |
| let style: (T) -> Void | |
| } | |
| let filled = ViewStyle<UIButton> { | |
| $0.setTitleColor(.white, for: .normal) | |
| $0.backgroundColor = .red |
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
| //-------------------------------------------------- | |
| // The SwiftUI Lab: Advanced SwiftUI Animations | |
| // https://swiftui-lab.com/swiftui-animations-part1 | |
| //-------------------------------------------------- | |
| import SwiftUI | |
| struct ContentView: View { | |
| var body: some View { | |
| NavigationView { |
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 Foundation | |
| import SwiftUI | |
| struct GradientCircle: View { | |
| var body: some View { | |
| let color1 = Color.init(red: 81/255, green: 204/255, blue: 159/255) | |
| let color2 = Color.init(red: 154/255, green: 255/255, blue: 248/255) | |
| let spectrum = Gradient(colors: [ color1, color2]) | |
| let conic = | |
| LinearGradient(gradient: spectrum, startPoint: UnitPoint(x: 0, y: 0.5), endPoint: UnitPoint(x: 0.5, y: 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
| #!/usr/bin/ruby | |
| # Create display override file to force Mac OS X to use RGB mode for Display | |
| # see http://embdev.net/topic/284710 | |
| require 'base64' | |
| data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
| edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
| vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
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
| //------------------------------------------------------------------------ | |
| // Author: The SwiftUI Lab | |
| // Post: Advanced SwiftUI Animations - Part 4 | |
| // Link: https://swiftui-lab.com/swiftui-animations-part4 (TimelineView) | |
| // | |
| import SwiftUI | |
| struct CyclicTimelineSchedule: TimelineSchedule { | |
| let timeOffsets: [TimeInterval] |
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
| // by dave | |
| float[][] result; | |
| float t, c; | |
| float ease(float p) { | |
| p = c01(p); | |
| return 3*p*p - 2*p*p*p; | |
| } | |
| float ease(float p, float g) { |