创建和发布iOS framework

Flutter iOS App 上架 使用 Flutter 框架搭建的App上架那些事(持续更新) 前言 今天是第一个 Flutter iOS App 上架,激动,还有点担心。问题还不少,总结一下,让大家少入坑。 问题集锦 问题一: ERROR ITMS-90189: Redundant Binary Upload. You've already uploaded a build with build number '1' for version number '1.0'. Make sure you increment the build string before you upload your app to App Store Connect. Learn more in Xcode 立即下载

Update note: This tutorial has been updated to Xcode 8, Cocoapods 1.0, iOS 10 and Swift 3 on Sept 28, 2016.

文章包括framework的创建和发布,及其如何对生成的framework进行单元测试;

CocoaPod的创建和使用,以及如何发布Pod到GitHub。

原文:点击打开链接

Have you ever wanted to share a chunk of code between two or more of your apps, or wanted to share a part of your program with other developers?

Maybe you wanted to modularize your code similarly to how the iOS SDK separates its API by functionality, or perhaps you want to distribute your code in the same way as popular 3rd parties do.

In this iOS frameworks tutorial you’ll learn how to do all of the above!

In iOS 8 and Xcode 6, Apple provided a new template, Cocoa Touch Framework. As you’ll see, it makes creating custom frameworks much easier than before.

Frameworks have three major purposes:

  • Code encapsulation
  • Code modularity
  • Code reuse

You can share your framework with your other apps, team members, or the iOS community. When combined with Swift’s access control, frameworks help define strong, testable interfaces between code modules.

In Swift parlance, a module is a compiled group of code that is distributed together. A framework is one type of module, and an app is another example.

In this iOS frameworks tutorial, you’ll extract a piece of an existing app and set it free, and by doing so, you’ll learn the ins and outs of frameworks by:

  • Creating a new framework for the rings widget
  • Migrating the existing code and tests
  • Importing the whole thing back into the app.
  • Packing it up as an uber-portable CocoaPods
  • Bonus: Setting up a repository for your framework

By the time you’re done, the app will behave exactly as it did before, but it will use the portable framework you developed! :]

Getting Started

Download the Phonercise Starter Project.

Phonercise is a simple application that replicates the Apple Watch Activity app, except it measures your phone’s physical activity. The three rings on the main view represent movement, standing and exercise.

To get the most out of the project, you’ll need to build and run on an actual iOS device, and turn on the volume. Go ahead now, build and run!

ios frameworks tutorial

Move the phone around to get credit for movement, and “exercise” the phone by shaking it vigorously — that’ll get its heartrate up. To get credit for standing up, just hold the phone upright.

The logic for the app is pretty simple:

  • ActionViewController.swift contains the view lifecycle and motion logic.
  • All the view logic is in the files in the Three Ring View folder, where you’ll find ThreeRingView.swift, which handles the view, and Fanfare.swift, which handles the audio. The other files handle the custom drawing of the shading, gradient and shapes.

The ring controls are pretty sweet. They’ve got an addictive quality and they’re easy to understand. Wouldn’t it be nice to use them in a number of applications beyond this fun, but completely silly app? Frameworks to the rescue!

Creating a Framework

Frameworks are self-contained, reusable chunks of code and resources that you can import into any number of apps and even share across iOS, tvOS, watchOS, and macOS apps.

If you’ve programmed in other languages, you may have heard of node modules, packages, gems, jars, etc. Frameworks are the Xcode version of these. Some examples of common frameworks in the iOS SDK are:Foundation, UIKit, AVFoundation, CloudKit, etc.

Framework Set Up

In Xcode 6, Apple introduced the Cocoa Touch Framework template along with access control, so creating frameworks has never been easier. The first thing to do is to create the project for the framework.

  1. Create a new project. In Xcode, go to File/New/Project.
  2. Choose iOS/Framework & Library/Cocoa Touch Framework to create a new framework.

    ios frameworks tutorial

  3. Click Next.
  4. Set the Product Name to ThreeRingControl. Use your own Organization Name and Organization Identifier. Check Include Unit Tests. That’s right! You’re going to have automated tests ensure your framework is bug free.

    ios frameworks tutorial

  5. Click Next.
  6. In the file chooser, choose to create the project at the same level as the Phonercise project.

    ios frameworks tutorial

  7. Click Create.

Now you have a project (albeit a boring one) that creates a framework!

Add Code and Resources

Your current state is a framework without code, and that is about as appealing as straight chocolate without sugar. In this section, you’ll put the pod in CocoaPods by adding the existing files to the framework.

From the Phonercise source directory, drag the following eight files into the ThreeRingControl project in Xcode:

  • CircularGradient.swift
  • coin07.mp3
  • Fanfare.swift
  • RingLayer.swift
  • RingTip.swift
  • ThreeRingView.swift
  • Utilities.swift
  • winning.mp3

ios frameworks tutorial

Make sure to check Copy items if needed, so that the files actually copy into the new project instead of just adding a reference. Frameworks need their own code, not references, to be independent.

Double-check that each of the files has Target Membership in ThreeRingControl to make sure they appear in the final framework. You can see this in the File Inspector for each file.

ios frameworks tutorial

Build the framework project to make sure that you get Build Succeeded with no build warnings or errors.

Add the Framework to the Project

Close the ThreeRingControl project, and go back to the Phonercise project. Delete the six files under theThree Ring View group as well as the two MP3 files in Helper Files. Select Move to Trash in the confirmation dialog.

ios frameworks tutorial

Build the project, and you’ll see several predictable errors where Xcode complains about not knowing what the heck a ThreeRingView is. Well, you’ll actually see messages along the lines of “Use of undeclared type 'ThreeRingView'“, among others.

Adding the Three Ring Control framework project to the workspace is the solution to these problems.

Add the Framework to the Project

Right-click on the root Phonercise node in the project navigator. Click Add Files to “Phonercise”. In the file chooser, navigate to and select ThreeRingControl.xcodeproj. This will add ThreeRingControl.xcodeproj as a sub-project.

Note: It isn’t strictly necessary to add the framework project to the app project; you could just add theThreeRingControl.framework output.

However, combining the projects makes it easier to develop both the framework and app simultaneously. Any changes you make to the framework project are automatically propagated up to the app. It also makes it easier for Xcode to resolve the paths and know when to rebuild the project.

Even though the two projects are now together in the workspace, Phonercise still doesn’t getThreeRingControl. It’s like they’re sitting in the same room, but Phonercise can’t see the new framework.

Try linking the framework to the app’s target to fix this problem. First, expand the ThreeRingControl project to see the Products folder, and then look for for ThreeRingControl.framework beneath it. This file is the output of the framework project that packages up the binary code, headers, resources and metadata.

Select the top level Phonercise node to open the project editor. Click the Phonercise target, and then go to theGeneral tab.

Scroll down to the Embedded Binaries section. Drag ThreeRingControl.framework from the Products folder ofThreeRingControl.xcodeproj onto this section.

You just added an entry for the framework in both Embedded Binaries and Linked Frameworks and Binaries.

ios frameworks tutorial

Now the app knows about the framework and where to find it, so that should be enough, right?

Build the Phonercise project. More of the same errors.
ios frameworks tutorial

Access Control

Your problem is that although the framework is part of the project, the project’s code doesn’t know about it — out of sight, out of mind.

Go to ActionViewController.swift, and add the following line to the list of imports at the top of the file.

import ThreeRingControl

It’s critical, but this inclusion won’t fix the build errors. This is because Swift uses access control to let you determine whether constructs are visible to other files or modules.

By default, Swift makes everything internal or visible only within its own module.

To restore functionality to the app, you have to update the access control on two Phonercise classes.

Although it’s a bit tedious, the process of updating access control improves modularity by hiding code not meant to appear outside the framework. You do this by leaving certain functions with no access modifier, or by explicitly declaring them internal.

Swift has three levels of access control. Use the following rules of thumb when creating your own frameworks:

  • Public: for code called by the app or other frameworks, e.g., a custom view.
  • Internal: for code used between functions and classes within the framework, e.g., custom layers in that view.
  • Fileprivate: for code used within a single file, e.g., a helper function that computes layout heights.
  • Private: for code used within an enclosing declaration, such as a single class block. Private code will not be visible to other blocks, such as extensions of that class, even in the same file, e.g., private variables, setters, or helper sub-functions.

Ultimately, making frameworks is so much easier than in the past, thanks to the new Cocoa Touch Framework template. Apple provided both of these in Xcode 6 and iOS 8.

Update the Code

When ThreeRingView.swift was part of the Phonercise app, internal access wasn’t a problem. Now that it’s in a separate module, it must be made public for the app to use it. The same is true of the code in Fanfare.swift.

Open ThreeRingView.swift inside of ThreeRingControlProject.

Make the class public by adding the public keyword to the class definition, like so:

public class ThreeRingView : UIView {

ThreeRingView will now be visible to any app file that imports the ThreeRingControl framework.

Add the public keyword to:

  • Both init functions
  • The variables RingCompletedNotification, AllRingsCompletedNotification, layoutSubviews()
  • Everything marked @IBInspectable — there will be nine of these

Note: You might wonder why you have to declare inits as public. Apple explains this and other finer points of access control in their Access Control Documentation.

The next step is to do essentially the same thing as you did for ThreeRingView.swift, and add the publickeyword to the appropriate parts of Fanfare.swift. For your convenience, this is already done.

Note that the following variables are public: ringSound, allRingSound, and sharedInstance. The functionplaySoundsWhenReady() is public as well.

Now build and run. The good news is that the errors are gone, and the bad news is that you’ve got a big, white square. Not a ring in sight. Oh no! What’s going on?

ios frameworks tutorial

Update the Storyboard

When using storyboards, references to custom classes need to have both the class name and module set in theIdentity Inspector. At the time of this storyboard’s creation, ThreeRingView was in the app’s module, but now it’s in the framework.

Update the storyboard, as explained below, by telling it where to find the custom view; this will get rid of the white square.

  1. Open Main.Storyboard in the Phonercise project.
  2. Select the Ring Control in the view hierarchy.
  3. In the Identity Inspector, under Custom Class, change the Module to ThreeRingControl.

Once you set the module, Interface Builder should update and show the control in the editor area.

ios frameworks tutorial

Build and run. Now you’ll get some rings.

ios frameworks tutorial

Update the Tests

There’s one final place to update before you can actually use the framework. It’s the oft-forgotten test suite. :]

This app includes unit tests. However, the tests have a dependency on ThreeRingControl, so you need to fix that.

Note: Before Swift 2.0, unit testing was difficult, but Swift 2.0 came along with @testable, making testing far easier. It means you no longer have to make all your project’s items public just to be able to test them.

Simply import the module you want to test using the @testable keyword, and your test target will have access to all internal routines in the imported module.

The first test is ThreeRingTest.swift, which tests functionality within ThreeRingView.swift and should be part of the ThreeRingControl framework.

From the PhonerciseTests group in the app project, drag ThreeRingTest.swift to the ThreeRingControlTestsgroup in the framework project.

Select Copy items if needed, and make sure you select the ThreeRingControlTests target and not the framework target.

ios frameworks tutorial

Then delete the ThreeRingTest.swift from the app project. Move it to the trash.

Open the copied test file, and change the import line from:

@testable import Phonercise

To:

import ThreeRingControl

Click the run test button in the editor’s gutter, and you’ll see a green checkmark showing that the test succeeded.

ios frameworks tutorial

This test doesn’t need @testable in its import since it is only calling public methods and variables.

The remaining app test doesn’t work this way though. Go back the to the Phonercise target and openPhonerciseTests.swift.

Add the following import to the existing imports at the top:

import ThreeRingControl

Now run the PhonerciseTests tests. The particular test should execute and pass.

Congratulations. You now have a working stand-alone framework and an app that uses it!

ios frameworks tutorial

Creating a CocoaPod

CocoaPods is a popular dependency manager for iOS projects. It’s a tool for managing and versioning dependencies. Similar to a framework, a CocoaPod, or ‘pod’ for short, contains code, resources, etc., as well as metadata, dependencies, and set up for libraries. In fact, CocoaPods are built as frameworks that are included in the main app.

Anyone can contribute libraries and frameworks to the public repository, which is open to other iOS app developers. Almost all of the popular third-party frameworks, such as Alamofire, React native and SDWebImage, distribute their code as a pod.

Here’s why you should care: by making a framework into a pod, you give yourself a mechanism for distributing the code, resolving the dependencies, including and building the framework source, and easily sharing it with your organization or the wider development community.

Clean out the Project

Perform the following steps to remove the current link to ThreeRingControl.

  1. Select ThreeRingControl.xcodeproj in the project navigator and delete it.
  2. Choose Remove Reference in the confirmation dialog, since you’ll need to keep the files on disk to create the pod.

Install CocoaPods

If you’ve never used CocoaPods before, you’ll need to follow a brief installation process before going any further. Go to the CocoaPods Installation Guide and come back here when you’re finished. Don’t worry, we’ll wait!

Create the Pod

Open Terminal in the ThreeRingControl directory.

Run the following command:

pod spec create ThreeRingControl

This creates the file ThreeRingControl.podspec in the current directory. It’s a template that describes the pod and how to build it. Open it in a text editor.

The template contains plenty of comment descriptions and suggestions for the commonly used settings.

  1. Replace the Spec Metadata section with:
    s.name = "ThreeRingControl"
    s.version = "1.0.0"
    s.summary = "A three-ring control like the Activity status bars"
    s.description = "The three-ring is a completely customizable widget that can be used in any iOS app. It also plays a little victory fanfare."
    s.homepage = "http://raywenderlich.com"

    Normally, the description would be a little more descriptive, and the homepage would point to a project page for the framework.

  2. Replace the Spec License section with the below code, as this iOS frameworks tutorial code uses an MIT License:
    s.license = "MIT"
  3. You can keep the Author Metadata section as is, or set it u with how you’d lke to be credited and contacted.
  4. Replace the Platform Specifics section with the below code, because this is an iOS-only framework.:
    s.platform = :ios, "10.0"
  5. Replace the Source Location with the below code. When you’re ready to share the pod, this will be a link to the GitHub repository and the commit tag for this version.
    s.source = { :path => '.' }
  6. Replace the Source Code section with:
    s.source_files = "ThreeRingControl", "ThreeRingControl/**/*.{h,m,swift}"
  7. And the Resources section with:
    s.resources = "ThreeRingControl/*.mp3"

    This will include the audio resources into the pod’s framework bundle.

  8. Remove the Project Linking and Project Settings sections.
  9. Add the following line. This line helps the application project understand that this pod’s code was written for Swift 3.
    s.pod_target_xcconfig = { 'SWIFT_VERSION' => '3' }
  10. Remove all the remaining comments — the lines that start with #.

You now have a workable development Podspec.

Note: If you run pod spec lint to verify the Podspec in Terminal, it’ll show an error because the source was not set to a valid URL. If you push the project to GitHub and fix that link, it will pass. However, having the linter pass is not necessary for local pod development. The Publish the Pod section below covers this.

Use the Pod

At this point, you’ve got a pod ready to rock and roll. Test it out by implementing it in the Phonercise app.

Back in Terminal, navigate up to the Phonercise directory, and then run the following command:

pod init

This steathily creates a new file named Podfile that lists all pods that the app uses, along with their versions and optional configuration information.

Open Podfile in a text editor.

Next, add the following line under the comment, # Pods for Phonercise:

pod 'ThreeRingControl', :path => '../ThreeRingControl'

Save the file.

Run this in Terminal:

pod install

With this command, you’re searching the CocoaPods repository and downloading any new or updated pods that match the Podfile criteria. It also resolves any dependencies, updates the Xcode project files so it knows how to build and link the pods, and performs any other required configuration.

Finally, it creates a Phonercise.xcworkspace file. Use this file from now on — instead of the xcodeproj — because it has the reference to the Pods project and the app project.

Check it Out

Close the Phonercise and ThreeRingControl projects if they are open, and then openPhonercise.xcworkspace.

Build and run. Like magic, the app should work exactly the same before. This ease of use is brought to you by these two facts:

  1. You already did the work to separate the ThreeRingControl files and use them as a framework, e.g. adding import statements.
  2. CocoaPods does the heavy lifting of building and packaging those files; it also takes care of all the business around embedding and linking.

Pod Organization

Take a look at the Pods project, and you’ll notice two targets:

ios frameworks tutorial

  • Pods-phonercise: a pod project builds all the individual pods as their own framework, and then combines them into one single framework: Pods-Phonercise.
  • ThreeRingControl: this replicates the same framework logic used for building it on its own. It even adds the music files as framework resources.

Inside the project organizer, you’ll see several groups. ThreeRingControl is under Development Pods. This is adevelopment pod because you defined the pod with :path link in the app’s Podfile. These files are symlinked, so you can edit and develop this code side-by-side with the main app code.

ios frameworks tutorial

Pods that come from a repository, such as those from a third party, are copied into the Pods directory and listed in a Pods group. Any modifications you make are not pushed to the repository and are overwritten whenever you update the pods.

Congratulations! You’ve now created and deployed a CocoaPod — and you’re probably thinking about what to pack into a pod first.

You’re welcome to stop here, congratulate yourself and move on to Where to Go From Here, but if you do, you’ll miss out on learning an advanced maneuver.

Publish the Pod

This section walks you through the natural next step of publishing the pod to GitHub and using it like a third party framework.

Create a Repository

If you don’t already have a GitHub account, create one.

Now create a new repository to host the pod. ThreeRingControl is the obvious best fit for the name, but you can name it whatever you want. Be sure to select Swift as the .gitignore language and MIT as the license.

ios frameworks tutorial

Click Create Repository. From the dashboard page that follows, copy the HTTPS link.

Clone the Repository

Go back to Terminal and create a new directory. The following commands will create a repo directory from the project’s folder.

mkdir repo
cd repo
 

From there, clone the GitHub repository. Replace the URL below with the HTTPS link from the GitHub page.

git clone URL
 

This will set up a Git folder and go on to copy the pre-created README and LICENSE files.

ios frameworks tutorial

Add the Code to the Repository

Next, copy the files from the previous ThreeRingControl directory to the repo/ThreeRingControl directory.

Open the copied version of ThreeRingControl.podspec, and update the s.source line to:

s.source = { :git => "URL", :tag => "1.0.0" }

Set the URL to be the link to your repository.

Make the Commitment

Now it gets real. In this step, you’ll commit and push the code to GitHub. Your little pod is about to enter the big kid’s pool.

Run the following commands in Terminal to commit those files to the repository and push them back to the server.

cd ThreeRingControl/
git add .
git commit -m "initial commit"
git push
 

Visit the GitHub page and refresh it to see all the files.

ios frameworks tutorial

Tag It

You need to tag the repository so it matches the Podspec. Run this command to set the tags:

git tag 1.0.0git push --tags

Check your handiwork by running:

pod spec lint

The response you’re looking for is ThreeRingControl.podspec passed validation.

Update the Podfile

Change the Podfile in the Phonercise directory. Replace the existing ThreeRingControl line with:

pod 'ThreeRingControl', :git => 'URL', :tag => '1.0.0'

Replace URL with your GitHub link.

From Terminal, run this in the Phonercise directory:

pod update

Now the code will pull the framework from the GitHub repository, and it is no longer be a development pod!

ios frameworks tutorial

Where to Go From Here?

In this iOS frameworks tutorial, you’ve made a framework from scratch that contains code and resources, you’ve reimported that framework back into your app, and even turned it into a CocoaPod. Nice work!

You can download the final project <a href="https://koenig-media.raywenderlich.com/uploads/2016/06/Phonercise-Final.zip" "="" style="border: 0px; font-family: inherit; font-style: inherit; font-weight: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline; color: rgb(0, 104, 55);">here. It doesn’t include the “advanced maneuver” steps, as the steps to set up a GitHub repository depends on your personal account information.

Hats off to Sam Davies for developing the ThreeRingControl. You might remember him from such videos asIntroducing Custom Controls, where you can learn more about custom controls and custom frameworks.

The team here has put together a lot of tutorials about CocoaPods, and now that you’ve gone through a crash course, you’re ready to learn more. Here are a couple that you might like:

Spend some time at CocoaPods.org and be sure to check out how to submit to the public pod repository and the dozens of configuration flags.

What did you learn from this? Any lingering questions? Want to share something that happened along the way? Let’s talk about it in the forums. See you there!

SAP FICO 银企直联实战:从配置到异常处理的全流程解析 本文详细解析了SAP FICO银企直联的实战配置与异常处理全流程,涵盖银行主数据搭建、支付类配置、银行接口适配等关键步骤。通过实际案例分享,帮助用户掌握实时付款、余额监控和自动对账等核心功能,提升企业财务效率与安全性。特别针对常见问题如凭证重复付款、前置机UUID冲突等提供了实用解决方案。 阅读详情

相关推荐

⑨【从0制作自己的ros导航小车:上位机篇】04、使用gmapping建图

前面的文章已经能够实现在odom坐标系下显示小车模型和里程计数据了,本文加上激光slam必不可少的传感器雷达,先进行测试,然后直接开始建图!

海风的博客 2916

iOS Swift Framework静态库制作与发布

尽管只是用到了framework文件,没有任何其他源代码文件,如果framework是由Swift写的,并且xcode版本(准确说是xcode command line tools版本)为10.2时,还是需要添加一个源码文件路径,并且在该路径下放一个随意的Swift文件,空的也可以,只要后缀是.swift即可。在新建工程时会自动生成一个工程名.h的头文件,并已经默认添加到暴露的头文件中,在打包时还会生成一个工程名-Swift.h的桥接文件,会把工程里带@objc的Swift类/方法/属性暴露出去。

feelinghappy的专栏 2041

2024年全国大学生信息安全竞赛安徽省赛网络系统建设与运维赛项-网络构建真题

该网络工程方案主要包含基础配置、有线网络、无线网络、出口网络、运维配置和SDN网络六个部分。基础配置包括设备接口设置、SSH服务开启和SNMP功能配置。有线网络部分重点部署VLAN、MSTP、VRRP和OSPF协议,实现网络冗余和负载均衡。无线网络规划了AP点位、信号覆盖和用户接入策略,包括SSID配置、频段优化和安全认证。出口网络配置了NAT转换、VPN隧道和流量审计功能。运维方面搭建了监控平台实时监测设备状态。SDN网络部分通过控制器实现流量管控。整个方案实现了多业务隔离、高可用性网络架构和

weixin_42221934的博客 1174

如何制作iOS开源库以及Framework,并使用cocoapod发布

本文大部分内容翻译自raywenderlich上的一篇教程,但这并不是一篇译文,并没有完全原文行文格式、顺序,而是对其有顺序调整和部分删减,另外还在原文的基础上新增、补全了一些内容 环境: Xcode Version 9.3 (9E145), Cocoapods 1.1+, iOS 8+ Swift/Objective-C 1 引言 1.1 Why 为什么我们需要开源库或Framework呢?...

weixin_34273046的博客 728

SpringBoot集成SpringSecurity5和OAuth2 — 2、OAuth2客户端【SSO单点登录时作为客户端】

SpringBoot集成SpringSecurity5和OAuth2 — 2、OAuth2客户端【SSO单点登录时作为客户端】

Mr_XiMu的博客 3742

PR控制以及使用PR控制用于单相离/并网逆变器

最近想学习一下并网逆变器,需要用到PR控制,全网找遍了许多学习资料,终于掌握的差不多了,在此做个记录,以及个人对PR(Proportional Resonant)控制的理解。在去年7月准备电赛的时候偶然看到有几篇讲解数字滤波器,第一次接触传递函数离散化,深刻被数字时代的数字方式折服,改改代码,就可以实现不同的截至频率,甚至不同阶数,而模拟方式还要改元器件。当时就感觉这玩意太他妈牛逼了,很想学懂它,奈何学不会呀。后面全身心做电赛,就忘了这事儿。直至最近学习PR控制,当初的感觉又回来了,一股劲儿吃下来了。

xht2403267701的博客 3万+

iOS Pod私有库生成中BUG解决方法

在生成pod私有库时,报错如下: - ERROR | [iOS] unknown: Encountered an unknown error (/usr/bin/xcrun simctl list -j devices xcrun: error: unable to find utility "simctl", not a developer tool or in PATH ) during validation. 解决方法: 在xcode设置里面,把Command line Tools设置一下

jacob_ios的博客 619

代付系统/代付系统源码/支付宝代付系统/API代付系统

简介: 其他站买的,没有做测试,源码是JAVA的,附带了安装文档,需要的拿无售后 源码下载地址https://www.skpan.cn/2QnIARSZDxG 代付系统/代付系统源码/支付宝代付系统/API代付系统 系统流程: 后台开通代理——开通商户——商户做代付(后台手工提交和 api 提交两种方式) 1、纯代付系统 2、支持个人支付宝全自动 3、支持单笔/批量/API接口方式代付 4、支持白名单、谷歌验证 5、收付款模式采用自动回调/自动转账 一、运营平台 商户管.

刀客源码网 5575

开始使用CocoaPods管理第3方库

Start 3rd-Lib with CocoaPodsXcode 5, using the iOS 7 SDK.Step 1: Download CocoaPodsCocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libra

pre_eminent的JAVA学习园地 769

Python教程:一文了解Python的深拷贝与浅拷贝

理解 Python 中的深拷贝(deep copy)和浅拷贝(shallow copy)是非常重要的,特别是在处理嵌套结构的数据时。让我们深入探讨这两个概念,并通过代码示例进行说明。

旦莫的博客 3967

YOLOv11改进 | 主干/Backbone篇 | 轻量级移动端网络ShuffleNetV2(附代码+修改教程)

本文给大家带来的改进内容是ShuffleNetV2,这是一种为移动设备设计的高效CNN架构。其在ShuffleNetV1的基础上强调除了FLOPs之外,还应考虑速度、内存访问成本和平台特性。(我在YOLOv11n上修改该主干降低了GFLOPs,但是参数量还是有一定上涨,其非常适合轻量化的读者来使用,同时精度也有一定程度的上涨)。本文通过介绍其主要框架原理,然后教你如何添加该网络结构到网络模型中。

Snu77的博客 3386

iOS Xcode GoMobile .framework 编译通过,运行链接报错

panic: seq.Inc: unknown refnum: -24 goroutine 17 [running, locked to thread]: golang.org/x/mobile/bind/seq.Inc(0x1ffffffe8) /var/folders/qr/mcc50f6n0z364vdjny2s012m0000gn/T/gomobile-work-283351333/iossimulator/pkg/mod/golang.org/x/mobile@v0.0.0-201907

大牛的专栏 2339

基于Multisim/TINA的H桥电机驱动电路设计与仿真分析

摘要 本文基于Multisim/TINA仿真平台,对H桥电机驱动电路进行了系统设计与分析。研究重点包括H桥拓扑结构的工作原理、PWM调速控制方法以及两种驱动方案对比分析。通过光耦隔离驱动与IR2110专用驱动IC的仿真对比,验证了IR2110自举电路在高低侧驱动中的优势。仿真实验着重分析了死区时间对防止直通现象的关键作用,并建立了直流电机的R-L-E等效模型进行动态特性仿真。结果表明,采用IR2110驱动方案配合适当的栅极电阻和自举电容参数,能够实现电机的高效双向调速控制。本研究为实际电机驱动系统的设计提供

huanghm88的专栏 137

iOS-发布代码到cocoapods上详细步骤

本文详细介绍了如何将代码发布到CocoaPods的完整流程。首先需要创建Framework项目并进行配置,包括添加代码文件、设置公开头文件以及添加第三方库支持。重点讲解了如何打包通用Framework,分别编译真机和模拟器版本后,使用xcodebuild和lipo工具合并成xcfamework格式。同时提供了完整的打包脚本实现自动化构建。最后简要提及了后续发布到CocoaPods的准备工作,包括创建Podspec文件和版本控制等步骤。

gavincarter 1418

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

iOS项目中混编flutter和打包发布

如果已有iOS项目,并且想在项目中添加flutter,可以按照以下方法处理。 1首先iOS项目同级目录下创建一个flutter_module,这个同级目录不是在iOS项目的文件里面, flutter create -t module flutter_module APPSS是我的以前的iOS项目文件,然后再同级目录下创建flutter_m 在podfile文件添加 flutter_application_path = '../flutter_m' load File.join(flutter_appli

xuyushiguang的博客 880

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

ios framework 制作

如果你是IOS的新手,并有.net开发的背景(就像我一样),你可能到处去找,哪里有dll呢? 其实,IOS平台是使用框架而不是dll,框架里面包含公共头文件和二进制文件。很不幸,XCode并不支持你自己去创建框架。 对于一个开发人员,这是个大问题,b/c缺少框架,我们就不得不去创建一个静态库文件。但是使用lib文件是一件痛苦的事情。实质上,向工程添加库的引用,并告诉功能工程在哪里可以找到你

NightWish 1062

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

IOS创建自己的框架

其实,IOS平台是使用框架而不是dll,框架里面包含公共头文件和二进制文件。很不幸,XCode并不支持你自己去创建框架。 对于一个开发人员,这是个大问题,b/c缺少框架,我们就不得不去创建一个静态库文件。但是使用lib文件是一件痛苦的事情。实质上,向工程添加库的引用,并告诉功能工程在哪里可以找到你的头文件,这对于用户体验并非一件好事 所以我们应该如何突破这个限制呢? 在查阅过大量的资料之

LDM 626

iOS静态库发布打包到cocoapod

一、创建 创建静态库可以选择Framework或Static Library,分别对应于.framework和.a库。 .a库是纯二进制文件,当项目中含有.c和.cpp的类文件时,就需要使用.a库;.a文件不能直接使用,至少要有.h文件配合,而.framework文件可以直接使用;.framework中除了二进制文件外,还可以包含资源文件bundle(包括图片资源、xib、storyboa...

u011915116的博客 701

iOS制作Framework

iOS制作Framework

m0_52635912的博客 182

iOS开发-创建Cocoapods公有库记录

文章目录1.创建git仓库2.更新工程代码3.生成podspec配置文件4.lint5.注册CocoaPods6.检测是否注册成功7.推送到远程Pod仓库 1.创建git仓库 2.更新工程代码 通过 git clone https://github.com/haocaihaocai/HCPushSettingViewController.git 将git仓库拉下来,然后将我们的代码添加。 git...

CaicaiNo.1 508

framework--怎么样使用bundle来共享资源

转载自:http://www.jianshu.com/p/ff50bce87f55 1、问题? iOS的一个限制,framework只能包含头文件和静态库。那么怎么样通过使用bundle整合资源,让其可以随着framework一起发布。 2、解决方法: 2.1、创建一个Bundle 资源都会被添加到bundle中。这将是A工程上的另一个目标。 1)

luco2008的专栏 2380

xcode4.3.2 下制作ios的framework 库

http://blog.sina.com.cn/s/blog_74e9d98d01014j2h.html 写在前面: 通过 Framework 可以在物理上实现 iOS 程序的模块化。 好处:       1、如果模块间接口定义的比较完善,模块化的程序具有很好的可扩展性与内聚性;       2、物理上的模块化便于开发过程的管理与测试,尤其是在程序规模相对

any 615

封装自己的Framwork

下载:iOS-Universal-Framework. 这个工程基本上是一个项目模板。只需安装这个项目,就可以创建项目。 使用方法: 下载zip文件.确保XCode已完全关闭打开Terminal,进入到刚下载文件,Fake Framework(伪框架)或Real Framework下的文件  输入命令:sh install.sh (如果你熟悉使用命令终端,只需运行install.

wangzeqivip的专栏 453

CocoaPods 自定义三方框架

1、创建项目以及配置信息 创建框架项目 打开终端,项目目录下执行命令 // FrameworkName pod lib create FrameworkName //此步骤会从git clone 一份项目框架 ,会有几个问题需要回答 诸如项目的语言类型 、选择测试框架、是否需要UIView 测试界面等问题 //完成后项目会自动打开 2、配置项目信息 把framework需要的类文件放到 XXX/Classes(没有就新建)目录下 把framework需要的资源文件放到XXX/Assets目录

qq_40023759的博客 370

Mac Xcode开发SDK,合并真机和模拟器的SDK,上传SDK到 cocoaPods

封装SDK自动打包合并真机和模拟器 # 注意 合并后需要手动把真机的module模块内容复制到新sdk中 #!/bin/sh #要build的target名 TARGET_NAME=${PROJECT_NAME} if [[ $1 ]] then TARGET_NAME=$1 fi UNIVERSAL_OUTPUT_FOLDER="${SRCROOT}/${PROJECT_NAME}/" #创建输出目录,并删除之前的framework文件 mkdir -p "${UNIVERSAL_OUTPUT_FOL

majian89351268的博客 511

iOS 静态库开发

文/汉斯哈哈哈(简书作者) 原文链接:http://www.jianshu.com/p/8f5b9855efb8 简介 在企业开发中,一些核心技术或者常用框架,出于安全性和稳定性的考虑,不想被外界知道,所以会把核心代码打包成静态库,只暴露头文件给程序员使用(比如:友盟、百度地图等第三方的sdk) 静态库和动态库的存在形式 静态库:.a 和 .framework 动态库:.d

sily_13的专栏 304
上一篇: QT 5.7 for iOS Xcode 8 Project ERROR: Xcode not set up properly. You may need to confirm the license
下一篇: 通过CocoaPods 将storyboards、xibs和资源文件打包到iOS framework
Willib
博客等级 码龄14年 83粉丝 44原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值