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 String { | |
func stringsBetween(fromTag: String, and toTag: String) -> [String]? { | |
let fromTagLen = countElements(fromTag) | |
let toTagLen = countElements(toTag) | |
var strings: [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
extension UIApplication { | |
class func appVersion() -> String { | |
return Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as! String | |
} | |
class func appBuild() -> String { | |
return Bundle.main.object(forInfoDictionaryKey: kCFBundleVersionKey as String) as! 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
@implementation UIApplication (AppVersion) | |
+ (NSString *) appVersion | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]; | |
} | |
+ (NSString *) build | |
{ | |
return [[NSBundle mainBundle] objectForInfoDictionaryKey: (NSString *)kCFBundleVersionKey]; |
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
struct TabRectsKey: PreferenceKey { | |
static var defaultValue: [Int: CGRect] = [:] | |
static func reduce(value: inout [Int : CGRect], nextValue: () -> [Int : CGRect]) { | |
value.merge(nextValue(), uniquingKeysWith: { r1, r2 in r1 }) | |
} | |
} | |
struct TabBar: View { | |
var items: [(Image, Text)] | |
@State var selectedIndex: Int = 0 |