How to zoom scroll Mac

Leave a comment

My buddy Dan showed me this cool trick for two finger zooming on the mac.

Open Accessibility in Preferences and select Zoom, then Use scroll gesture with modifier.

Screen Shot 2018-12-07 at 9.28.41 AM.png

Now when you see something you want to zoom into on the screen, hold down control, x2 finger swipe up, and move the mouse around and you will zoom!

Cool. Thx Dan.

Advertisements

Trouble Installing Link Conditioner

Leave a comment

With the latest Mojave upgrade, Link Conditioner wasn’t installing correctly. You would follow instructions that would normally work like this

https://nshipster.com/network-link-conditioner/

Only do have it disappear in the System Preferences after using it once.

My buddy Dan showed me the fix. First remove the link conditioner from your personally library preference pane like this

cd 
cd Library/PreferencePanes
rm -rf Network\ Link\ Conditioner.prefPane

Then manually install it in the machine preference by doing this

open /Library/PreferencePanes

And then manually dragging the icon from the Xcode package you downloaded

Screen Shot 2018-10-31 at 3.03.23 PM.png

Into the preference pain you just opened

Screen Shot 2018-10-31 at 3.03.30 PM.png

Once done, the conditioner should show up/and stay in your System Preferences.

Screen Shot 2018-10-31 at 3.06.19 PM.png

Thanks Dan!

How to find large files

Leave a comment

du -a . | sort -n -r | head -n 10
find . -size +100k 

du will show file size by dir
find will show all files over a certain size

How to serve up files locally from your Mac via a webserver

Leave a comment

Colleague Dan showed me this neat trick for serving up local files in your Android device as a way of getting access to self-signed certs.

# Simple web server for the local directory
alias webserver='python -m SimpleHTTPServer 8000'

How to add UI Automation test to existing Xcode project

Leave a comment

Create a new project.

Add a new target by hitting the ‘+’ sign near the bottom.

Screen Shot 2018-10-18 at 1.37.17 PM

Add iOS UI Testing Bundle

Screen Shot 2018-10-18 at 1.37.53 PM

Edit your scheme

Screen Shot 2018-10-18 at 1.39.38 PM

Confirm at testing bundle was added

Screen Shot 2018-10-18 at 1.39.50 PM

Open up your test

Screen Shot 2018-10-18 at 1.41.50 PM

And insert a break point

Screen Shot 2018-10-18 at 1.41.56 PM

Run your test. Hit record and Xcode will record your application press.

Screen Shot 2018-10-18 at 1.47.41 PM

Add accessibility to your buttons and controls like this

    let button: UIButton = {
        let button = UIButton()
        button.translatesAutoresizingMaskIntoConstraints = false
        button.backgroundColor = .green
        button.setTitle("GOT IT", for: .normal)
        button.setTitleColor(.black, for: .normal)
        button.addTarget(self, action: #selector(buttonPressed), for: .touchUpInside)

        button.accessibilityIdentifier = "gotItButton"

        return button
    }()

Sample test

    func testExample() {
        // Use recording to get started writing UI tests.
        // Use XCTAssert and related functions to verify your tests produce the correct results.

        XCUIApplication().buttons["GOT IT"].tap()
        XCTAssertTrue(XCUIApplication().buttons["gotItButton"].waitForExistence(timeout: 10))
    }

How to automate svg to pdf automator

Leave a comment

My buddy Dan Drzimotta showed me a really cool way to convert any svg to pdf using the following tools.

First install the svg2pdf library.

> brew install svg2pdf

Setup Automator

Then startup automator and create the following script.

Screen Shot 2018-09-11 at 11.01.52 AM.png

Screen Shot 2018-09-11 at 11.01.57 AM.png

Screen Shot 2018-09-11 at 11.02.10 AM.png

Save this (i.e. svg2pdf). Then find a svg file in your finder and convert it by right clicking on it. You will now have a pdf output into that directory.

Import into Xcode

Xcode will now scale pdfs to various resolutions. To use a pdf as an image asset drag it into your assets folder and make the following changes on the image in the inspector.

Screen Shot 2018-09-11 at 10.48.58 AM.png

Screen Shot 2018-09-11 at 10.49.18 AM.png

How to add navigation items to the Navigation Bar iOS

1 Comment

When you embed your root viewController into a NavigationController, your sub ViewControllers automatically get a title bar. But they don’t get any Nav bar items.

Screen Shot 2018-07-16 at 6.45.06 AM.png

To add something like a Welcome button for back navigation drag out a Navigation Item

Screen Shot 2018-07-16 at 6.45.26 AM.png

And drop it into the middle of the navbar. Same for a button. Only a NavBar button is different than a Navigation item. It looks like this.

Screen Shot 2018-07-16 at 6.45.31 AM.png

Drag this to the upper right hand corner of the nav bar and it should be OK.

Older Entries

%d bloggers like this: