DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • SwiftData Dependency Injection in SwiftUI Application
  • How to Set Up GitLab Notifications in Telegram: A Comprehensive Tutorial
  • How To Use GitLab for Simultaneous Execution of Jobs (Part 2)
  • How To Use GitLab for Simultaneous Execution of Jobs (Part 1)

Trending

  • Building AI Applications With Java and Gradle
  • Unleashing the Power of Microservices With Spring Cloud
  • Database Monitoring: Key Metrics and Considerations
  • JWT Token Revocation: Centralized Control vs. Distributed Kafka Handling
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Starting Developing in Swift: Using GitLab with XCode

Starting Developing in Swift: Using GitLab with XCode

How to integrate seamlessly with GitLab for your Swift projects

$$anonymous$$ user avatar by
$$anonymous$$
·
Dec. 30, 15 · Tutorial
Like (2)
Save
Tweet
Share
9.13K Views

Join the DZone community and get the full member experience.

Join For Free

Xcode_iconAs showed in my previous post I have set up a GitLab account so I can host my Git repositories there. In this post I will show how you can combine XCode (v7.1) with GitFlow and GitLab. In fact I will end up to use both XCode (for programming) and the Terminal (for my GitFlow) but that is the same when I am developing Java. In that case I also prefer the prompt most of the time for my (basic) Git stuff.

It takes the following steps to setup your project:

  • Create the project in XCode
  • Create the project in GitLab
  • Link XCode project to GitLab project
  • Init Git Flow

Each step will be showed in more details next.
Create the project in XCode
This is the most easy part. Just create a new project in XCode and make sure that Git is enabled in the project:

Screenshot at Dec 09 15-16-29Screenshot at Dec 09 15-07-20
Screenshot at Dec 09 15-17-05
Create the project in GitLab

Next step is to create a corresponding project in GitLab. This is also quite straightforward:

Screenshot at Dec 09 15-27-12
When the project is created copy the url to the repository:
Screenshot at Dec 09 15-28-25

Now we have two separated project so lets connect them in the next step.

Link XCode project to GitLab project
In this step we connect the two projects together by setting the remote URL for the local Git project. This means that by pushing the local repo to the remote one it ends up in our GitLab repository we just created. To ‘connect’ these two repositories open the ‘Source Control’ menu item in XCode for our new project and navigate to the settings:
Screenshot at Dec 09 15-34-30
Then select ‘Remotes’ and choose the option to add one:
Screenshot at Dec 09 15-35-18

In the popup fill in the name of the remote repo (default called ‘origin’) and the url you copied in GitLab for the new project:
Screenshot at Dec 09 15-37-01

Now you can commit and push your changes to the remote repository from XCode by selecting first ‘Commit’ and then ‘Push’ in the ‘Source Control’ menu:
Screenshot at Dec 09 15-45-38

So now we have XCode and GitLab connected. It’s time to put some Flow into it.

Init Git Flow
Open the Terminal in Mac and browse to the ‘MyGitProject’ directory. Execute the command:

git flow init

to initiate gitFlow for this project:
Screenshot at Dec 09 15-53-37

Now push the changes either in Terminal or XCode to the remote server. As you can see we are now working on our ‘Develop’ branch:
Screenshot at Dec 09 15-58-09
and
Screenshot at Dec 09 15-57-21

That’s it. If you look into GitLab again you will see our project has now two branches:
Screenshot at Dec 09 16-29-21

The way to go now is to create a feature branche in the Terminal with

git flow feature start SetupStoryBoard

like this
Screenshot at Dec 09 16-32-46

Now make your changes in XCode, commit them and when you are done finish the feature with

git flow feature finish SetupStoryBoard

and push the changes in the develop branch to the remote server.

Lots more of Git fun with XCode can be found here, here and here. More info why GitFlow with iOS here.

XCode GitLab Swift (programming language)

Published at DZone with permission of $$anonymous$$. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • SwiftData Dependency Injection in SwiftUI Application
  • How to Set Up GitLab Notifications in Telegram: A Comprehensive Tutorial
  • How To Use GitLab for Simultaneous Execution of Jobs (Part 2)
  • How To Use GitLab for Simultaneous Execution of Jobs (Part 1)

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: