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
extension UISearchBar { | |
public var textField: UITextField? { | |
if #available(iOS 13, *) { | |
return searchTextField | |
} | |
let subViews = subviews.flatMap { $0.subviews } | |
guard let textField = (subViews.filter { $0 is UITextField }).first as? UITextField else { | |
return nil | |
} | |
return textField |
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
- (void)layoutSubviews{ | |
[super layoutSubviews]; | |
[UIView beginAnimations:nil context:NULL]; | |
[UIView setAnimationBeginsFromCurrentState:YES]; | |
[UIView setAnimationDuration:0.0f]; | |
for (UIView *subview in self.subviews) { |
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 | |
import WidgetKit | |
@available(iOS, deprecated: 18.0, message: "use WidgetAccentedRenderingMode instead") | |
enum BackdeployedWidgetAccentedRenderingMode { | |
case accented | |
case accentedDesaturated | |
case desaturated | |
case fullColor | |
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 | |
import WidgetKit | |
@available(iOS, deprecated: 18.0, message: "use WidgetAccentedRenderingMode instead") | |
enum BackdeployedWidgetAccentedRenderingMode { | |
case accented | |
case accentedDesaturated | |
case desaturated | |
case fullColor | |
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
func isConnectedToVpn() -> Bool { | |
let host = "www.example.com" | |
guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { | |
return false | |
} | |
var flags = SCNetworkReachabilityFlags() | |
if SCNetworkReachabilityGetFlags(reachability, &flags) == false { | |
return false | |
} | |
let isOnline = flags.contains(.reachable) && !flags.contains(.connectionRequired) |
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
.cproject | |
.project | |
build |
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
let defaultFontSizeTable = [ | |
UIFontTextStyleHeadline: [ | |
UIContentSizeCategoryAccessibilityExtraExtraExtraLarge: 26, | |
UIContentSizeCategoryAccessibilityExtraExtraLarge: 25, | |
UIContentSizeCategoryAccessibilityExtraLarge: 24, | |
UIContentSizeCategoryAccessibilityLarge: 24, | |
UIContentSizeCategoryAccessibilityMedium: 23, | |
UIContentSizeCategoryExtraExtraExtraLarge: 23, | |
UIContentSizeCategoryExtraExtraLarge: 22, | |
UIContentSizeCategoryExtraLarge: 21, |
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
#!/bin/bash | |
# This script downloads and builds the iOS, tvOS and Mac openSSL libraries with Bitcode enabled | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |
# https://gist.github.com/foozmeat/5154962 | |
# Peter Steinberger, PSPDFKit GmbH, @steipete. | |
# Felix Schwarz, IOSPIRIT GmbH, @felix_schwarz. |
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
#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__ | |
#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1 | |
/** compatibility header for endian.h | |
* This is a simple compatibility shim to convert | |
* BSD/Linux endian macros to the Mac OS X equivalents. | |
* It is public domain. | |
* */ | |
#ifndef __APPLE__ |
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
// StickyHeadersCollectionViewFlowLayout | |
// | |
// A subclass of UICollectionViewFlowLayout which has UITableView style sticky headers. | |
// | |
// This code is based on Evadne Wu's code^1, with the following changes: | |
// | |
// * Fixes a crash for sections with zero items | |
// * Adds support for UIScrollView's contentInset | |
// * Adds support for UICollectionViewFlowLayout's sectionInset | |
// |
NewerOlder