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
| # delete local tag '12345' | |
| git tag -d 12345 | |
| # delete remote tag '12345' (eg, GitHub version too) | |
| git push origin :refs/tags/12345 | |
| # alternative approach | |
| git push --delete origin tagName | |
| git tag -d tagName |
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
| exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 | |
| UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal | |
| if [ "true" == ${ALREADYINVOKED:-false} ] | |
| then | |
| echo "RECURSION: Detected, stopping" | |
| else | |
| export ALREADYINVOKED="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
| import Foundation | |
| import UIKit | |
| public enum ModelType: String { | |
| case iPhone4 | |
| case iPhone4S | |
| case iPhone5 | |
| case iPhone5C | |
| case iPhone5S | |
| case iPhone6 |
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 Alamofire | |
| import PromiseKit | |
| public class BaseService { | |
| var baseUrl: String | |
| public init(baseUrl: ServiceUrl = .Base) { | |
| self.baseUrl = baseUrl.value | |
| } |
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 Foundation | |
| struct CustomObject1 { | |
| var value1: String | |
| } | |
| struct CustomObject2 { | |
| var value2: String | |
| } |
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
| var str = "uiiytrhhbggg" | |
| let arr = str.compactMap({ return $0 }).sorted(by: { $0 < $1 }) | |
| print(arr.reduce("", {"\($0)\($1)"})) |
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 | |
| struct People { | |
| var id: String! | |
| var name: String! | |
| } | |
| var objects: [People] = [] | |
| objects.append(People(id: "1", name: "A")) |
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
| var arrays = [1, 2, 3] | |
| let values = arrays.reduce([:]) { (dictionary, object) -> [String: Int] in | |
| var dic = dictionary | |
| dic["\(object)"] = object | |
| return dic | |
| } | |
| print(values) | |
| var arrays1 = [1, 2, 3] | |
| let values1 = arrays1.reduce([]) { (array, object) -> [[String: Int]] in |
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 Foundation | |
| enum CustomError: Error { | |
| case Negative | |
| case Zero | |
| var message: String { | |
| switch self { | |
| case .Negative: |
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 Foundation | |
| enum CustomError: Error { | |
| case Error1 | |
| case Error2 | |
| case Error3 | |
| case ErrorUnknown | |
| } | |
NewerOlder