Short (72 chars or less) summary
More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).
Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
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
// Advanced SwiftUI Transitions | |
// https://swiftui-lab.com | |
// https://swiftui-lab.com/advanced-transitions | |
import SwiftUI | |
struct CrossEffectDemo: View { | |
let animationDuration: Double = 2 | |
let images = ["photo1", "photo2", "photo3", "photo4"] | |
@State private var idx = 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
# Swift syntax highlighting for Vim | |
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/ | |
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim | |
# More about Vim packages: http://vimcasts.org/episodes/packages/ | |
echo "--- creating ~/.vim/pack/bundle/start dir.." | |
mkdir -p ~/.vim/pack/bundle/start | |
echo "--- Cloning Apple's Swift repo.." |
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 Color { | |
// MARK: - Text Colors | |
static let lightText = Color(UIColor.lightText.cgColor) | |
static let darkText = Color(UIColor.darkText.cgColor) | |
static let placeholderText = Color(UIColor.placeholderText.cgColor) | |
// MARK: - Label Colors |
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
// | |
// UIImage+PDF.swift. Copyright © 2016 Nigel Timothy Barber (@mindbrix). All rights reserved. | |
// | |
import UIKit | |
extension UIImage { | |
static func PDFImageWith(_ url: URL, pageNumber: Int, width: CGFloat) -> UIImage? { | |
return PDFImageWith(url, pageNumber: pageNumber, constraints: CGSize(width: width, height: 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
UIDevice *myDevice = [UIDevice currentDevice]; | |
[myDevice setBatteryMonitoringEnabled:YES]; | |
NSLog(@"%f", myDevice.batteryLevel); |
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
// not for app store apps, 'cause wil be rejected !!! | |
// can be useful for in-house development needs | |
UIApplication *app = [UIApplication sharedApplication]; | |
[app performSelector:@selector(suspend)]; | |
// wait two seconds while app is going to background | |
[NSThread sleepForTimeInterval:2.0]; | |
// when exit app when it is in background |