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
| // | |
| // DispatchQueueScheduler.swift | |
| // | |
| import Combine | |
| import Foundation | |
| // DO NOT USE THIS IN PRODUCTION | |
| struct DispatchQueueScheduler: Scheduler { | |
| let queue: DispatchQueue |
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 | |
| @propertyWrapper | |
| public struct Validate<Value> { | |
| fileprivate let _isValid: (Value) -> Bool | |
| public let asserts: Bool | |
| public let useLastValid: Bool | |
| public let message: (Value) -> String |
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
| // | |
| // ContentView.swift | |
| // Layout | |
| // | |
| // Created by Matt Gallagher on 7/6/19. | |
| // Copyright © 2019 Matt Gallagher. All rights reserved. | |
| // | |
| import SwiftUI |
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
| // | |
| // Picker+Style.swift | |
| // | |
| // Copyright 2019, Sven Herzberg | |
| // | |
| // License: MIT | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to | |
| // deal in the Software without restriction, including without limitation the |
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 | |
| import Combine | |
| struct OnScroll: ViewModifier { | |
| @Binding var offset: CGFloat | |
| //we can have a version with a closure instead of the binding, but that triggers an infinite loop if content depends on the same Store | |
| // var onOffset: (CGFloat) -> () | |
| func body(content: Content) -> some View { | |
| return VStack { |
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 NumbersCollectionView : UIViewRepresentable { | |
| @Binding var numbers: [Int] | |
| func makeUIView(context: Context) -> UICollectionView { | |
| let layout = UICollectionViewFlowLayout() | |
| let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) | |
| collectionView.backgroundColor = .white | |
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 PlaygroundSupport | |
| import SwiftUI | |
| struct LiveView: View { | |
| @State var isPresented = false | |
| var modalPresentation: some View { | |
| NavigationView { | |
| Text("Hello World") | |
| .font(.caption) |
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
| # download this file to your project folder and excute | |
| # chmod +x generate-ios.sh | |
| # then run using | |
| # ./generate-ios.sh | |
| # flutter build defaults to --release | |
| flutter build ios | |
| # make folder, add .app then zip it and rename it to .ipa | |
| mkdir -p Payload |
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 'package:flutter/material.dart'; | |
| void main() => runApp(MyApp()); | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| theme: ThemeData( | |
| primarySwatch: Colors.blue, |
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
| // MIT License | |
| // | |
| // Copyright (c) 2020 Simon Lightfoot | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |