The hapticFeedback
function can be used like in the following view file, just calling it in the button action and the haptic feedback will be fired when the button is tapped.
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
# This file contains the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
default_platform(:ios) | |
platform :ios do | |
before_all do |lane| | |
sh "sh ./prepare_files.sh" | |
sh "sh ./prepare_simulators.sh" | |
sh("bundle install; bundle exec pod install") |
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 | |
/// Custom fonts | |
enum CustomFont: String { | |
case primary = "Topsicle" | |
case secondary = "SpaceAndAstronomy" | |
case tertiary = "Velezodiac" | |
} |
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 UIStoryboard { | |
// MARK: - Enums | |
/// All the storyboards files names should be added here. | |
/// **Important info:** Under the identity inspector on storyboard file, the storyboard id be the class name. | |
/// | |
/// **Example** | |
/// - `profile` represents the storyboard file *Profile.storyboard* |
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 UIAlertController { | |
struct Settings { | |
var title: String? | |
var message: String? | |
var style: UIAlertController.Style = .alert | |
var interfaceStyle: UIUserInterfaceStyle? | |
var actions: [Action] = [Action()] | |
var target: UIViewController? |
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 UICollectionView { | |
/// Register cell | |
/// - Parameter cell: Cell to be registered | |
public func register(_ cell: UICollectionViewCell.Type) { | |
let nib = UINib(nibName: cell.identifier, bundle: nil) | |
register(nib, forCellWithReuseIdentifier: cell.identifier) | |
} |
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 NSObject { | |
public var identifier: String { | |
String(describing: type(of: self)) | |
} | |
public static var identifier: String { | |
String(describing: 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 FairPlayer: AVPlayer { | |
private let queue = DispatchQueue(label: "com.icapps.fairplay.queue") | |
func play(asset: AVURLAsset) { | |
// Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be | |
// triggered when FairPlay handling is required. | |
asset.resourceLoader.setDelegate(self, queue: queue) | |
// Load the asset in the player. |
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 | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
let storeManager = StoreKitManager() | |
var window: UIWindow? | |
func application(_ application: UIApplication, | |
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
storeManager.setup() |
NewerOlder