Skip to content

Instantly share code, notes, and snippets.

View AnthonyBY's full-sized avatar

Anton Marchanka AnthonyBY

View GitHub Profile
@rbrovko
rbrovko / FileNotebookTests.swift
Last active July 1, 2019 16:58
iOS Unit tests for task#3 (Test target - NoteTests.swift) or Playground
//
// FileNotebookTests.swift
// NoteTests
//
// Created by Roman Brovko on 6/19/19.
// Copyright © 2019 Roman Brovko. All rights reserved.
//
import XCTest
@testable import Note
@lfarah
lfarah / AwesomeiOSWeekly03.md
Last active October 19, 2017 11:05
AwesomeiOSWeekly03

AwesomeiOS.Weekly [03]

Announcements

We just hit the 150 subscribers mark🚀🙌 We had a lot of people asking if they could see the past issues, so while the website is not finished, we created this gist that will serve as our website for now.

Wanna see your library here? Send us an email!

Here are the 10 awesome libraries of the week:

@zyrx
zyrx / CopyableLabel.swift
Last active March 11, 2020 14:21
Make UILabel Copyable in Swift 3. Special thanks to Stephen Radford and his "Make UILabel Copyable in Swift" article http://stephenradford.me/make-uilabel-copyable/
//
// CopyableLabel.swift
//
// Created by Lech H. Conde on 01/11/16.
// Copyright © 2016 Mavels Software & Consulting. All rights reserved.
//
import UIKit
class CopyableLabel: UILabel {
import Foundation
/**
Counts the number of inversions on the given array.
- Returns: the number of the inversions.
*/
func countInversions(arr:[Int]) -> Int {
guard arr.count > 1 else {return 0}
let middle: Int = Int(ceil(Double(arr.count/2)))
let left: [Int] = Array(arr[0..<arr.count/2])
@marianolatorre
marianolatorre / HackerRank-30-dictionaries-and-maps.swift
Last active May 25, 2019 13:08
30 days of code: day 8 dictionaries and maps in SWIFT2
import Foundation
func telephones(input : String) {
var map = [String : String]()
let newlineChars = NSCharacterSet.newlineCharacterSet()
let spaceLineChars = NSCharacterSet.whitespaceCharacterSet()
let allLines = input.utf16.split { newlineChars.characterIsMember($0) }.flatMap(String.init)
guard allLines.count > 0 else{
@mmorey
mmorey / .gitignore
Last active November 9, 2018 16:20 — forked from adamgit/.gitignore
.gitignore file for Xcode5
#########################
# .gitignore file for Xcode5
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
# and https://gist.github.com/adamgit/3786883