This file contains hidden or 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
| let path = Bundle.main.path(forResource: "foo", ofType: "json") | |
| let data: NSData? = try? NSData(contentsOfFile: path!, options: .uncached) |
This file contains hidden or 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
| #lang racket | |
| (/ (+ 5 4 | |
| (- 2 | |
| (- 3 | |
| (+ 6 | |
| (/ 4 5))))) | |
| (* 3 | |
| (- 6 2) | |
| (- 2 7))) |
This file contains hidden or 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
| import UIKit | |
| for fn in UIFont.familyNames { | |
| for font in UIFont.fontNames(forFamilyName: fn) { | |
| print("font: \(font)") | |
| } | |
| } |
This file contains hidden or 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
| #import "UserDefaultsUtility.h" | |
| @implementation UserDefaultsUtility | |
| /** | |
| ユーザデフォルトに設定したオブジェクトを取得する | |
| */ | |
| + (id) objectForKey:(NSString*) key { | |
| NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; | |
| NSData *encodedObject = [userDefaults objectForKey:key]; |
This file contains hidden or 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
| func fizzBuzz(num: Int) -> String { | |
| switch num { | |
| case _ where num % 15 == 0: | |
| return "FizzBuzz" | |
| case _ where num % 3 == 0: | |
| return "Fizz" | |
| case _ where num % 5 == 0: | |
| return "Buzz" | |
| default: | |
| return num.description |
NewerOlder