Creating and Publishing Custom iOS Framework using Cocoapods | Swift 5, XCode 11

  Переглядів 13,736

Emmanuel Okwara

Emmanuel Okwara

3 роки тому

Today, we learn about Frameworks.
We start by understanding the benefits of Frameworks, then we go ahead to learn how we can create a Custom Framework and use it locally by dragging it into a new/existing project.
Next, we learn how to install our Custom Framework locally using Cocoapods, and finally, we go one step further and publish our Custom Framework online and use the published version on a new/existing project.
Additional Resources:
Framework Source: github.com/EMacco/MaccoValidator
Cocoapods: cocoapods.org/pods/MaccoValid...
Say Hi on Social Media:
LinkedIn: / emacco
Twitter: / its_macco

КОМЕНТАРІ: 56
@rohitdwivedi6122
@rohitdwivedi6122 Рік тому
Very well explained and covered each aspect
@captaintech8337
@captaintech8337 Рік тому
It's an awesome tutorial Emmanuel. Thank you so much.
@prabakaranmuthusamy
@prabakaranmuthusamy Місяць тому
Good work and thank you 🎉🎉
@IasonOrlandosOx
@IasonOrlandosOx Рік тому
Thanks dude good one!
@boardguy1024
@boardguy1024 2 роки тому
Great tutorial and felt fun!! thank you!
@EmmanuelOkwara
@EmmanuelOkwara 2 роки тому
My pleasure 😊
@singhraman4282
@singhraman4282 Рік тому
Wow. Just wow. Thank you soooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much!!!
@diegitsen
@diegitsen Рік тому
Nice tutorial!
@AniketLokhande
@AniketLokhande 2 роки тому
Thank you sharing this amazing video. Can we add swift package for same library or same framwork
@JavierGarcia-se3vi
@JavierGarcia-se3vi 3 роки тому
Best explanation on internet so far ✅.
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Thanks, Javier 😊
@fre.helfer
@fre.helfer Рік тому
You are awsome, thanks!
@since.1996
@since.1996 Рік тому
your teeth are flashes more than my room tube light, thank u brother, we appreciate your efforts ,, namaste 🙏
@EmmanuelOkwara
@EmmanuelOkwara Рік тому
Thanks bro. 😅 Namaste 🙏
@saktagan28
@saktagan28 2 роки тому
Best + fun explanation, thx, keep going
@EmmanuelOkwara
@EmmanuelOkwara 2 роки тому
I’m glad you liked it 😊
@libvlog2264
@libvlog2264 3 роки тому
Best explanation on youtube so far ✅.
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
I’m flattered, thanks 😊
@sridhar1121
@sridhar1121 6 місяців тому
Hello Emanuel. Great video. Thanks for the help. Could you please post a video integrating openCV into an iOS library project (i already succeeded integrating it in application project). Because opencv is available as framework from opencv releases. How should i integrate this to a library package.swift file. This library is a camera library where i need opencv framework to do some image processing. And finally i want to create a podspec file to inegrate this whole camera library(Integrated with opencv framework) to a flutter project. It would be really great if you post a video about this
@JulianHarris
@JulianHarris Рік тому
Nice, thank you. What’s the function of the MaccoValidator.h file?
@aahn02
@aahn02 2 роки тому
Thanks a lot. Nice tutorial. But I get the error when using both spec.source_files and spec.resources even set it like this: spec.source_files = "OKAuthen/Class/**/*.{swift,c,m,h}" spec.resources = "OKAuthen/Class/*.{png,jpeg,jpg,storyboard,xib,xcassets}" And this is the error: - ERROR | [iOS] file patterns: The `source_files` pattern did not match any file. - ERROR | [iOS] file patterns: The `resources` pattern did not match any file.
@rayhaanalykhan
@rayhaanalykhan Місяць тому
What's the difference between framework, library and swift packages?
@bamanstech3006
@bamanstech3006 2 роки тому
Thank you..
@learnreactnative1533
@learnreactnative1533 2 роки тому
Hi, thanks for the tutorial. I want to add my custom framework in podspec, but I got Error regrading "vendored_frameworks" patteren didi not match all the files. could u please help me , how to solve it?
@shawnfrank5303
@shawnfrank5303 3 роки тому
Thanks a lot Emmanuel, great tutorial. I have a follow up question. What if my framework itself needed to use a custom dependency ? Let's say I wanted to include AlamoFire into my framework to make some network requests - how can this be achieved ?
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Great question, Shawn. You’d need to add the dependency to your podspec file... spec.dependency "Alamofire", "~> 1.0.0" (Where 1.0.0 is the version you want to utilize) By doing this, Alamofire will be installed automatically whenever you try to install your pod using cocoapods. Apart from this tho, I believe an easy way to get the dependency available directly within your framework is to use Carthage. This article easily describes the process. medium.com/captain-ios-experts/advanced-swift-ch-2-using-third-party-framework-inside-custom-swift-framework-133cefd76fcd
@nitinsoni8763
@nitinsoni8763 3 роки тому
Yes, Best explanation, thanks for this video. Can you please create video for updating the pods?
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Thanks, Nitin. By updating pods, do you mean creating a new version for your custom pod, or updating your third party dependencies in a regular project?
@nitinsoni8763
@nitinsoni8763 3 роки тому
​@@EmmanuelOkwara Yes Emmanuel. I think that should be the second and mandatory part of this video. People watching it should be interested to know how to update the pod they just created.
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
You make good point. The process is really similar tho. Make your changes Increment your version Lint and upload
@xyjoe7987
@xyjoe7987 Рік тому
Hello Emanuel, great tutorial really but this example works well for public gthub frameworks. Can you explain another for the process involving private frameworks. There are alot of issues online regarding that, and doing that will really help alot of devs out there
@EmmanuelOkwara
@EmmanuelOkwara Рік тому
You are correct. I’ll create an updated video to explain this.
@strandzstylesnbeauty
@strandzstylesnbeauty 3 роки тому
Nice
@soorejsbabu
@soorejsbabu Рік тому
Bloody hell!! Was it this much simpler?
@makeinpro
@makeinpro 2 роки тому
how to make link repo is private, will it install too?
@RaviKiranchanti
@RaviKiranchanti 3 роки тому
Nice tutorial Emmanuel. I have a Question, will it work for both simulator and device? Since you built it with simulator, it will support only for simulator architecture.
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Thanks, Ravi. Good question. If you want to test your framework on a real device using the method demonstrated in 5:00, you would need to build the framework using either a real or the Generic iOS Device and use the output in your project. An alternative is to build it as a Universal Framework which will allow you to use the framework on both simulator and device. From the video tho, we took the Cocoapod route to install our Framework as demonstrated in 22:11. This way, we don't need to manually make it "Universal". If you attempt to run the app using either a Simulator or a Device, it should work fine.
@RaviKiranchanti
@RaviKiranchanti 3 роки тому
Thanks for the reply Emmanuel. How can we hide the source code, since we are giving the git repo link to others. They can see the source code right?
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Yes the source code is currently public. If you want to keep it private, you can consider making the git repo private and publishing the framework as a private pod. This method will require an additional repo to host your Podspec file.
@connectSanjayMali
@connectSanjayMali 3 роки тому
How would you add some pod dependencies(Alamofire) in the framework itself and Read this dependencies in the framework ReaderApp
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Great question, Sanjay. What I’ve done personally is to add the dependency into the framework using Carthage(just so that it’s available within our custom framework). When I want to distribute to cocoapods, I add it as a dependency in our podspec. E.g spec.dependency 'Alamofire', '~> 1.0'
@KaizenM1989
@KaizenM1989 3 роки тому
I'm still watching the video. At 5:05... what did you press to switch screens when dragging the framework?
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
Nothing special. Just the regular 4 finger swipe, or 3 fingers depending on your configuration. 😊
@cosminiulian08
@cosminiulian08 2 роки тому
At 28:00 ( "pod trunk push .podspec" ) I have this error: " [BUG] Bus Error at 0x0000000104324000 ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.arm64e-darwin20] " Edit: The reason is from new Macbook M1. Works well on Intel.
@EmmanuelOkwara
@EmmanuelOkwara 2 роки тому
Thanks for the info, Cosmin. Did you figure out a workaround?
@makeinpro
@makeinpro 2 роки тому
How to share that if it's private
@EmmanuelOkwara
@EmmanuelOkwara 2 роки тому
It’s pretty similar to sharing a public pod. You’ll just need to also share the source url to the private repo so that cocoapods knows where to find the code. Meaning that when you want to install a private pod you’ll also need to add source ‘link_to_repo’ At the top of your file before writing pod ‘name_of_pod’
@nizz4m
@nizz4m 3 роки тому
Good tutorial And I just want to comment on your keyboard pressing, the sound was loud and annoyed the earphone user.
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
I appreciate the feedback and apologize for the negative experience. I’ve taken note and will prevent this from happening in subsequent videos. 🤗
@nizz4m
@nizz4m 3 роки тому
@@EmmanuelOkwara sorry for comment and keep doing a great content !
@EmmanuelOkwara
@EmmanuelOkwara 3 роки тому
There’s no need for an apology Nizzam 😊 I really do appreciate the feedback. If you have other ideas of ways you feel my tutorials/videos can be improved, I’m all ears. Feedback helps us get better 💯
iOS Deep Understanding of Libraries and Frameworks
1:32:32
Wizeline Academy
Переглядів 5 тис.
Creating and Publishing Swift Packages (Swift Package Manager)
14:05
Піхотинці - про потребу у людях
00:57
Суспільне Новини
Переглядів 1 млн
How to Create a CocoadPods Library to share code
16:45
LocoMoviles
Переглядів 13 тис.
Creating a Custom Framework in Swift in 2022
26:54
Rebeloper - Rebel Developer
Переглядів 13 тис.
Swift Framework - Create a Custom Framework in iOS
15:50
Rebeloper - Rebel Developer
Переглядів 21 тис.
How to Shoot Flash/Strobe Photography on 35mm Film
10:52
Willem Verbeeck
Переглядів 111 тис.
Implement Multi Projects Workspace on Xcode
24:29
Kelvin Fok
Переглядів 8 тис.
Custom Cocoapods: Sharing A Framework | Swift 4, Xcode 9
45:59
Kilo Loco
Переглядів 22 тис.
ChatGPT’s Amazing New Model Feels Human (and it's Free)
25:02
Matt Wolfe
Переглядів 57 тис.
Improving Your iOS Development Workflow with SwiftGen: A Practical Guide
20:35
Prefetching with TableViews (2022) - iOS
16:35
iOS Academy
Переглядів 18 тис.
How to Create an XCFramework - Frameworks and Static Libraries
29:24
LocoMoviles
Переглядів 11 тис.
🤯Самая КРУТАЯ Функция #shorts
0:58
YOLODROID
Переглядів 3,3 млн
How much charging is in your phone right now? 📱➡️ 🔋VS 🪫
0:11
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Переглядів 2,2 млн