iOS: Settings ▸ General ▸ Keyboard ▸ Shortcuts
macOS: System Preferences ▸ Keyboard ▸ Text (drag them to Desktop or drag plist on the table)
:)
🙂:D
😄 – The most used.;)
😉
import UIKit | |
import CoreText | |
extension UIFont { | |
typealias Feature = (type: Int, selector: Int) | |
struct Features { | |
static var ProportionalNumbers: Feature = (kNumberSpacingType, kProportionalNumbersSelector) | |
static var AlternatePunctuation: Feature = (kCharacterAlternativesType, 1) // Magic! | |
} |
// Macros for creating NSArray and NSSet objects as replacement for @[…] literal. | |
let components = NSArray(street, city, state, country); | |
// Advantages: | |
// 1. Type of NSArray is inferred, in this case it’s NSArray<NSString *> * | |
// 2. List of objects is type-checked, so mixing types like NSArray(@42, @"Hi") will report compilation error. | |
// 3. Ability to allocate any class, not just NSArray. For example NSSet and NSMutableArray. | |
// 4. Avoids stupid clang bracket matching bug, if you know what I mean. |
// The Unlicense (https://unlicense.org) | |
- (NSString *)guessName { | |
unsigned char redComponent = roundf(self.redComponent*4); | |
unsigned char greenComponent = roundf(self.greenComponent*4); | |
unsigned char blueComponent = roundf(self.blueComponent*4); | |
// Component methods implemented below. | |
static NSString * const black = @"black"; | |
static NSString * const red = @"red"; |
iOS applications are usually built with MVC (Model – View – Controller) architecture, which introduces very important concept of separating actual data (Model Layer) and their presentation (View Layer), while the application logic (Controller Layer) stands between them.
View ← Controller → Model
With MVC you typically write most of the code in UIViewController
, which usually represents the Controller Layer. View Layer can be easily done in Interface Builder and Model Layer usually doesn’t need a lot of code. The UIViewControleler
then holds strong references to both View and Model objects and is responsible for setting them up, handling actions and listening to events.
The problem is, that this middle layer tends to hold too much code and this situation is then jokingly called Massive View Controller. When a single class sets up views, formats data values, handles user input and actions, listens for a bunch of notif
- (NSMutableData *)mutableRGBAData { | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGSize scaledSize = (CGSize){ | |
.width = self.size.width * self.scale, | |
.height = self.size.height * self.scale, | |
}; | |
NSUInteger const bytesPerPixel = 4; | |
NSUInteger const bitsPerComponent = 8; |
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])providedBuffer count:(NSUInteger)providedLength { | |
// If this is not first invocation, finish by returning 0. | |
if (state->state != 0) { | |
return 0; | |
} | |
let count = CFBinaryHeapGetCount(self->_underlayingHeap); | |
// We are empty. | |
if (count == 0) { | |
return 0; |
#import <Foundation/Foundation.h> | |
@interface Node : NSObject <NSCoding> | |
@property NSString *name; | |
@property NSMutableArray<Node *> *targets; | |
@end |
@import Foundation; | |
@interface NSObject (ThreadSafeProxy) | |
- (instancetype)threadSafe; | |
@end | |
I ask for repeated approval of version 4.6.1, since it was rejected for features that were previously approved in 4.6.
Version 4.6 added feature that changes app icon based on user’s location. I wrote explanation of this feature in Review Notes and this version was approved by your team. (Full text of Review Notes is embedded at the end.)
Version 4.6.1 didn’t make any changes to previously approved features, it only fixed improtant bugs and improved several UI elements. No change in app icon management was made, but this time, the app was rejected for way it approaches Alternate Icons.
This inconsistency in decisions of App Review Team is troubling for me, because I got two distinct results from submitting basically the same app. Process of reviewing new submissions should take into account previous versions of the app.
Also related, my previous submission of version 4.6.1 was rejected by asking for information which was provided in Review Notes of previous update. I don’t think that should happen. When