- You can store a price in a floating point variable.
- All currencies are subdivided in 1/100th units (like US dollar/cents, euro/eurocents etc.).
- All currencies are subdivided in decimal units (like dinar/fils)
- All currencies currently in circulation are subdivided in decimal units. (to exclude shillings, pennies) (counter-example: MGA)
- All currencies are subdivided. (counter-examples: KRW, COP, JPY... Or subdivisions can be deprecated.)
- Prices can't have more precision than the smaller sub-unit of the currency. (e.g. gas prices)
- For any currency you can have a price of 1. (ZWL)
- Every country has its own currency. (EUR is the best example, but also Franc CFA, etc.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The trick is to link the DeviceSupport folder from the beta to the stable version. | |
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :) | |
// Support iOS 14 devices (Xcode 12.0) with Xcode 11.5: | |
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/14.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport | |
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UICollectionView Objective-C example | |
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
NSIndexPath *selectedIndexPath = [[self.collectionView indexPathsForSelectedItems] firstObject]; | |
if (selectedIndexPath != nil) { | |
id<UIViewControllerTransitionCoordinator> coordinator = self.transitionCoordinator; | |
if (coordinator != nil) { | |
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stringly typed 💩 | |
// This throws an Obj-C exception and crashes if you get the name wrong. It would be better if it returned an optional. | |
let bootstrapRootStoryboard = UIStoryboard(name: "BootstrapRoot", bundle: Bundle.main) | |
guard let appKilledViewController = bootstrapRootStoryboard.instantiateViewController(withIdentifier: "appKilledViewController") as? AppKilledViewController else { | |
fatalError("Unexpected viewcontroller for identifier 'appKilledViewController'") | |
} | |
// Strongly typed using SwiftGen 😀 | |
let appKilledViewController = StoryboardScene.BootstrapRoot.instantiateAppKilledViewController() |
//: Playground - noun: a place where people can play
class MyError: Error {}
protocol P {
func throwingFunc() throws -> Int
func nonThrowingFunc() -> Int
}
I hereby claim:
- I am gspiers on github.
- I am gspiers (https://keybase.io/gspiers) on keybase.
- I have a public key whose fingerprint is 6BAB DBDF E67D 3449 FD78 2184 7F33 A838 EE52 6CA4
To claim this, I am signing this object: