Custom Frameworks: Sharing Code | Swift 4, Xcode 9

Kilo Loco · 26K views · 2017 · 15:54

Open on YouTube

Software (other)Software architecture & designtutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking how to create and import a custom Swift framework or library in Xcode.

Recommended by 2 people across 2 different months, 2018 to 2020.

What it is

A 16-minute Swift 4 and Xcode 9 tutorial by Kilo Loco on building a custom Cocoa Touch framework to share code between projects. It covers testing the code, creating the framework, and importing it into a new project.

What people said

Recommends Sabbir Ahmed · 2018-10 · Stack Overflow · on “How to create a static library using swift 4?”

Simple sum step to create Cocoa touch static library. Step 01: create a new Xcode project. Step 02: Chose a template -> iOS -> Framework & Library -> Cocoa - Touch Static Library then click next. Step 03: Write your Library Project name and set our other info then click next. Step 04: chose your library project location then lick Save. Step 05: write your logic what dose library project. Step 06: go to Product menu then click Build Library project. Step 07: after build your see Your left navigator under product see your libraryName.a file this file move your project the used your library project. Note: If your not clear please see this video [this video] I think help you.

Recommends Nelson Matias · 2020-02 · Stack Overflow · on “Call Function of custom Swift Framework”

This works, but is there a way that I can do the same without creating an instance of the class (I've changed the function to be static)? I'm trying to follow Kilo Loco's video below [this video]

Cites ki123 · 2019-04 · Stack Overflow · on “'result' is inaccessible due to 'internal' protection level”

I want to create custom framework for universal API request using URLSession. So I have used this [LINK] link. I will be using this project as a custom framework. So to use that I have changed its access specifier by open .And using this [this video] link I have imported it in my project. And I have done the following code to call post request import iOSCoreFramework func callBySpeedyNetworking2() { let trylogin = login(username: "****", password: "***") SpeedyNetworking.removeToken() SpeedyNetworking.postUrl(url: URL(string: GlobalConstants.loginFullURL), model: trylogin) { (response) in if !response.success { // show a network error print("network error ",response.error) return } // successful