Category: Programming

Getting Started with CocoaPods

Installation make sure the ruby system is up to date $ sudo gem update –system install cocoapods $ sudo gem install cocoapods If you get an error message about fuzzy_match, try this command instead, $ sudo gem install -n /usr/local/bin cocoapods setup the pods $ pod setup To Test / use cocoa pods Create a […]

Detecting iPad or iPhone in swift

To detect if the user is using an iPad or iPhone or something else in Swift do something like this: switch UIDevice.current.userInterfaceIdiom { case .phone: deviceLavel.text = “iPhone” case .pad: deviceLavel.text = “iPad” case .unspecified: deviceLavel.text = “unspecified” case .tv: deviceLavel.text = “tv” case .carPlay: deviceLavel.text = “carPlay” }

How to record an App Preview

1. Connect your iPhone or iPad to you Mac 2. Open Quick Time Player 3. From the File menu, Choose new Movie recording 4. Fromt the drop down next to the record button choose you iphone/ipad for video and microphone 5. Click record 6. Do steps 7. Click Stop 8. File | Save 9. Add […]

Optionals in Swift 3

Swift Optionals A type the either has a “wrapped” value or is nil. e.g. let imagePaths = [“star”: “/glyphs/star.png”,”portrait”: “/images/content/portrait.jpg”,”spacer”: “/images/shared/spacer.gif”] Getting a dictionary’s value using a key returns an optional value, so imagePaths[“star”] has the type String? e.g. if let imagePath = imagePaths[“star”] { print(“The star image is at ‘(imagePath)'”) } else { print(“Couldn’t […]

Next Page »