- read this first: https://www.webkit.org/blog/3476/content-blockers-first-look/
- start by adding a new extension target to your iOS app of type “content blocker”
- launch the app using the main target’s scheme + a call to
SFContentBlockerManager.reloadContentBlockerWithIdentifier()with the extension’s id inapplication:didFinishLaunchingWithOptions:to auto-reload the blocker in development mode - if you don’t call
reloadContentBlockerWithIdentifier()then you need to switch the blocker off and on again in the Safari settings (stop the app in Xcode if the switch is not moving) - use inspector from desktop Safari to inspect the Safari in the simulator in order to find specific things to block
- things like periods in the
url-filterregexp need to be escaped with double backslashes, e.g.facebook\\.net - if you use
if-domain, it needs to be an array, even for one element - domain
foo.commight not matchwww.foo.comeven though I think it’s supposed to (UPDATE: They've changed it in one of
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Bucket | |
| type = "2" | |
| version = "2.0"> | |
| <Breakpoints> | |
| <!-- All Exceptions --> | |
| <BreakpointProxy | |
| BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
| <BreakpointContent |
| a: AM/PM | |
| A: 0~86399999 (Millisecond of Day) | |
| c/cc: 1~7 (Day of Week) | |
| ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
| cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
| d: 1~31 (0 padded Day of Month) | |
| D: 1~366 (0 padded Day of Year) | |
Core Animation's original name is Layer Kit
Core Animation is a compositing engine; its job is to compose different pieces of visual content on the screen, and to do so as fast as possible. The content in question is divided into individual layers stored in a hierarchy known as the layer tree. This tree forms the underpinning for all of UIKit, and for everything that you see on the screen in an iOS application.
In UIView, tasks such as rendering, layout and animation are all managed by a Core Animation class called CALayer. The only major feature of UIView that isn’t handled by CALayer is user interaction.
There are four hierarchies, each performing a different role:
- view hierarchy
- layer tree
| // Created by Tony Mann on 3/22/15. | |
| // Copyright (c) 2015 7Actions. All rights reserved. | |
| // | |
| // Adapted from http://ossh.com.au/design-and-technology/software-development/implementing-rich-text-with-images-on-os-x-and-ios/ | |
| import UIKit | |
| class ImageAttachment: NSTextAttachment { | |
| var verticalOffset: CGFloat = 0.0 | |
A lot is being written these days about ReactiveCocoa and the paradigms it introduces. In my opinion, there are only two sides giving their opinion: the ones that know a lot about it and are therefore obviously biased, and the ones that refuse to learn it.
I decided to write something myself because I think I'm right in the middle. Some months ago I knew nothing about it, and now I know enough to want to use it every day. I hope that by not being an expert, I can actual introduce a few really simple ideas in a much easier way to pick up by new-commers, to show why I think ReactiveCocoa is an incredibly powerful tool to help us write better, cleaner, and more maintainable code.
The base of everything that happens in ReactiveCocoa is signals. I'm going to try to explain what they represent and why they fit in the way we think about what happens on an app. A lot of the things you may read about Functional Reactive Programming end up confusing you when
Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.
If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.
http://www.apple.com/osx/elcapitan-preview/
- split view - two apps side by side on full screen
##Xcode Locations
###Xcode Provisioning Profiles:
~/Library/MobileDevice/Provisioning\ Profiles
###Xcode Font and Color Schemes:
~/Library/Developer/Xcode/UserData/FontAndColorThemes
| // | |
| // UIView+Orientation.h | |
| // | |
| #import <UIKit/UIKit.h> | |
| // These macros should only be used if you MUST know the interface orientation for the device itself, for example when displaying a new UIWindow. | |
| // This should be very rare; generally you should only look at the immediate parent view's size (or "view orientation" using the category below). | |
| #define StatusBarOrientationIsPortrait UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]) | |
| #define StatusBarOrientationIsLandscape UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]) |
| @interface ApplicationDelegate<UIApplicationDelegate> | |
| @end | |
| @implementation ApplicationDelegate | |
| - (RACSignal *)rac_registeredForRemoteNotifications { | |
| RACSignal *signal = objc_getAssociatedObject(self, _cmd); | |
| if (signal != nil) return signal; | |
| RACSignal *didRegisterForRemoteNotification = [[self rac_signalForSelector: @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:) fromProtocol: @protocol(UIApplicationDelegate)] map: ^(RACTuple *tuple) { | |
| return tuple.second; |