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 UIKit | |
| import YouTubePlayer | |
| final class YouTubeView: UIViewRepresentable { | |
| typealias UIViewType = YouTubePlayerView | |
| @ObservedObject var playerState: YouTubeControlState | |
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
| class PanRotatePinchUIImageView: UIImageView, UIGestureRecognizerDelegate { | |
| override init(frame: CGRect) { | |
| super.init(frame: frame) | |
| setup() | |
| } | |
| required init?(coder: NSCoder) { | |
| super.init(coder: coder) | |
| setup() |
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
| // | |
| // SnapCarousel.swift | |
| // prototype5 | |
| // | |
| // Created by xtabbas on 5/7/20. | |
| // Copyright © 2020 xtadevs. 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
| import SwiftUI | |
| extension Calendar { | |
| func generateDates( | |
| inside interval: DateInterval, | |
| matching components: DateComponents | |
| ) -> [Date] { | |
| var dates: [Date] = [] | |
| dates.append(interval.start) |
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
| // | |
| // MovieCell.swift | |
| // | |
| import UIKit | |
| final class MovieCell: UITableViewCell { | |
| let posterImageView = UIImageView(frame: .zero) |
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 UIKit | |
| // Image downloader utility class. We are going to use the singleton instance to be able to download required images and store them into in-memory cache. | |
| final class ImageDownloader { | |
| static let shared = ImageDownloader() | |
| private var cachedImages: [String: UIImage] | |
| private var imagesDownloadTasks: [String: URLSessionDataTask] |
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
| extension Array where Element: Numeric { | |
| public var total: Element { return reduce(0, +) } | |
| } |
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 UIKit | |
| struct Action { | |
| let title: String | |
| let style: UIAlertAction.Style | |
| let action: () -> Void | |
| } | |
| extension Action { | |
| static func `default`(_ title: String, action: @escaping () -> Void) -> [Action] { |
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
| # Credit: pwnsdx https://gist.github.com/pwnsdx/1217727ca57de2dd2a372afdd7a0fc21; nebular https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3#gistcomment-3019082 | |
| # IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it! | |
| # IMPORTANT: You will need to disable SIP: Reboot to Recovery, in Terminal csrutil disable | |
| # WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars. | |
| # Get active services: launchctl list | grep -v "\-\t0" | |
| # Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents | |
| # List disabled services: launchctl print-disabled user/501 |grep true & launchctl print-disabled system |grep true |
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 ScrollableView<Content: View>: UIViewControllerRepresentable, Equatable { | |
| // MARK: - Coordinator | |
| final class Coordinator: NSObject, UIScrollViewDelegate { | |
| // MARK: - Properties | |
| private let scrollView: UIScrollView | |
| var offset: Binding<CGPoint> |