internal extension Color {
// Assets.xcassets
static var midnightBlue : Color { Color("midnightBlue", bundle: BundleToken.bundle) }
}
internal extension Image {
// Assets.xcassets
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 | |
protocol ViewModelContainable: View { | |
associatedtype ViewModel : ObservableObject | |
init(model: ViewModel) | |
} | |
// This struct is a direct MVVM alternative to @StateObject in iOS 14 and Mac OS Big Sur. |
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
let stacks = [UserProfileStatsView(), SwitchCompanyView(), SendInvitationToCompanyView(), LogoutButtonView()] | |
stackView.axis = .Vertical | |
stacks.forEach { | |
stackView.addArrangedSubview($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
protocol NibDefinable { | |
var nibName: String { get } | |
} | |
extension NibDefinable { | |
var nibName : String { | |
return String(self.dynamicType) | |
} | |
} |
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
extension UIView { | |
@IBInspectable var cornerRadius: CGFloat { | |
get { return layer.cornerRadius } | |
set { | |
layer.cornerRadius = newValue | |
layer.masksToBounds = newValue > 0 | |
} | |
} | |
@IBInspectable var borderWidth: CGFloat { |
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
before_all do | |
cocoapods | |
scan | |
end | |
# Increment build number to current date | |
lane :set_build_number do | |
increment_build_number( | |
build_number: Time.new.strftime("%Y.%m.%d.%H%M") | |
) |
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
// Returns number of seconds passed between time when process was created and function was called | |
func measureAppStartUpTime() -> Double { | |
var kinfo = kinfo_proc() | |
var size = MemoryLayout<kinfo_proc>.stride | |
var mib : [Int32] = [CTL_KERN, KERN_PROC, KERN_PROC_PID, getpid()] | |
sysctl(&mib, u_int(mib.count), &kinfo, &size, nil, 0) | |
let start_time = kinfo.kp_proc.p_starttime | |
var time : timeval = timeval(tv_sec: 0, tv_usec: 0) | |
gettimeofday(&time, nil) | |
let currentTimeMilliseconds = Double(Int64(time.tv_sec) * 1000) + Double(time.tv_usec) / 1000.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
#!/bin/bash | |
f=$(pwd) | |
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork" | |
sips --resampleWidth 1024 "${f}/${1}" --out "${f}/iTunesArtwork@2x" | |
sips --resampleWidth 20 "${f}/${1}" --out "${f}/Icon-20.png" | |
sips --resampleWidth 40 "${f}/${1}" --out "${f}/[email protected]" | |
sips --resampleWidth 60 "${f}/${1}" --out "${f}/[email protected]" |
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 | |
import UIKit | |
protocol NibDefinable { | |
var nibName: String { get } | |
} | |
extension NibDefinable { | |
var nibName : String { | |
return String(self.dynamicType) |
NewerOlder