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

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • 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/EMa...
    Cocoapods: cocoapods.org/...
    Say Hi on Social Media:
    LinkedIn: / emacco
    Twitter: / its_macco

Комментарии • 58

  • @singhraman4282
    @singhraman4282 Год назад +1

    Wow. Just wow. Thank you soooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo much!!!

  • @KTV-1996
    @KTV-1996 Год назад +1

    your teeth are flashes more than my room tube light, thank u brother, we appreciate your efforts ,, namaste 🙏

  • @JavierGarcia-se3vi
    @JavierGarcia-se3vi 3 года назад +1

    Best explanation on internet so far ✅.

  • @sandeepsahanicodes
    @sandeepsahanicodes 3 месяца назад

    Amazing content! Thanks

  • @akashskumar6389
    @akashskumar6389 27 дней назад

    amazing, just wow

  • @captaintech8337
    @captaintech8337 2 года назад

    It's an awesome tutorial Emmanuel. Thank you so much.

  • @sridharprasath94
    @sridharprasath94 10 месяцев назад

    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

  • @rohitdwivedi6122
    @rohitdwivedi6122 Год назад

    Very well explained and covered each aspect

  • @fre.helfer
    @fre.helfer Год назад

    You are awsome, thanks!

  • @libvlog2264
    @libvlog2264 3 года назад

    Best explanation on youtube so far ✅.

  • @prabakaranmuthusamy
    @prabakaranmuthusamy 5 месяцев назад

    Good work and thank you 🎉🎉

  • @soorejsbabu
    @soorejsbabu Год назад +2

    Bloody hell!! Was it this much simpler?

  • @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

  • @saktagan28
    @saktagan28 2 года назад

    Best + fun explanation, thx, keep going

  • @boardguy1024
    @boardguy1024 2 года назад

    Great tutorial and felt fun!! thank you!

  • @xyjoe7987
    @xyjoe7987 2 года назад

    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  2 года назад

      You are correct.
      I’ll create an updated video to explain this.

  • @IasonOrlandosOx
    @IasonOrlandosOx Год назад

    Thanks dude good one!

  • @diegitsen
    @diegitsen 2 года назад

    Nice tutorial!

  • @AniketLokhande
    @AniketLokhande 3 года назад

    Thank you sharing this amazing video. Can we add swift package for same library or same framwork

  • @aahn02
    @aahn02 3 года назад

    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 5 месяцев назад

    What's the difference between framework, library and swift packages?

  • @JulianHarris
    @JulianHarris Год назад

    Nice, thank you. What’s the function of the MaccoValidator.h file?

  • @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?

  • @bamanstech3006
    @bamanstech3006 3 года назад

    Thank you..

  • @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

  • @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. 😊

  • @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 года назад +1

      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'

  • @cosminiulian08
    @cosminiulian08 3 года назад

    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  3 года назад

      Thanks for the info, Cosmin.
      Did you figure out a workaround?

  • @makeinpro
    @makeinpro 2 года назад

    how to make link repo is private, will it install too?

  • @RaviKiranMakala
    @RaviKiranMakala 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 года назад +1

      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.

    • @RaviKiranMakala
      @RaviKiranMakala 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 года назад +1

      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.

  • @strandzstylesnbeauty
    @strandzstylesnbeauty 4 года назад

    Nice

  • @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 года назад +1

      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 💯