Show Only Apps in Search Results, iOS 11


Posted on September 30th, 2017
Optional Block Parameters and Fix-Its

Posted on September 19th, 2017
Enabling Command-Line Pipe for Atom on OS X

2018-02-15: Update
Posted on September 12th, 2017
Breakpoint Swift Deinit in Xcode

- If there is no body to your deinit method, the breakpoint will not fire (it gets optimized out or something similar).
- There is no difference in syntax, for the Xcode symbolic breakpoints, between class and instance methods.
- There are no deinit methods for structs, so your SOL on that one.
Posted on September 12th, 2017
Swift 3.x Calls Objective-C
Posted on September 8th, 2017
Swift and Object-C Interop, Simplest Possible Example
Start with a Single View App (Swift) in Xcode 9 Beta 6 called SwiftObjCInterop
.
Swift Calls Objective-C
Create an Objective-C Class
Create an Objective-C class called ObjCObject
This will automatically give you the Bridging Header to call the Objective-C from Swift (that was easy!):
Select Create Bridging Header which will produce the file SwiftObjCInterop-Bridging-Header
Add a Method to ObjCObject
Add a method like this in your .m file
- (void) test {
NSLog(@"Yes we are ObjCObject and we are testing");
}
and this in your .h
- (void) test;
Add ObjCObject to your Bridging Header
#import "ObjCObject.h"
Test Swift Calls Objective-C
Put this in your viewDidLoad
:
ObjCObject().test()
Run the project. Now Swift calls Objective-C.
Objective-C Calls Swift
This is slightly trickier in an existing project, but in a new project there are no issues.
Include this in your ViewController.swift
file:
@objc(testSwift)
func testSwift() {
print("yes ViewController is printing")
}
For some reason, you need the @objC
tag to be able to see your method from Objective-C.
Include this import in your .m file:
#import "SwiftObjCInterop-Swift.h"
And add this to your test
method in your Objective-C class:
ViewController *vc = [[ViewController alloc] init];
[vc testSwift];
That's it.
Posted on September 5th, 2017
Using Markdown with Postach.io
Hello World!!!
This HTML is highlighted with Prism using code marks for the highlighting like language-html
<!DOCTYPE html>
<html>
<head>
...
<link href="themes/prism.css" rel="stylesheet" />
</head>
<body>
...
<script src="prism.js"></script>
</body>
</html>
Why Bother?
I do love my work on code highlighting in Evernote. But this markdown stuff may be cooler? Hard to decide. With Markdown, it's definitely more flexible to pop out to a text editor and then back in.
[Testing edit from iPad... just added this]
Are there extra lines or not?
let stringSet = Set(["car", "boat", "bike", "toy"])
let stringArray = stringSet.sorted()
print(stringArray)
// will print ["bike", "boat", "car", "toy"]
Okay, the extra lines are only there if you switch the format using Make Plain Text. Do NOT use Make Plain Text, and always use Simplify Formatting

What About Embeds?
Will Postachio deal with the embeds, still?
[So this embed got removed because I edited this note on iPad... so that's an issue. Maybe a big issue?]
OMG that's absolutely awesome. Which means you could also do iframes and probably even random html.
Posted on August 21st, 2017
Lazy Array in Swift
Posted on August 19th, 2017
Method Selection in Swift
Posted on August 19th, 2017
Code Blocks in Postachio
Posted on August 17th, 2017