Skip to content

Instantly share code, notes, and snippets.

Ali Riahipour alirp88

Block or report user

Report or block alirp88

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FavoriteNumber SwiftUI.swift
struct FavoriteNumber {
var number: Int
var isFavorite: Bool
init(_ number: Int) {
self.number = number
isFavorite = false
struct ContentView : View {
if which swxftlint >/dev/null; then
echo "warning: SwiftLint not installed, download from"
View DecodableProblem.swift
import Foundation
let json = "{\"aas\":[{\"type\":\"AnyA\",\"a\":12},{\"type\":\"AnyotherA\",\"a\":32}]}"
enum Type: String, Codable {
case AnyA
case AnyotherA
protocol A: Codable {
alirp88 / Debug
Last active Aug 31, 2018 — forked from beny/gist:8313959
Xcode tips
View Debug

Core Data

  • 1-3 - print all SQL queries called by Core Data
    • 1-3 - needed alongside with the SQLDebug from iOS 10+ because of new logging system, more on that in changelog
  • YES - probably syntax colored logging (not tried)
  • 1 - preference controls some aspects of the SQLite store. See the "Configuring a SQLite Store's Save Behavior" section of the Core Data Programming Guide for details
  • 1 - the SQLite store does extra integrity checking
  • 1 - Core Data will log information about exceptional cases as it migrates data
  • 1 - preference enables assertions to enforce Core Data's multi-threading policy. It is a number, where i
sudo ~/Downloads/Install\ macOS\ High\ Sierra\ --volume /Volumes/Untitled --applicationpath ~/Downloads/Install\ macOS\ High\ Sierra\ --nointeraction
View checkDateIsWeekEnd.swift
enum WeekDayTypes: NSNumber {
case weekday = 0
case weekend = 1
extension Date {
func isWeekend() -> WeekDayTypes {
return WeekDayTypes(rawValue: NSNumber(value:Calendar.current.isDateInWeekend(self)))!

Keybase proof

I hereby claim:

  • I am alirp88 on github.
  • I am alirp88 ( on keybase.
  • I have a public key whose fingerprint is 98AB E053 15AD 4068 F37B 052C DAE6 72CA 1A9A 044A

To claim this, I am signing this object:

View .travis.yml
osx_image: xcode8.3
language: objective-c
xcode_workspace: TestProject.xcworkspace
xcode_scheme: TestProject
- gem install cocoapods # Since Travis is not always on latest version
- pod install
You can’t perform that action at this time.