SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Giving back with
GitHub
Putting the Open Source back in iOS
@madhavajay
The Why
• Elmar: Hey checkout this thing I made called
PalauDefaults
• Me: WTF is this? 🤔 🙄 nope 😳
• Elmar: *Tries to explain*
• I hear: Blah blah blah Generics, blah blah Type Safety,
blah blah, monad-flatMap?
• Elmar: Lets Open Source it! 🤔
• Me: 😎
The What
• Why GitHub
• What makes a good iOS GitHub repo
• Multi Platform Support
• Testing with Travis CI
• Package Manager Support
• Finishing Touches
GitHub is the center of the
open source world!
• Frameworks Libraries and Examples
• Wikis, Issues, Pull Requests, Gists
• APIs, High Availability, The best VCS - Git
• Massive Community
• Even Apple! - github.com/apple/swift
Reasons to $ git commit
to the GitHub Community
• You thought of a cool feature to add to your fav repo
• You found a 🐛 in someone’s code and want to rub it in fix
it for them
• You wrote that cool script to automate something and
decided to make someone else’s life suck less!
• Balance your $ git karma ☯ - every time you

$ git pull, without $ git push 🐶🔫 😱
• $ git commit public code makes you a better programmer
You want your profile
to suck less!
Developing on iOS with
GitHub rocks!
• branch, code, test!, commit, push, pull request, merge 🍻
• Dependency Management: Cocoapods, Carthage and SPM
• Free CI Testing with Travis CI
• Wiki and GitHub Pages
• MarkDown for README
• Cool Badges like shields.io
• Integrations: JIRA, Travis, Slack, Gitter and More!
If there’s a git tree in
the GitHub forest, but
no one clones it; is it
even on GitHub?
Ancient Chinese Proverb:
How NOT to do your
README.md
How NOT to do your
README.md
• No Usage or Install Instructions
• No Tests 😱
• No Versioning or Dependency Info
• No Code Syntax Highlighting
• No License and Credits
• = NO $ git clone
These are not the Repos
you are looking for
Imitation is the sincerest
form of flattery
Anatomy of an
iOS Framework
Anatomy of an
iOS Framework
• Sources (with s) contains files that will be compiled
• Tests, you know… has the tests you better write!
• PM: Package.swift, Project.podspec
• Config: .swiftlint.yml, .travis.yml, .gitignore
• Resources / Fixtures, keep isolated
• Remove all other crud and aim for 2 .plist files,
watchOS currently requires editing .xcodeproj
Swift
Supporting Multiple Targets
#if os(OSX)
// test if we can get a default NSColor from a property
func testNSColorDefaultValue() {
let redColor = PalauDefaults.ensuredNSColorValue.value
let redColor2 = PalauDefaults.whenNilledNSColorValue.value
assert(CGColorEqualToColor(redColor!.CGColor,NSColor.redColor().CGColor))
assert(redColor2 == NSColor.redColor())
}
#else
// test if we can get a default UIColor from a property
func testUIColorDefaultValue() {
let redColor = PalauDefaults.ensuredUIColorValue.value
let redColor2 = PalauDefaults.whenNilledUIColorValue.value
// UIColor sometimes returns different versions UIDeviceRGBColorSpace
assert(CGColorEqualToColor(redColor!.CGColor,UIColor.redColor().CGColor))
assert(redColor2 == UIColor.redColor())
}
#endif
Swift
Supporting Multiple Targets
* It's not really that hard
• Create a Target for each Platform
• iOS, macOS, tvOS, watchOS (no tests yet)
• Write tests with Platforms in Mind


#if arch(x86_64) || arch(arm64)
func test64bitOnly () {
let reallyBigInt = 9_223_372_036_854_775_807
checkValue(&PalauDefaults.intValue, value: reallyBigInt)
• Add Platform tests to your .travis.yml file

DESTINATION="OS=9.2,name=Apple TV 1080p"
Cool things I stole learn't
from other GitHub repos
• .travis.yml for Xcode Testing
• shields.io
• Center your Logo with <p align=“center”><img></p>
• - [x] Cool Checkbox Bullet Points
• ```swift - highlights your swift code
Travis CI File
.travis.yml
language: objective-c
install:
- ./Resources/install_swiftlint.sh
env:
global:
- IOS_FRAMEWORK_SCHEME="Palau iOS"
- WATCHOS_FRAMEWORK_SCHEME="Palau watchOS"
script:
- swiftlint
- xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" -
destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO
test | xcpretty -c;
* Modified for slide
Xcode Project
Target Setup
* Modified for slide
Travis CI File
.travis.yml
- Run xcodebuild locally first
- Make sure your shell files are chmod +x
- Name your targets correctly
- Use swiftlint via install.sh script
- Don’t output characters like ⡍⠜⠇⠑

or you might break xcpretty
build passing: Поехали!
Carthage
Share Schemes
Carthage
Product Name
CocoaPods
.podspec
• Pod::Spec.new do |s|
• s.name = "Palau"
• s.version = "1.0.3"
• s.summary = "Palau: NSUserDefaults with Wings!"
• s.homepage = "https://github.com/symentis/Palau"
• s.screenshots = "palau-logo.png"
• s.license = "Apache License, Version 2.0"
• s.authors = { "github@symentis.com" }
• s.ios.deployment_target = "8.0"
• s.tvos.deployment_target = "9.0"
• s.watchos.deployment_target = "2.0"
• s.source_files = "Sources/*.swift"
* Modified for slide, not v1 compatible
CocoaPods
.podspec
- Test locally using:
pod 'Name', :path => '~/code/Pods/'
- Don’t forget to bump your versions (1 .plist for all)
- $ pod lib lint
- $ git tag ‘1.0.3’; git push —tags
- Wait for Travis CI tests 😎
- $ pod trunk push NAME.podspec
CocoaPods
Quality Index
* Modified for slide, not v1 compatible
< Sure… 😂
SPM
Swift Package Manager
SPM
Package.swift
import PackageDescription
let package = Package(
name: "Palau"
)
* This will change VERY soon!
Cool Badges
shields.io
* Modified for slide
https://travis-ci.org/symentis/Palau.svg?branch=master
https://img.shields.io/cocoapods/v/Palau.svg
https://img.shields.io/badge/Carthage-compatible-4BC51D.svg
https://img.shields.io/cocoapods/p/Palau.svg
https://img.shields.io/badge/pure-swift-ff3f26.svg
https://img.shields.io/badge/twitter-@elmkretzer-blue.svg
https://img.shields.io/badge/twitter-@madhavajay-blue.svg
Star if you
Liked this
* This will change VERY soon!
Thanks
Munich iOS Meetup
import Thanks
assert(
user.getsPizza == user.starredRepo
)
print("See you on GitHub 😎”)
* This will change VERY soon!
@madhavajay
http://symentis.com/

Weitere ähnliche Inhalte

Was ist angesagt?

Using software modules welcome to hell!
Using software modules   welcome to hell!Using software modules   welcome to hell!
Using software modules welcome to hell!Baruch Sadogursky
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Elsemckern
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Codemotion
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsNETWAYS
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsGianluca Varisco
 
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...Gianluca Varisco
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React ComponentsZack Argyle
 
Building Open-source React Components
Building Open-source React ComponentsBuilding Open-source React Components
Building Open-source React ComponentsZack Argyle
 
Regex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language InsteadRegex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language InsteadAll Things Open
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsChris Bohatka
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36aleonhardt
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requestsTim Pettersen
 
GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?Csaba Fitzl
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsCarl Brown
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.Mandi Walls
 
Open Source License Compliance with AGL
Open Source License Compliance with AGLOpen Source License Compliance with AGL
Open Source License Compliance with AGLPaul Barker
 

Was ist angesagt? (20)

Using software modules welcome to hell!
Using software modules   welcome to hell!Using software modules   welcome to hell!
Using software modules welcome to hell!
 
Packaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything ElsePackaging is the Worst Way to Distribute Software, Except for Everything Else
Packaging is the Worst Way to Distribute Software, Except for Everything Else
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
DevOoops (Increase awareness around DevOps infra security) - VoxxedDays Ticin...
 
Building Open-Source React Components
Building Open-Source React ComponentsBuilding Open-Source React Components
Building Open-Source React Components
 
Building Open-source React Components
Building Open-source React ComponentsBuilding Open-source React Components
Building Open-source React Components
 
Regex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language InsteadRegex Considered Harmful: Use Rosie Pattern Language Instead
Regex Considered Harmful: Use Rosie Pattern Language Instead
 
Git Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basicsGit Obstacle Course: Stop BASHing your head and break down the basics
Git Obstacle Course: Stop BASHing your head and break down the basics
 
Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36Taking Spinnaker for a spin @ London DevOps Meetup 36
Taking Spinnaker for a spin @ London DevOps Meetup 36
 
Git training v10
Git training v10Git training v10
Git training v10
 
Git 101 for Beginners
Git 101 for Beginners Git 101 for Beginners
Git 101 for Beginners
 
Code reviews vs Pull requests
Code reviews vs Pull requestsCode reviews vs Pull requests
Code reviews vs Pull requests
 
GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?GateKeeper - bypass or not bypass?
GateKeeper - bypass or not bypass?
 
Introduction to Git Commands and Concepts
Introduction to Git Commands and ConceptsIntroduction to Git Commands and Concepts
Introduction to Git Commands and Concepts
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
Updated non-lab version of Level Up. Delivered at LOPSA-East, May 3, 2014.
 
Open Source License Compliance with AGL
Open Source License Compliance with AGLOpen Source License Compliance with AGL
Open Source License Compliance with AGL
 

Andere mochten auch

презентация
презентацияпрезентация
презентацияkutkova
 
презентация забазайченко о.п.
презентация забазайченко о.п.презентация забазайченко о.п.
презентация забазайченко о.п.Oks25
 
Caregivers of Stroke Survivors
Caregivers of Stroke SurvivorsCaregivers of Stroke Survivors
Caregivers of Stroke SurvivorsLaura Cohen
 
Urbanismo janela-otero-deber
Urbanismo janela-otero-deberUrbanismo janela-otero-deber
Urbanismo janela-otero-deberEnrique Hernandez
 
Enrique xavier hernandez unda
Enrique xavier hernandez undaEnrique xavier hernandez unda
Enrique xavier hernandez undaEnrique Hernandez
 
Functional vision loss table 2
Functional vision loss table 2Functional vision loss table 2
Functional vision loss table 2Arash Eslami
 
งานนำเสนอ
งานนำเสนองานนำเสนอ
งานนำเสนอtongkesmanee
 
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุย
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุยโครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุย
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุยtongkesmanee
 
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama Economy
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama EconomyAmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama Economy
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama EconomyAmeraTex Energy Inc
 
Library camp wales presentation
Library camp wales presentationLibrary camp wales presentation
Library camp wales presentationGemma Southgate
 
Our Journey &lt;3
Our Journey &lt;3Our Journey &lt;3
Our Journey &lt;3Denn Den
 
Cohesive tensile strength of human lasik wounds
Cohesive tensile strength of human lasik woundsCohesive tensile strength of human lasik wounds
Cohesive tensile strength of human lasik woundsArash Eslami
 
ภาพบรรยาการการทำงาน
ภาพบรรยาการการทำงานภาพบรรยาการการทำงาน
ภาพบรรยาการการทำงานtongkesmanee
 
Berry sastrawan universitasdjuanda_pkmk
Berry sastrawan universitasdjuanda_pkmkBerry sastrawan universitasdjuanda_pkmk
Berry sastrawan universitasdjuanda_pkmkBerry Sastrawan
 
презентация забазайченко о.п.
презентация забазайченко о.п.презентация забазайченко о.п.
презентация забазайченко о.п.Oks25
 
Alamo river california trails and greenways conference presentation 050913
Alamo river california trails and greenways conference presentation 050913Alamo river california trails and greenways conference presentation 050913
Alamo river california trails and greenways conference presentation 050913Alexander P. Meyerhoff, AICP
 

Andere mochten auch (20)

презентация
презентацияпрезентация
презентация
 
презентация забазайченко о.п.
презентация забазайченко о.п.презентация забазайченко о.п.
презентация забазайченко о.п.
 
Caregivers of Stroke Survivors
Caregivers of Stroke SurvivorsCaregivers of Stroke Survivors
Caregivers of Stroke Survivors
 
Urbanismo janela-otero-deber
Urbanismo janela-otero-deberUrbanismo janela-otero-deber
Urbanismo janela-otero-deber
 
Enrique xavier hernandez unda
Enrique xavier hernandez undaEnrique xavier hernandez unda
Enrique xavier hernandez unda
 
Functional vision loss table 2
Functional vision loss table 2Functional vision loss table 2
Functional vision loss table 2
 
งานนำเสนอ
งานนำเสนองานนำเสนอ
งานนำเสนอ
 
Untitled presentation
Untitled presentationUntitled presentation
Untitled presentation
 
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุย
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุยโครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุย
โครงงานกระตุ้นชุมชน เพิ่มจิตอาสาพัฒนาวัดบ้านกุดนางทุย
 
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama Economy
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama EconomyAmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama Economy
AmeraTex Energy | The American Oil & Gas Industry Is Rescuing The Obama Economy
 
Library camp wales presentation
Library camp wales presentationLibrary camp wales presentation
Library camp wales presentation
 
Our Journey &lt;3
Our Journey &lt;3Our Journey &lt;3
Our Journey &lt;3
 
Cohesive tensile strength of human lasik wounds
Cohesive tensile strength of human lasik woundsCohesive tensile strength of human lasik wounds
Cohesive tensile strength of human lasik wounds
 
ภาพบรรยาการการทำงาน
ภาพบรรยาการการทำงานภาพบรรยาการการทำงาน
ภาพบรรยาการการทำงาน
 
Algorytm dijkstry
Algorytm dijkstryAlgorytm dijkstry
Algorytm dijkstry
 
Berry sastrawan universitasdjuanda_pkmk
Berry sastrawan universitasdjuanda_pkmkBerry sastrawan universitasdjuanda_pkmk
Berry sastrawan universitasdjuanda_pkmk
 
English gr 7 learners matls (q1&2)
English gr 7 learners matls (q1&2)English gr 7 learners matls (q1&2)
English gr 7 learners matls (q1&2)
 
презентация забазайченко о.п.
презентация забазайченко о.п.презентация забазайченко о.п.
презентация забазайченко о.п.
 
Access
AccessAccess
Access
 
Alamo river california trails and greenways conference presentation 050913
Alamo river california trails and greenways conference presentation 050913Alamo river california trails and greenways conference presentation 050913
Alamo river california trails and greenways conference presentation 050913
 

Ähnlich wie Giving back with GitHub - Putting the Open Source back in iOS

On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangChris McEniry
 
Getting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitGetting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitRick Wargo
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsFrancesco Bruni
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy VirinCocoaHeads France
 
Kubeflow Development Environment
Kubeflow Development EnvironmentKubeflow Development Environment
Kubeflow Development EnvironmentWeiqiang Zhuang
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
vBrownBag - Scripting and Versioning with PowerShell ISE and Git Shell
vBrownBag - Scripting and Versioning with PowerShell ISE and Git ShellvBrownBag - Scripting and Versioning with PowerShell ISE and Git Shell
vBrownBag - Scripting and Versioning with PowerShell ISE and Git ShellChris Wahl
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2Derek Jacoby
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Derek Jacoby
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat Pôle Systematic Paris-Region
 
Intro to Git: a hands-on workshop
Intro to Git: a hands-on workshopIntro to Git: a hands-on workshop
Intro to Git: a hands-on workshopCisco DevNet
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSJustin Ryan
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Mandi Walls
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOSPetr Dvorak
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsPetr Dvorak
 

Ähnlich wie Giving back with GitHub - Putting the Open Source back in iOS (20)

On the Edge Systems Administration with Golang
On the Edge Systems Administration with GolangOn the Edge Systems Administration with Golang
On the Edge Systems Administration with Golang
 
Getting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitGetting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills Kit
 
Continuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and JenkinsContinuous Integration/Deployment with Docker and Jenkins
Continuous Integration/Deployment with Docker and Jenkins
 
Continuous integration by Rémy Virin
Continuous integration by Rémy VirinContinuous integration by Rémy Virin
Continuous integration by Rémy Virin
 
Hacking on WildFly 9
Hacking on WildFly 9Hacking on WildFly 9
Hacking on WildFly 9
 
Kubeflow Development Environment
Kubeflow Development EnvironmentKubeflow Development Environment
Kubeflow Development Environment
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
vBrownBag - Scripting and Versioning with PowerShell ISE and Git Shell
vBrownBag - Scripting and Versioning with PowerShell ISE and Git ShellvBrownBag - Scripting and Versioning with PowerShell ISE and Git Shell
vBrownBag - Scripting and Versioning with PowerShell ISE and Git Shell
 
CICD_1670665418.pdf
CICD_1670665418.pdfCICD_1670665418.pdf
CICD_1670665418.pdf
 
Untangling fall2017 week2
Untangling fall2017 week2Untangling fall2017 week2
Untangling fall2017 week2
 
Untangling fall2017 week2_try2
Untangling fall2017 week2_try2Untangling fall2017 week2_try2
Untangling fall2017 week2_try2
 
habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
PyParis 2017 / Writing a C Python extension in 2017, Jean-Baptiste Aviat
 
Intro to Git: a hands-on workshop
Intro to Git: a hands-on workshopIntro to Git: a hands-on workshop
Intro to Git: a hands-on workshop
 
SF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSSSF Gradle Meetup - Netflix OSS
SF Gradle Meetup - Netflix OSS
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
Django at Scale
Django at ScaleDjango at Scale
Django at Scale
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
FI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS BasicsFI MUNI 2012 - iOS Basics
FI MUNI 2012 - iOS Basics
 
Continuous feature-development
Continuous feature-developmentContinuous feature-development
Continuous feature-development
 

Kürzlich hochgeladen

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Giving back with GitHub - Putting the Open Source back in iOS

  • 1. Giving back with GitHub Putting the Open Source back in iOS @madhavajay
  • 2. The Why • Elmar: Hey checkout this thing I made called PalauDefaults • Me: WTF is this? 🤔 🙄 nope 😳 • Elmar: *Tries to explain* • I hear: Blah blah blah Generics, blah blah Type Safety, blah blah, monad-flatMap? • Elmar: Lets Open Source it! 🤔 • Me: 😎
  • 3. The What • Why GitHub • What makes a good iOS GitHub repo • Multi Platform Support • Testing with Travis CI • Package Manager Support • Finishing Touches
  • 4. GitHub is the center of the open source world! • Frameworks Libraries and Examples • Wikis, Issues, Pull Requests, Gists • APIs, High Availability, The best VCS - Git • Massive Community • Even Apple! - github.com/apple/swift
  • 5. Reasons to $ git commit to the GitHub Community • You thought of a cool feature to add to your fav repo • You found a 🐛 in someone’s code and want to rub it in fix it for them • You wrote that cool script to automate something and decided to make someone else’s life suck less! • Balance your $ git karma ☯ - every time you
 $ git pull, without $ git push 🐶🔫 😱 • $ git commit public code makes you a better programmer
  • 6. You want your profile to suck less!
  • 7. Developing on iOS with GitHub rocks! • branch, code, test!, commit, push, pull request, merge 🍻 • Dependency Management: Cocoapods, Carthage and SPM • Free CI Testing with Travis CI • Wiki and GitHub Pages • MarkDown for README • Cool Badges like shields.io • Integrations: JIRA, Travis, Slack, Gitter and More!
  • 8. If there’s a git tree in the GitHub forest, but no one clones it; is it even on GitHub? Ancient Chinese Proverb:
  • 9. How NOT to do your README.md
  • 10. How NOT to do your README.md • No Usage or Install Instructions • No Tests 😱 • No Versioning or Dependency Info • No Code Syntax Highlighting • No License and Credits • = NO $ git clone
  • 11. These are not the Repos you are looking for
  • 12. Imitation is the sincerest form of flattery
  • 13. Anatomy of an iOS Framework
  • 14. Anatomy of an iOS Framework • Sources (with s) contains files that will be compiled • Tests, you know… has the tests you better write! • PM: Package.swift, Project.podspec • Config: .swiftlint.yml, .travis.yml, .gitignore • Resources / Fixtures, keep isolated • Remove all other crud and aim for 2 .plist files, watchOS currently requires editing .xcodeproj
  • 15. Swift Supporting Multiple Targets #if os(OSX) // test if we can get a default NSColor from a property func testNSColorDefaultValue() { let redColor = PalauDefaults.ensuredNSColorValue.value let redColor2 = PalauDefaults.whenNilledNSColorValue.value assert(CGColorEqualToColor(redColor!.CGColor,NSColor.redColor().CGColor)) assert(redColor2 == NSColor.redColor()) } #else // test if we can get a default UIColor from a property func testUIColorDefaultValue() { let redColor = PalauDefaults.ensuredUIColorValue.value let redColor2 = PalauDefaults.whenNilledUIColorValue.value // UIColor sometimes returns different versions UIDeviceRGBColorSpace assert(CGColorEqualToColor(redColor!.CGColor,UIColor.redColor().CGColor)) assert(redColor2 == UIColor.redColor()) } #endif
  • 16. Swift Supporting Multiple Targets * It's not really that hard • Create a Target for each Platform • iOS, macOS, tvOS, watchOS (no tests yet) • Write tests with Platforms in Mind 
 #if arch(x86_64) || arch(arm64) func test64bitOnly () { let reallyBigInt = 9_223_372_036_854_775_807 checkValue(&PalauDefaults.intValue, value: reallyBigInt) • Add Platform tests to your .travis.yml file
 DESTINATION="OS=9.2,name=Apple TV 1080p"
  • 17. Cool things I stole learn't from other GitHub repos • .travis.yml for Xcode Testing • shields.io • Center your Logo with <p align=“center”><img></p> • - [x] Cool Checkbox Bullet Points • ```swift - highlights your swift code
  • 18. Travis CI File .travis.yml language: objective-c install: - ./Resources/install_swiftlint.sh env: global: - IOS_FRAMEWORK_SCHEME="Palau iOS" - WATCHOS_FRAMEWORK_SCHEME="Palau watchOS" script: - swiftlint - xcodebuild -project "$PROJECT" -scheme "$SCHEME" -sdk "$SDK" - destination "$DESTINATION" -configuration Debug ONLY_ACTIVE_ARCH=NO test | xcpretty -c; * Modified for slide
  • 19. Xcode Project Target Setup * Modified for slide
  • 20. Travis CI File .travis.yml - Run xcodebuild locally first - Make sure your shell files are chmod +x - Name your targets correctly - Use swiftlint via install.sh script - Don’t output characters like ⡍⠜⠇⠑
 or you might break xcpretty
  • 24. CocoaPods .podspec • Pod::Spec.new do |s| • s.name = "Palau" • s.version = "1.0.3" • s.summary = "Palau: NSUserDefaults with Wings!" • s.homepage = "https://github.com/symentis/Palau" • s.screenshots = "palau-logo.png" • s.license = "Apache License, Version 2.0" • s.authors = { "github@symentis.com" } • s.ios.deployment_target = "8.0" • s.tvos.deployment_target = "9.0" • s.watchos.deployment_target = "2.0" • s.source_files = "Sources/*.swift" * Modified for slide, not v1 compatible
  • 25. CocoaPods .podspec - Test locally using: pod 'Name', :path => '~/code/Pods/' - Don’t forget to bump your versions (1 .plist for all) - $ pod lib lint - $ git tag ‘1.0.3’; git push —tags - Wait for Travis CI tests 😎 - $ pod trunk push NAME.podspec
  • 26. CocoaPods Quality Index * Modified for slide, not v1 compatible < Sure… 😂
  • 28. SPM Package.swift import PackageDescription let package = Package( name: "Palau" ) * This will change VERY soon!
  • 29. Cool Badges shields.io * Modified for slide https://travis-ci.org/symentis/Palau.svg?branch=master https://img.shields.io/cocoapods/v/Palau.svg https://img.shields.io/badge/Carthage-compatible-4BC51D.svg https://img.shields.io/cocoapods/p/Palau.svg https://img.shields.io/badge/pure-swift-ff3f26.svg https://img.shields.io/badge/twitter-@elmkretzer-blue.svg https://img.shields.io/badge/twitter-@madhavajay-blue.svg
  • 30. Star if you Liked this * This will change VERY soon!
  • 31. Thanks Munich iOS Meetup import Thanks assert( user.getsPizza == user.starredRepo ) print("See you on GitHub 😎”) * This will change VERY soon! @madhavajay http://symentis.com/