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
for family: String in UIFont.familyNames | |
{ | |
print(family) | |
for names: String in UIFont.fontNames(forFamilyName: family) | |
{ | |
print("== \(names)") | |
} | |
} |
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
// GIF creation | |
ffmpeg -ss 00:00:03.000 -i SpendTogether.mp4 -pix_fmt rgb24 -r 10 -s 440x960 -t 00:00:8.000 SpendTogether4.gif | |
ffmpeg -ss 00:00:10.000 -i Expressions.mp4 -pix_fmt rgb24 -r 10 -s 524x1080 -t 00:00:12.000 Expressions1.gif | |
// For optimization | |
convert -layers Optimize SpendTogether2.gif output_optimized.gif | |
// Installation of Tools | |
brew install ffmpeg | |
brew install imagemagick |
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
# This file contains the fastlane.tools configuration | |
# You can find the documentation at https://docs.fastlane.tools | |
default_platform(:ios) | |
platform :ios do | |
desc "Description of what the lane does" | |
lane :metrics do | |
scan(scheme: "testSonar", |
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
# | |
# Swift SonarQube Plugin - Enables analysis of Swift and Objective-C projects into SonarQube. | |
# Copyright © 2015 Backelite (${email}) | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
do { | |
let jsonData = try JSONEncoder().encode(myObjectHere) | |
let json = String(data: jsonData, encoding: .utf8) | |
print(json!) | |
} | |
catch { | |
print(error) | |
} |
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
extension String { | |
func capitalizingFirstLetter() -> String { | |
return prefix(1).capitalized + dropFirst() | |
} | |
func getCamelCasedString () -> String { | |
var camelCasedStringCollection = [String]() | |
let stringComponents = components(separatedBy: " ") | |
for var oneComponent in stringComponents { | |
oneComponent = oneComponent.capitalizingFirstLetter() | |
camelCasedStringCollection.append(oneComponent) |
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
// This test verfies the value of actual string is equal to the epected string | |
func test_behaviorBeingTested_contextItsTestedUnder() { | |
// Given | |
let objectUnderTest = SomeClass() | |
// When | |
objectUnderTest.performSomeAction() | |
let expected: String = "The expected change" | |
let actual: String = objectUnderTest.text | |
// Then | |
XCTAssertEqual(expected, actual) |
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 application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
// Override point for customization after application launch. | |
// Configure Window | |
window?.tintColor = UIColor(red:0.99, green:0.47, blue:0.44, alpha:1.0) | |
return true | |
} |
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
public extension FileManager { | |
static var documentsDirectoryURL: URL { | |
return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first! | |
} | |
} | |
let docUrl = FileManager.documentsDirectoryURL | |
or | |
let docUrl = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false) |
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 randomTasks = ["laundry","Grocery","Rent","Phone bill","Internet Bill","Excercise","Cycling","Cleaning"] | |
let randomNumber = arc4random_uniform(UInt32(randomTasks.count)) |