Parsing URL Parameters with Swift
Here is an extension you can use in your Swift (v4) projects that makes it easy to parse parameters from a url.
Given a url like, "http://example.com/?x=1&y=2", you can extract the x and y parameters into a key, value data structure.
Here is the s...
Written by Sean Behan on 09/23/2018
How to Dynamically Call a Method from a String in Swift
You have to subclass NSObject
class Car : NSObject {
func drive(){
print("Driving..")
}
}
let car : Car = Car()
car.perform(NSSelectorFromString("drive"))
Written by Sean Behan on 06/09/2018
How to Check if Your iOS or MacOS App is Connected to the Internet
Is your app connected to the internet? You can use this standalone class to check! There are no dependencies so you can copy/paste it into your project without needing to install another framework.
With this class it's as simple as running `Reachabili...
Written by Sean Behan on 06/08/2018
How to Flush or Erase Cache of Your XCode iOS or MacOS Cocoa App
If you're working with an XCode application, either iOS or MacOS, and want to do a completely clean build and delete the cache, it's simple.
Execute this command from the command line..
defaults delete your.apps.bundle.id
Where "your.apps.bundl...
Written by Sean Behan on 06/08/2018
How to Find the Directory Locations Your XCode App Uses
You can add this snippet to your application, say for instance in your `viewDidLoad` function, that will print to the XCode console, the location of your app while it's being developed.
// prints the location of asset my-added-file.txt that you've ad...
Written by Sean Behan on 06/06/2018
How to Fix xcrun: error: unable to find utility "instruments", not a developer tool or in PATH
I just got a new machine and downloaded XCode. I used git to clone my ReactNative project from Github. I have everything ready to go. But when I run `react-native run-ios` I see
xcrun: error: unable to find utility "instruments", not a developer tool ...
Written by Sean Behan on 03/05/2017
Installing Ruby with RVM without Xcode using CLANG
I am not using the full Xcode package on my laptop. Instead I'm using the command line tools, offered by Apple as a separate and much smaller install. I haven't had too many issues, aside from not being able to use the FileMerge program that ships with ...
Written by Sean Behan on 06/24/2012