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
https://storage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerJoyrides.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerMeltdowns.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/Sintel.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/SubaruOutbackOnStreetAndDirt.mp4 | |
https://storage.googleapis.com/gtv-videos-bucket/sample/TearsOfSteel.mp4 |
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 'package:flutter/cupertino.dart'; | |
import 'package:get/get.dart'; | |
import 'package:webview_player/shorts_player.dart'; | |
void main() { | |
runApp(App()); | |
} | |
class ShortsPlayerController implements IShortsPlayerController { | |
@override |
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 UIKit | |
extension UIBezierPath: Chainable {} | |
extension Chain where T: UIBezierPath { | |
func move(to point: CGPoint) -> Chain { | |
origin.move(to: point) | |
return self | |
} |
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
class System { | |
func openAppSetting() { | |
if let bundleId = Bundle.main.bundleIdentifier, | |
let settingUrl = URL(string: UIApplication.openSettingsURLString + bundleId), | |
UIApplication.shared.canOpenURL(settingUrl) { | |
UIApplication.shared.open(settingUrl, options: [:]) { _ in } | |
} | |
} | |
func isSystemPushAllowed(completion: @escaping (Bool) -> Void) { |
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 | |
private func filename(_ path: String) -> String { | |
guard let filename = path.split(separator: "/").last else { return path } | |
return String(filename.prefix(upTo: filename.index(filename.endIndex, offsetBy: -6))) | |
} | |
private func functionName(_ function: String) -> String { | |
guard let functionName = function.split(separator: "(").first else { return function } | |
return String(functionName) |
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 UIKit | |
@IBDesignable extension UIView { | |
@IBInspectable public var borderColor: UIColor? { | |
get { | |
if let color = layer.borderColor { | |
return UIColor(cgColor: color) | |
} else { | |
return nil | |
} |
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 UIKit | |
extension UIColor { | |
convenience init(red: Int, green: Int, blue: Int, a: Int = 255) { | |
assert(red >= 0 && red <= 255, "Invalid red component") | |
assert(green >= 0 && green <= 255, "Invalid green component") | |
assert(blue >= 0 && blue <= 255, "Invalid blue component") | |
self.init( | |
red: CGFloat(red) / 255.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
import Foundation | |
extension Int { | |
public func decimal() -> String { | |
let numberFormatter = NumberFormatter() | |
numberFormatter.numberStyle = NumberFormatter.Style.decimal | |
return numberFormatter.string(from: NSNumber(value: self))! | |
} | |
public func currencyKRW() -> String { |
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 | |
extension JSONDecoder { | |
static func decodeFromString<T: Decodable>(_ type: T.Type, from: String) -> T? { | |
guard let data = from.data(using: .utf8) else { return nil } | |
return try? JSONDecoder().decode(type, from: data) | |
} | |
} | |
extension JSONEncoder { |
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 UIKit | |
let screenSize = UIScreen.main.bounds.size | |
let screenWidth = screenSize.width | |
let screenHeight = screenSize.height | |
let statusHeight: CGFloat = { | |
guard let window = UIApplication.shared.keyWindow else { | |
return 0 | |
} |
NewerOlder