Skip to content

Instantly share code, notes, and snippets.

View olgusirman's full-sized avatar

olgusirman olgusirman

View GitHub Profile
@olgusirman
olgusirman / podforceupdate.sh
Created November 15, 2017 11:37 — forked from mbinna/podforceupdate.sh
Clear CocoaPods cache, re-download and re-install all pods
#!/usr/bin/env bash
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
@olgusirman
olgusirman / RSSFeed.swift
Created November 21, 2017 19:34 — forked from kharrison/RSSFeed.swift
Swift Decodable With Multiple Custom Dates
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
@olgusirman
olgusirman / README.md
Created May 7, 2018 12:05 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@olgusirman
olgusirman / SampleRxSearchViewController.swift
Created June 2, 2018 12:55
UISearchBar - Search with RxSwift Example
final class SampleRxSearchViewController: UIViewController {
// MARK: - Properties
@IBOutlet fileprivate weak var tableView: UITableView!
@IBOutlet fileprivate weak var searchBar: UISearchBar!
fileprivate var tweets = [Tweet]()
fileprivate var filteredTweets = [Tweet]()
// MARK - Lifecycle
@olgusirman
olgusirman / appleSearchBarSample.swift
Created June 2, 2018 13:05 — forked from romyilano/appleSearchBarSample.swift
Various search bar implementations. Including an RxSwift / reactive swift version too
//https://developer.apple.com/library/content/samplecode/TableSearch_UISearchController/Introduction/Intro.html
// MARK: - UISearchResultsUpdating
func updateSearchResults(for searchController: UISearchController) {
// Update the filtered array based on the search text.
let searchResults = products
// Strip out all the leading and trailing spaces.
let whitespaceCharacterSet = CharacterSet.whitespaces
@olgusirman
olgusirman / ShowBuildTimesInXcode
Created July 4, 2018 21:28
This terminal code shows Xcode build times after compiling
efaults write com.apple.dt.Xcode ShowBuildOperationDuration -bool YES
@olgusirman
olgusirman / gist:310efb1cd5c592fa0726a2952d0a55a8
Created September 19, 2018 14:28 — forked from sponno/gist:7228256
Xcode build lipo script
# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Step 1. Build Device and Simulator versions
xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}"
BUILD_ROOT="${BUILD_ROOT}" xcodebuild -target ${PROJECT_NAME} -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
@olgusirman
olgusirman / Build a framework script
Created September 19, 2018 14:30
Build a framework script
xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}"
BUILD_ROOT="${BUILD_ROOT}" xcodebuild -target ${PROJECT_NAME} -configuration ${CONFIGURATION} -sdk iphonesimulator -arch x86_64 -arch i386 -arch armv7 -arch armv7s -arch arm64 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
@olgusirman
olgusirman / gist:0d5924c74c2ab54d2b5bc2b84e7b80cd
Created September 19, 2018 14:32 — forked from fwal/gist:3864958
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
#
# c.f. StackOverflow question/answer here: http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.5
#
# Latest Change:
# - The "copy headers" section now respects the build setting for the location of the public headers
# - Opens the directory with the universal library after build (Can be annoying)
#
# Purpose:
@olgusirman
olgusirman / gist:5c0eb53408d2ce5c80c211039760b29c
Created September 19, 2018 14:34 — forked from adamgit/gist:3705459
Automatically create cross-platform (simulator + device) static libraries for Objective C / iPhone / iPad
##########################################
#
# c.f. http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4
#
# Version 2.82
#
# Latest Change:
# - MORE tweaks to get the iOS 10+ and 9- working
# - Support iOS 10+
# - Corrected typo for iOS 1-10+ (thanks @stuikomma)