Sometimes we need to open Setting's Preferences not of our app, but of the iPhone itself. What should we do to acomplish this?
[UPDATE: Added Wallet And Apple Pay below]
[UPDATE: Changed prefs for Bluetooth]
| // | |
| // IPInsetLabel.h | |
| // Instapaper | |
| // | |
| // Created by Marco Arment on 7/23/11. | |
| // Copyright 2011 Instapaper LLC, released to the public domain. | |
| // | |
| #import <UIKit/UIKit.h> |
| if pgrep "iOS Simulator"; then | |
| killall "iOS Simulator" | |
| fi | |
| if pgrep "Xcode"; then | |
| killall "Xcode" | |
| fi | |
| xcrun simctl list | awk -F "[()]" '{ for (i=2; i<NF; i+=2) print $i }' | grep '^[-A-Z0-9]*$' | xargs -I uuid xcrun simctl erase uuid | true | |
| echo $? |
| //This is xxx.h | |
| /* | |
| //#import <ifaddrs.h> | |
| //#import <arpa/inet.h> | |
| @interface TKUWiFiInformation : NSObject | |
| - (NSString *)getIPAddress; | |
| @end |
| #!/bin/sh | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # Set the colours you can use | |
| black='\033[0;30m' | |
| white='\033[0;37m' | |
| red='\033[0;31m' |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Bucket | |
| type = "2" | |
| version = "2.0"> | |
| <Breakpoints> | |
| <!-- All Exceptions --> | |
| <BreakpointProxy | |
| BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
| <BreakpointContent |
| #!/usr/bin/env ruby | |
| search_dir = ARGV[0] || "." | |
| files = Dir.glob("#{search_dir}/**/*.{h,m,swift}") | |
| if files.length > 0 | |
| puts "Found the following header or implementation files in '#{search_dir}':" | |
| files.each do |filepath| | |
| puts filepath |
| + (UIImage *)decompressedImageWithImage:(UIImage *)image resizeTo:(CGSize)targetSize | |
| { | |
| CGImageRef imageRef = image.CGImage; | |
| CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
| CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); | |
| BOOL sameSize = NO; | |
| if (CGSizeEqualToSize(targetSize, CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)))) { | |
| targetSize = CGSizeMake(1, 1); | |
| sameSize = YES; | |
| } |
Draw a mask image like Left-3 to blend a rounded corner:
func UIGraphicsDrawAntiRoundedCornerImageWithRadius(radius: CGFloat, outerSize: CGSize, innerSize: CGSize, fillColor: UIColor) -> UIImage{
UIGraphicsBeginImageContextWithOptions(outerSize, false, UIScreen.mainScreen().scale)
let currentContext = UIGraphicsGetCurrentContext()
let bezierPath = UIBezierPath()
| extension UIViewController { | |
| func rz_smoothlyDeselectRows(tableView tableView: UITableView?) { | |
| let selectedIndexPaths = tableView?.indexPathsForSelectedRows ?? [] | |
| if let coordinator = transitionCoordinator() { | |
| coordinator.animateAlongsideTransitionInView(parentViewController?.view, animation: { context in | |
| selectedIndexPaths.forEach { | |
| tableView?.deselectRowAtIndexPath($0, animated: context.isAnimated()) | |
| } |